File tree 1 file changed +4
-2
lines changed
src/test/java/graphql/annotations
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 29
29
30
30
import java .lang .annotation .Retention ;
31
31
import java .lang .annotation .RetentionPolicy ;
32
+ import java .util .Arrays ;
32
33
import java .util .Set ;
33
34
34
35
import static graphql .Scalars .GraphQLBoolean ;
@@ -122,9 +123,10 @@ public void suffixDirective(@GraphQLName("suffix") @GraphQLDescription("the suff
122
123
public void directive_suppliedDirectiveMethodContainer_returnCorrectDirective () {
123
124
// Act
124
125
Set <GraphQLDirective > directive = this .graphQLAnnotations .directives (DirectivesMethodsContainer .class );
126
+ GraphQLDirective [] directives = directive .toArray (new GraphQLDirective []{});
125
127
126
- GraphQLDirective upper = (GraphQLDirective ) directive .toArray ()[0 ];
127
- GraphQLDirective suffix = (GraphQLDirective ) directive . toArray ()[1 ];
128
+ GraphQLDirective upper = (GraphQLDirective ) Arrays . stream ( directives ). filter ( x -> x . getName (). equals ( "upper" )) .toArray ()[0 ];
129
+ GraphQLDirective suffix = (GraphQLDirective ) Arrays . stream ( directives ). filter ( x -> x . getName (). equals ( "suffix" )). toArray ()[0 ];
128
130
129
131
// Assert
130
132
assertEquals (upper .getName (), "upper" );
You can’t perform that action at this time.
0 commit comments