shardingsphere
shardingsphere copied to clipboard
Consider suggesting the package name of assertThat in `Code of Conduct`
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 https://github.com/apache/shardingsphere/pull/15296 .
Describe the feature you would like.
-
According to https://github.com/junit-team/junit4/pull/1150, Hamcrest related APIs are deprecated in Junit 4.13.x. Meanwhile, according to the discussion at https://github.com/junit-team/junit4/issues/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
withorg.hamcrest.MatcherAssert.assertThat
inhamcrest 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.
+1
-
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.
- 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.
- 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.