3030import java .util .HashMap ;
3131import java .util .Map ;
3232
33+ import static graphql .annotations .AnnotationsSchemaCreator .newAnnotationsSchema ;
3334import static org .testng .Assert .*;
3435
3536@ SuppressWarnings ("unchecked" )
@@ -69,7 +70,6 @@ public Result(int i) {
6970 this .i = i ;
7071 }
7172
72- @ GraphQLField
7373 public int getI () {
7474 return i ;
7575 }
@@ -129,7 +129,7 @@ public void noArgMutation() {
129129 assertNotNull (returnType .getFieldDefinition ("getI" ));
130130 assertNotNull (returnType .getFieldDefinition ("clientMutationId" ));
131131
132- GraphQLSchema schema = GraphQLSchema . newSchema ().query (object ).mutation (object ).build ();
132+ GraphQLSchema schema = newAnnotationsSchema ().query (TestObject . class ).mutation (TestObject . class ).build ();
133133
134134 GraphQL graphQL = GraphQL .newGraphQL (schema ).queryExecutionStrategy (new EnhancedExecutionStrategy ()).build ();
135135
@@ -151,7 +151,7 @@ public void interfaceReturningMutation() {
151151
152152 assertNotNull (doSomething );
153153
154- GraphQLSchema schema = GraphQLSchema . newSchema ().query (object ).mutation (object ).build ();
154+ GraphQLSchema schema = newAnnotationsSchema ().query (TestObject . class ).mutation (TestObject . class ).build ();
155155
156156 GraphQL graphQL = GraphQL .newGraphQL (schema ).queryExecutionStrategy (new EnhancedExecutionStrategy ()).build ();
157157
@@ -190,7 +190,7 @@ public void argMutation() {
190190 assertNotNull (returnType .getFieldDefinition ("getI" ));
191191 assertNotNull (returnType .getFieldDefinition ("clientMutationId" ));
192192
193- GraphQLSchema schema = GraphQLSchema . newSchema ().query (object ).mutation (object ). codeRegistry ( this . graphQLAnnotations . getContainer (). getCodeRegistryBuilder (). build () ).build ();
193+ GraphQLSchema schema = newAnnotationsSchema ().query (TestObject . class ).mutation (TestObject . class ).build ();
194194
195195 GraphQL graphQL = GraphQL .newGraphQL (schema ).queryExecutionStrategy (new EnhancedExecutionStrategy ()).build ();
196196
@@ -227,7 +227,7 @@ public void argVariableMutation() {
227227 assertNotNull (returnType .getFieldDefinition ("getI" ));
228228 assertNotNull (returnType .getFieldDefinition ("clientMutationId" ));
229229
230- GraphQLSchema schema = GraphQLSchema . newSchema ().query (object ).mutation (object ).build ();
230+ GraphQLSchema schema = newAnnotationsSchema ().query (TestObject . class ).mutation (TestObject . class ).build ();
231231
232232 GraphQL graphQL = GraphQL .newGraphQL (schema ).queryExecutionStrategy (new EnhancedExecutionStrategy ()).build ();
233233
0 commit comments