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

Add matchers for Atomic Booleans #1791

Closed
sksamuel opened this issue Oct 20, 2020 · 4 comments · Fixed by #1802
Closed

Add matchers for Atomic Booleans #1791

sksamuel opened this issue Oct 20, 2020 · 4 comments · Fixed by #1802
Labels
assertions 🔍 Related to the assertion mechanisms within the testing framework. enhancement ✨ Suggestions for adding new features or improving existing ones.
Milestone

Comments

@sksamuel
Copy link
Member

AtomicBoolean(false).shouldBeTrue()

AtomicInteger(123).shouldBeLessThan(555)

And so on.

@sksamuel sksamuel added enhancement ✨ Suggestions for adding new features or improving existing ones. assertions 🔍 Related to the assertion mechanisms within the testing framework. labels Oct 20, 2020
@sksamuel sksamuel added this to the 4.4 milestone Oct 20, 2020
@simonenkoi
Copy link
Contributor

@sksamuel I see possible problems with the maintainability of such a feature. For example, if we add a new assertion on the type, it will be expected to have the same one for the atomic type.
Do we need to support all the assertions defined on the V type accessible from AtomicReference<V>, not only predefined AtomicBoolean, AtomicInteger, etc.?
AtomicBoolean(false).get().shouldBeTrue() syntax looks clear from my point of view, and, as a user, I guess it will confuse more than help. Please, share your thoughts.

@sksamuel
Copy link
Member Author

Yes, that's a good point.
Maybe just one for the booleans would be sufficient. I was using atomics this morning, and atomic.get().shouldBeTrue() was more verbose than I wanted, when atomic.shouldBeTrue() would have been a tiny bit nicer.

@Megamiun
Copy link
Contributor

Is anyone working on it? If not, I can do it. Should we just make shouldBeTrue and shouldBeFalse?

@sksamuel
Copy link
Member Author

sksamuel commented Oct 22, 2020 via email

@sksamuel sksamuel mentioned this issue Oct 25, 2020
43 tasks
@sksamuel sksamuel changed the title Add matchers for Atomics Add matchers for Atomic Booleans Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assertions 🔍 Related to the assertion mechanisms within the testing framework. enhancement ✨ Suggestions for adding new features or improving existing ones.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants