Skip to content

Commit 73df8d3

Browse files
Rette66manusa
authored andcommitted
fix flaky test
1 parent d70267d commit 73df8d3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

junit/mockwebserver/src/test/groovy/io/fabric8/mockwebserver/crud/AttributeSetTest.groovy

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,13 @@ class AttributeSetTest extends Specification {
106106
when:
107107
AttributeSet attributeSet = new AttributeSet(a2)
108108
AttributeSet selectorWithOne = new AttributeSet(a2)
109-
AttributeSet selectorWithTwo = new AttributeSet(a2, a3);
109+
AttributeSet selectorWithTwo = new AttributeSet(a2, a3)
110+
def orderedAttributes = new LinkedHashSet([a2, a3]);
110111
then:
111112

112113
// Assert that the order is suitable for testing. The failing attribute should
113114
// be in the *second* position to ensure we're examining all the values of the selector
114-
assert new ArrayList<>(selectorWithTwo.attributes.values()).indexOf(a3) == 1;
115+
assert new ArrayList<>(orderedAttributes).indexOf(a3) == 1;
115116

116117
assert attributeSet.matches(selectorWithOne)
117118
assert !attributeSet.matches(selectorWithTwo)

0 commit comments

Comments
 (0)