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

Document automated migration from Hamcrest to AssertJ #146

Closed
timtebeek opened this issue Aug 24, 2023 · 2 comments · Fixed by #148
Closed

Document automated migration from Hamcrest to AssertJ #146

timtebeek opened this issue Aug 24, 2023 · 2 comments · Fixed by #148
Assignees

Comments

@timtebeek
Copy link
Contributor

Hi! The documentation already has a section on migrating from JUnit to AssertJ with scripts. The documentation does not yet document a way to migrate from Hamcrest assertions to AssertJ.

An automated migration from Hamcrest to AssertJ is (in large part) possible with the OSS OpenRewrite, either by running Migrate Hamcrest to AssertJ assertions or the broader AssertJ best practices recipe. The latter also migrates JUnit to AssertJ, and adopts more expressive assertions for AssertJ, as seen in this example PR for Spring Security.

Would you all be open to adding a section to the docs to document the Hamcrest and JUnit to AssertJ migration with OpenRewrite?

I'd be happy to help write such a section, but wanted to reach out before I do so, and ask how you would like to position the above as compared to the regex script based approach that exists currently.

@scordio
Copy link
Member

scordio commented Aug 24, 2023

Great idea, @timtebeek!

I think a subchapter of https://assertj.github.io/doc/#assertj-migration (e.g., 2.7.3) could be a good place for it.

Thanks for the help!

@timtebeek
Copy link
Contributor Author

@mike-solomon was kind enough to help out in writing a chapter on OpenRewrite migrations for AssertJ, which includes migrating away from Hamcrest

Thanks again for offering to include this in the docs, and thanks to Mike for the write up.

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 a pull request may close this issue.

2 participants