File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/test/java/graphql/annotations Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 2929
3030import java .lang .annotation .Retention ;
3131import java .lang .annotation .RetentionPolicy ;
32+ import java .util .Arrays ;
3233import java .util .Set ;
3334
3435import static graphql .Scalars .GraphQLBoolean ;
@@ -122,9 +123,10 @@ public void suffixDirective(@GraphQLName("suffix") @GraphQLDescription("the suff
122123 public void directive_suppliedDirectiveMethodContainer_returnCorrectDirective () {
123124 // Act
124125 Set <GraphQLDirective > directive = this .graphQLAnnotations .directives (DirectivesMethodsContainer .class );
126+ GraphQLDirective [] directives = directive .toArray (new GraphQLDirective []{});
125127
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 ];
128130
129131 // Assert
130132 assertEquals (upper .getName (), "upper" );
You can’t perform that action at this time.
0 commit comments