1818import graphql .schema .GraphQLType ;
1919import org .testng .annotations .Test ;
2020
21- import java .util .Arrays ;
22- import java .util .LinkedList ;
23- import java .util .List ;
24- import java .util .Optional ;
21+ import java .util .*;
2522import java .util .stream .Collectors ;
2623import java .util .stream .Stream ;
2724
@@ -92,6 +89,9 @@ public void long_() {
9289 @ SuppressWarnings ("unused" )
9390 public Stream <List <@ GraphQLNonNull String >> streamMethod () { return null ;}
9491
92+ @ SuppressWarnings ("unused" )
93+ public Set <Set <@ GraphQLNonNull String >> setMethod () { return null ;}
94+
9595 @ Test
9696 public void list () throws NoSuchMethodException {
9797 DefaultTypeFunction instance = new DefaultTypeFunction ();
@@ -103,6 +103,17 @@ public void list() throws NoSuchMethodException {
103103 assertEquals (wrappedType .getWrappedType (), GraphQLString );
104104 }
105105
106+ @ Test
107+ public void set () throws NoSuchMethodException {
108+ DefaultTypeFunction instance = new DefaultTypeFunction ();
109+ graphql .schema .GraphQLType type = instance .apply (getClass ().getMethod ("setMethod" ).getReturnType (), getClass ().getMethod ("setMethod" ).getAnnotatedReturnType ());
110+ assertTrue (type instanceof GraphQLList );
111+ GraphQLList subtype = (GraphQLList ) ((GraphQLList ) type ).getWrappedType ();
112+ assertTrue (subtype .getWrappedType () instanceof graphql .schema .GraphQLNonNull );
113+ graphql .schema .GraphQLNonNull wrappedType = (graphql .schema .GraphQLNonNull ) subtype .getWrappedType ();
114+ assertEquals (wrappedType .getWrappedType (), GraphQLString );
115+ }
116+
106117 @ Test (expectedExceptions = IllegalArgumentException .class )
107118 public void unparametrizedList () {
108119 DefaultTypeFunction instance = new DefaultTypeFunction ();
0 commit comments