Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve assertJ tests by using containsExactlyInAnyOrder #6187

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

everbrightw
Copy link
Contributor

@everbrightw everbrightw commented Dec 6, 2024

Description:

  • The modified two tests could sometimes fail. Improved AssertJ tests by using containsExactlyInAnyOrder to account for HashSet 's unordered nature.
  • containsExactly inherently relies on stream to populate the collections and test if the target values are the same and in order
  • According to AssertJ's documentation:
    • containsExactly verifies that the actual group contains exactly the given values in order.
    • containsExactlyInAnyOrder verifies that the actual group contains exactly the given values in any order.

@mariofusco mariofusco requested a review from pibizza December 10, 2024 08:45
Copy link
Contributor

@pibizza pibizza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, thanks a lot.

@mariofusco mariofusco merged commit a586bb4 into apache:main Dec 10, 2024
8 of 10 checks passed
rgdoliveira pushed a commit to rgdoliveira/drools that referenced this pull request Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants