Skip to content

Commit ee210e0

Browse files
committed
Fixed duplicate flaky test in other file path
1 parent 2193b2b commit ee210e0

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

inject/hk2/src/test/java/org/glassfish/jersey/inject/hk2/DisposableSupplierTest.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
package org.glassfish.jersey.inject.hk2;
1818

1919
import java.lang.reflect.Type;
20+
import java.util.HashSet;
21+
import java.util.Set;
2022
import java.util.concurrent.atomic.AtomicInteger;
2123
import java.util.concurrent.atomic.AtomicReference;
2224
import java.util.function.Supplier;
@@ -374,9 +376,17 @@ public void testDisposeComposedObjectWithPerLookupFields() {
374376

375377
// All instances should be the same because they are request scoped.
376378
ComposedObject instance = injectionManager.getInstance(ComposedObject.class);
377-
assertEquals("1", instance.first);
378-
assertEquals("2", instance.second);
379-
assertEquals("3", instance.third);
379+
Set<String> set1 = new HashSet<String>() {{
380+
add("1");
381+
add("2");
382+
add("3");
383+
}};
384+
Set<String> set2 = new HashSet<String>() {{
385+
add(instance.first.toString());
386+
add(instance.second.toString());
387+
add(instance.third.toString());
388+
}};
389+
assertEquals(set1, set2);
380390
});
381391

382392
Supplier<String> cleanedSupplier = atomicSupplier.get();

0 commit comments

Comments
 (0)