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

Spring Boot Starter adds both AssertJ and Hamcrest assertion libraries #15789

Closed
nightswimmings opened this issue Jan 25, 2019 · 5 comments
Closed
Labels
status: declined A suggestion or change that we don't feel we should currently apply

Comments

@nightswimmings
Copy link

nightswimmings commented Jan 25, 2019

I am just wondering whether this makes sense, or it could make more sense to just advocate for a conventional implementation as other Boot defaults, or even make both optional.

Its just confusing with all the assert signatures intermixed in the IDE.
AssertJ seems much more readable and complete, its a single library, more maintained,more suited to autocomplete; it does not have half of the library deprecated and supports nicely latest features of the language, but it's just my opinion.

Has this debate been raised ever?

@wilkinsona
Copy link
Member

Thanks for the suggestion. There's nothing that we can do about this at the moment as JUnit 4 depends on Hamcrest. We could remove Hamcrest from the test starter as part of upgrading to JUnit 5, but our goal with that upgrade is to provide people with a seamless upgrade from JUnit 4 (by including the vintage engine). Removing Hamcrest would go against that goal as it would be a breaking change. That said, I've made a note in #14736 so that we can consider this as and when we upgrade to JUnit 5.

@wilkinsona wilkinsona removed the status: waiting-for-triage An issue we've not yet triaged label Jan 25, 2019
@nightswimmings
Copy link
Author

Thanks Andy!

@gavvvr
Copy link
Contributor

gavvvr commented Aug 5, 2021

@wilkinsona there is no jUnit 4 in test starter anymore. Why Hamcrest was left?

I've seen your comment on a chance to remove Hamcrest with the switch to jUnit 5, but did not find any further discussion and decision why Hamcrest was left.

@wilkinsona
Copy link
Member

I'm afraid I can't recall why Hamcrest was left in the starter. It may have been an oversight or it may be that there was a good reason for it that I've since forgotten. I'll re-open this one so that we can consider it again.

@wilkinsona wilkinsona reopened this Aug 9, 2021
@wilkinsona wilkinsona added status: waiting-for-triage An issue we've not yet triaged for: team-meeting An issue we'd like to discuss as a team to make progress labels Aug 9, 2021
@philwebb
Copy link
Member

Currently Spring Framework's MockMVC classes make use of Hamcrest so I don't think that we should remove it just yet. There's a Spring Framework issue about supporting an AssertJ alternative. I have a feeling there are a few other test libraries that also use it.

I'm going to close this one for now since we can't easily remove it and it's not really hurting things to keep it.

@philwebb philwebb added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged for: team-meeting An issue we'd like to discuss as a team to make progress labels Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

No branches or pull requests

5 participants