Skip to content

Commit 80fcb7d

Browse files
committed
FIX TEST
1 parent 129d239 commit 80fcb7d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/test/java/graphql/annotations/GraphQLDirectiveCreationTest.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
import java.lang.annotation.Retention;
3131
import java.lang.annotation.RetentionPolicy;
32+
import java.util.Arrays;
3233
import java.util.Set;
3334

3435
import 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");

0 commit comments

Comments
 (0)