Skip to content

Commit 19af8b5

Browse files
committed
fix: flaky test
We may randomly create two Options.empty objects which are the same, so we cannot check if we cached any of these.
1 parent 1f84194 commit 19af8b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/test/java/com/github/nylle/javafixture/specimen/GenericSpecimenTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ void constructedGenericsAreNotCached() {
120120
var first = new GenericSpecimen<>(new SpecimenType<Optional<Integer>>() {}, context, specimenFactory).create(noContext(), new Annotation[0]);
121121
var second = new GenericSpecimen<>(new SpecimenType<Optional<Integer>>() {}, context, specimenFactory).create(noContext(), new Annotation[0]);
122122

123-
assertThat(first).isNotEqualTo(second);
123+
assertThat(first.orElse(1)).as("work around that we might have constructed two Optional.empty values").isNotEqualTo(second.orElse(2));
124124

125125
}
126126

0 commit comments

Comments
 (0)