Skip to content

Commit 30418ba

Browse files
committed
integrated PR comments
1 parent 8bbb7bc commit 30418ba

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/test/groovy/graphql/kickstart/tools/SchemaParserSpec.groovy

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package graphql.kickstart.tools
33
import graphql.kickstart.tools.resolver.FieldResolverError
44
import graphql.language.SourceLocation
55
import graphql.schema.GraphQLInterfaceType
6+
import graphql.schema.GraphQLObjectType
67
import graphql.schema.GraphQLSchema
78
import org.springframework.aop.framework.ProxyFactory
89
import spock.lang.Specification
@@ -445,7 +446,8 @@ class SchemaParserSpec extends Specification {
445446
traits: [PoodleTrait]
446447
}
447448
448-
type Query { test: [Poodle] }'''.stripIndent())
449+
type Query { test: [Poodle] }
450+
'''.stripIndent())
449451
.resolvers(new GraphQLQueryResolver() {
450452
static abstract class Trait {
451453
String id;
@@ -476,12 +478,20 @@ class SchemaParserSpec extends Specification {
476478
})
477479
.build()
478480
.makeExecutableSchema()
479-
GraphQLInterfaceType traitInterface = schema.getType("MammalTrait") as GraphQLInterfaceType
481+
GraphQLInterfaceType traitInterface = schema.getType("Trait") as GraphQLInterfaceType
482+
GraphQLInterfaceType animalInterface = schema.getType("Animal") as GraphQLInterfaceType
483+
GraphQLInterfaceType mammalTraitInterface = schema.getType("MammalTrait") as GraphQLInterfaceType
480484
GraphQLInterfaceType dogInterface = schema.getType("Dog") as GraphQLInterfaceType
485+
GraphQLObjectType poodleObject = schema.getType("Poodle") as GraphQLObjectType
486+
GraphQLObjectType poodleTraitObject = schema.getType("PoodleTrait") as GraphQLObjectType
481487

482488
then:
483-
!traitInterface.interfaces.empty
484-
!dogInterface.interfaces.empty
489+
poodleObject.interfaces.containsAll([dogInterface, animalInterface])
490+
poodleTraitObject.interfaces.containsAll([mammalTraitInterface, traitInterface])
491+
dogInterface.interfaces.contains(animalInterface)
492+
mammalTraitInterface.interfaces.contains(traitInterface)
493+
traitInterface.interfaces.empty
494+
animalInterface.interfaces.empty
485495
}
486496

487497
enum EnumType {

0 commit comments

Comments
 (0)