-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
[issue #12043] module client refact unit test to junit5 #12044
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
测试用例方法命名需要以test开头。
|
||
private RpcClient rpcClient; | ||
|
||
private Connection connection; | ||
|
||
@Test | ||
public void testReceive() throws Exception { | ||
void receive() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
测试用例需要以test开头
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefix
is only need for junit3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的, 我的意思是nacos的测试用例希望以test开头,来更准确的表达测试方法的语意,你可以认为是一个规范。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
另外 问一下改成junit5之后, 使用方法必须改成现在这样吗? |
When i use some plugins to massive refactor, it remove prefix the reason can ref [this]( https://thejavaguy.org/posts/011-dont-prefix-junit-tests-with-the-word-test/ The convention prefix with When we use IDEA to generate test class,when we chose junit3, the prefix will be added, when chose junit4/junit5, the prefix will be not added. |
|
||
private RpcClient rpcClient; | ||
|
||
private Connection connection; | ||
|
||
@Test | ||
public void testReceive() throws Exception { | ||
void receive() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的, 我的意思是nacos的测试用例希望以test开头,来更准确的表达测试方法的语意,你可以认为是一个规范。
@KomachiSion ok, i try to keep the method name not change this time. |
27e10b1
to
2218811
Compare
client/src/test/java/com/alibaba/nacos/client/ability/AbilityTest.java
Outdated
Show resolved
Hide resolved
4fcc361
to
e2939be
Compare
e2939be
to
cf6a011
Compare
Please do not create a Pull Request without creating an issue first.
What is the purpose of the change
#12043
Brief changelog
XX
Verifying this change
XXXX
Follow this checklist to help us incorporate your contribution quickly and easily:
[ISSUE #123] Fix UnknownException when host config not exist
. Each commit in the pull request should have a meaningful subject line and body.mvn -B clean package apache-rat:check findbugs:findbugs -Dmaven.test.skip=true
to make sure basic checks pass. Runmvn clean install -DskipITs
to make sure unit-test pass. Runmvn clean test-compile failsafe:integration-test
to make sure integration-test pass.