11/**
22 * Copyright 2016 Yurii Rashkovskii
3- *
3+ * <p>
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
66 * You may obtain a copy of the License at
7- *
7+ * <p>
88 * http://www.apache.org/licenses/LICENSE-2.0
9- *
9+ * <p>
1010 * Unless required by applicable law or agreed to in writing, software
1111 * distributed under the License is distributed on an "AS IS" BASIS,
1212 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -95,7 +95,8 @@ public Object get(DataFetchingEnvironment environment) {
9595 public void fields () {
9696 GraphQLAnnotations instance = new GraphQLAnnotations ();
9797 instance .registerTypeExtension (TestObjectExtension .class );
98- GraphQLObjectType object = instance .getObject (GraphQLExtensionsTest .TestObject .class );
98+ GraphQLObjectHandler graphQLObjectHandler = new GraphQLObjectHandler ();
99+ GraphQLObjectType object = graphQLObjectHandler .getObject (GraphQLExtensionsTest .TestObject .class , instance .getContainer ());
99100 instance .unregisterTypeExtension (TestObjectExtension .class );
100101
101102 List <GraphQLFieldDefinition > fields = object .getFieldDefinitions ();
@@ -114,7 +115,8 @@ public void fields() {
114115 public void values () {
115116 GraphQLAnnotations instance = new GraphQLAnnotations ();
116117 instance .registerTypeExtension (TestObjectExtension .class );
117- GraphQLObjectType object = instance .getObject (GraphQLExtensionsTest .TestObject .class );
118+ GraphQLObjectHandler graphQLObjectHandler = new GraphQLObjectHandler ();
119+ GraphQLObjectType object = graphQLObjectHandler .getObject (GraphQLExtensionsTest .TestObject .class , instance .getContainer ());
118120 instance .unregisterTypeExtension (TestObjectExtension .class );
119121
120122 GraphQLSchema schema = newSchema ().query (object ).build ();
@@ -132,8 +134,9 @@ public void values() {
132134 @ Test
133135 public void testDuplicateField () {
134136 GraphQLAnnotations instance = new GraphQLAnnotations ();
137+ GraphQLObjectHandler graphQLObjectHandler = new GraphQLObjectHandler ();
135138 instance .registerTypeExtension (TestObjectExtensionInvalid .class );
136- GraphQLAnnotationsException e = expectThrows (GraphQLAnnotationsException .class , () -> instance .getObject (TestObject .class ));
139+ GraphQLAnnotationsException e = expectThrows (GraphQLAnnotationsException .class , () -> graphQLObjectHandler .getObject (TestObject .class , instance . getContainer () ));
137140 assertTrue (e .getMessage ().startsWith ("Duplicate field" ));
138141 instance .unregisterTypeExtension (TestObjectExtensionInvalid .class );
139142 }
0 commit comments