Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Commit 6d73ea0

Browse files
committed
Java 8 compat
1 parent 3ae07c5 commit 6d73ea0

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

graphql-kickstart-spring-support/src/test/java/graphql/kickstart/spring/error/GraphQLErrorFromExceptionHandlerTest.java

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import graphql.GraphQLError;
55
import graphql.GraphqlErrorException;
66
import graphql.language.SourceLocation;
7+
import java.util.ArrayList;
78
import java.util.List;
89
import org.junit.jupiter.api.Test;
910

@@ -14,17 +15,18 @@ class GraphQLErrorFromExceptionHandlerTest {
1415
void allows_errors_with_null_path() {
1516
GraphQLErrorFromExceptionHandler sut = new GraphQLErrorFromExceptionHandler(List.of());
1617

17-
List<GraphQLError> errors = List.of(
18-
GraphqlErrorException.newErrorException()
19-
.message("Error without a path")
20-
.sourceLocation(new SourceLocation(0, 0))
21-
.build(),
22-
GraphqlErrorException.newErrorException()
23-
.message("Error with path")
24-
.sourceLocation(new SourceLocation(0, 0))
25-
.errorClassification(ErrorType.ValidationError)
26-
.path(List.of())
27-
.build());
18+
List<GraphQLError> errors = new ArrayList<>();
19+
errors.add(GraphqlErrorException.newErrorException()
20+
.message("Error without a path")
21+
.sourceLocation(new SourceLocation(0, 0))
22+
.build());
23+
errors.add(GraphqlErrorException.newErrorException()
24+
.message("Error with path")
25+
.sourceLocation(new SourceLocation(0, 0))
26+
.errorClassification(ErrorType.ValidationError)
27+
.path(new ArrayList<>())
28+
.build());
29+
2830
List<GraphQLError> processedErrors = sut.filterGraphQLErrors(errors);
2931

3032
for (int i = 0; i < errors.size(); i++) {

0 commit comments

Comments
 (0)