Skip to content

Commit 69460c9

Browse files
committed
fix tests of simple connection and enhanced connection
1 parent 868867f commit 69460c9

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/test/java/graphql/annotations/connection/GraphQLEnhancedConnectionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public void ConnectionFieldDoesntReturnPaginatedData_tryToBuildSchema_getExcepti
135135
public void validDatafetcher_queryForCursors_getValidCursors() throws Exception {
136136
//Arrange
137137
ExecutionInput executionInput = new ExecutionInput("{ objs(first:2) { edges { cursor } } }",
138-
null, "CONTEXT", null, null);
138+
null, "CONTEXT", null, new HashMap<>());
139139
//Act
140140
ExecutionResult result = graphQL.execute(executionInput);
141141
Map<String, Map<String, List<Map<String, Map<String, Object>>>>> data = result.getData();

src/test/java/graphql/annotations/connection/GraphQLSimpleConnectionTest.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import graphql.annotations.processor.GraphQLAnnotations;
2424
import graphql.schema.DataFetcher;
2525
import graphql.schema.DataFetchingEnvironment;
26-
import graphql.schema.GraphQLObjectType;
2726
import graphql.schema.GraphQLSchema;
2827
import org.testng.annotations.BeforeMethod;
2928
import org.testng.annotations.Test;
@@ -32,7 +31,7 @@
3231
import java.util.HashMap;
3332
import java.util.List;
3433

35-
import static graphql.schema.GraphQLSchema.newSchema;
34+
import static graphql.annotations.AnnotationsSchemaCreator.newAnnotationsSchema;
3635
import static org.hamcrest.CoreMatchers.is;
3736
import static org.hamcrest.MatcherAssert.assertThat;
3837
import static org.testng.Assert.assertEquals;
@@ -49,8 +48,7 @@ public void init() {
4948

5049
@Test
5150
public void simpleConnection_buildSchema_TypeOfSimpleConnectionIsGraphQLList() throws Exception {
52-
GraphQLObjectType object = this.graphQLAnnotations.object(MainConnection.class);
53-
GraphQLSchema schema = newSchema().query(object).build();
51+
GraphQLSchema schema = newAnnotationsSchema().query(MainConnection.class).build();
5452

5553
String objsTypeName = schema.getQueryType().getFieldDefinition("objs").getType().getName();
5654

@@ -69,8 +67,7 @@ public void simpleConnection_returnTypeIsNotValid_throwsError() {
6967

7068
@Test
7169
public void simpleConnection_queryForOverAll_getCorrectAnswer() {
72-
GraphQLObjectType object = this.graphQLAnnotations.object(MainConnection.class);
73-
GraphQLSchema schema = newSchema().query(object).build();
70+
GraphQLSchema schema = newAnnotationsSchema().query(MainConnection.class).build();
7471
GraphQL graphQL = GraphQL.newGraphQL(schema).build();
7572

7673

@@ -83,8 +80,7 @@ public void simpleConnection_queryForOverAll_getCorrectAnswer() {
8380

8481
@Test
8582
public void simpleConnection_queryForTwoObject_getTwoObject() {
86-
GraphQLObjectType object = this.graphQLAnnotations.object(MainConnection.class);
87-
GraphQLSchema schema = newSchema().query(object).build();
83+
GraphQLSchema schema = newAnnotationsSchema().query(MainConnection.class).build();
8884
GraphQL graphQL = GraphQL.newGraphQL(schema).build();
8985

9086

0 commit comments

Comments
 (0)