Skip to content

Commit d93dad3

Browse files
author
mattesja
committed
added javadoc (#62)
1 parent 0d4204f commit d93dad3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/test/java/graphql/annotations/GraphQLFragmentTest.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,12 @@ public class GraphQLFragmentTest {
3131

3232
static Map<String, GraphQLObjectType> registry;
3333

34+
/**
35+
* Test a query which returns a list (RootObject.items) of two different classes (MyObject + MyObject2) which implement the same interface (MyInterface).
36+
*/
3437
@Test
35-
public void test() throws Exception {
36-
38+
public void testInterfaceInlineFragment() throws Exception {
39+
// Given
3740
registry = new HashMap<>();
3841

3942
GraphQLInterfaceType iface = (GraphQLInterfaceType) GraphQLAnnotations.iface(MyInterface.class);
@@ -54,9 +57,11 @@ public void test() throws Exception {
5457

5558
GraphQL graphQL2 = new GraphQL(schema);
5659

60+
// When
5761
ExecutionResult graphQLResult = graphQL2.execute("{items { ... on MyObject {a, my {b}} ... on MyObject2 {a, b} }}", new RootObject());
5862
Set resultMap = ((Map) graphQLResult.getData()).entrySet();
5963

64+
// Then
6065
assertEquals(graphQLResult.getErrors().size(), 0);
6166
assertEquals(resultMap.size(), 1);
6267
}

0 commit comments

Comments
 (0)