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

Consider suggesting the package name of assertThat in Code of Conduct #19845

Closed
linghengqian opened this issue Aug 3, 2022 · 4 comments · Fixed by #21046
Closed

Consider suggesting the package name of assertThat in Code of Conduct #19845

linghengqian opened this issue Aug 3, 2022 · 4 comments · Fixed by #21046

Comments

@linghengqian
Copy link
Member

linghengqian commented Aug 3, 2022

Feature Request

For English only, other languages will not accept.

Please pay attention on issues you submitted, because we maybe need more details.
If no response anymore and we cannot make decision by current information, we will close it.

Please answer these questions before submitting your issue. Thanks!

Is your feature request related to a problem?

Yes, refer to #15296 .

Describe the feature you would like.

  • According to Deprecate APIs that use Hamcrest classes. Users should use java-hamcrest junit-team/junit4#1150, Hamcrest related APIs are deprecated in Junit 4.13.x. Meanwhile, according to the discussion at Update to hamcrest 2.2 junit-team/junit4#1741, Junit4 is likely to completely remove the Hamcrest dependency in the next major version, which means like org.junit.Assert.assertThat will be removed.

  • I think the recommendation in the Code of Conduct to replace org.junit.Assert.assertThat with org.hamcrest.MatcherAssert.assertThat in hamcrest 1.3 might be a good future-proof option.

  • I don't feel the need to submit a huge PR to change the Hamcrest-related class package names, it's just too big. Changing the Code of Conduct first is an easy option.

@RaigorJiang
Copy link
Contributor

+1

@linghengqian
Copy link
Member Author

  • A possibly related topic is that earlier, ShardingSphere has upgraded the version of Mockito to 4.5.1 to partially support unit testing in GraalVM's Native Image at the test framework level.

  • But according to https://graalvm.github.io/native-build-tools/latest/maven-plugin.html#long_classpath_and_shading_support , doing this kind of unit testing requires reasonable JUnit Platform integration.

  • Migrating from Junit 4 to Junit 5 is also likely to be the result of this discussion, I'm just listing one possibility and waiting for new comments to start trying at a specific point in the future.

@linghengqian
Copy link
Member Author

  • I just found out that the existing checkstyle blocks org.hamcrest.MatcherAssert.*. So I opened a PR to work on. I'm still not sure what to think about Junit 5, but it should be reasonable for an API away from Junit 4.

@linghengqian
Copy link
Member Author

linghengqian commented Sep 17, 2022

  • Since the PR has been merged, this issue is no longer meaningful, and I will submit a documentation-related PR to close this issue soon. I may try to address the need for unit testing within GraalVM's Native Image via JUnit Platform integration in a new issue on the fature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants