shardingsphere icon indicating copy to clipboard operation
shardingsphere copied to clipboard

Consider suggesting the package name of assertThat in `Code of Conduct`

Open linghengqian opened this issue 2 years ago • 1 comments

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 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.

linghengqian avatar Aug 03 '22 18:08 linghengqian

+1

RaigorJiang avatar Aug 04 '22 01:08 RaigorJiang

  • 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 avatar Aug 11 '22 18:08 linghengqian

  • 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 avatar Sep 12 '22 13:09 linghengqian

  • 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.

linghengqian avatar Sep 17 '22 17:09 linghengqian