Skip to content

Commit

Permalink
fix: flaky test
Browse files Browse the repository at this point in the history
We may randomly create two Options.empty objects which are the same,
so we cannot check if we cached any of these.
  • Loading branch information
akutschera committed Aug 25, 2024
1 parent 1f84194 commit 19af8b5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void constructedGenericsAreNotCached() {
var first = new GenericSpecimen<>(new SpecimenType<Optional<Integer>>() {}, context, specimenFactory).create(noContext(), new Annotation[0]);
var second = new GenericSpecimen<>(new SpecimenType<Optional<Integer>>() {}, context, specimenFactory).create(noContext(), new Annotation[0]);

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

}

Expand Down

0 comments on commit 19af8b5

Please sign in to comment.