rocketmq icon indicating copy to clipboard operation
rocketmq copied to clipboard

[ISSUE #4585] PlainPermissionManagerTest add unit test

Open Oliverwqcwrw opened this issue 3 years ago • 3 comments

Make sure set the target branch to develop

What is the purpose of the change

Close #4585

Brief changelog

XX

Verifying this change

XXXX

Follow this checklist to help us incorporate your contribution quickly and easily. Notice, it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR.

  • [x] Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • [x] Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • [x] Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • [x] Run mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.
  • [ ] If this contribution is large, please file an Apache Individual Contributor License Agreement.

Oliverwqcwrw avatar Jul 20 '22 05:07 Oliverwqcwrw

Thanks for your remind, I have solved it

Oliverwqcwrw avatar Jul 22 '22 01:07 Oliverwqcwrw

Coverage Status

Coverage increased (+0.2%) to 49.185% when pulling 981f301730c50b5c32c067a4812e9a3865c3b364 on Oliverwqcwrw:develop-PlainPermissionManager-ut-30 into 96fb142569b3e3a5560ec57c84e351363841cf94 on apache:develop.

coveralls avatar Jul 22 '22 02:07 coveralls

Codecov Report

Merging #4637 (32eaea6) into develop (cf74c3c) will increase coverage by 0.13%. The diff coverage is 0.00%.

@@              Coverage Diff              @@
##             develop    #4637      +/-   ##
=============================================
+ Coverage      43.09%   43.23%   +0.13%     
- Complexity      7676     7733      +57     
=============================================
  Files            994      995       +1     
  Lines          68942    69067     +125     
  Branches        9132     9143      +11     
=============================================
+ Hits           29712    29858     +146     
+ Misses         35497    35473      -24     
- Partials        3733     3736       +3     
Impacted Files Coverage Δ
...ain/java/org/apache/rocketmq/common/AclConfig.java 0.00% <0.00%> (ø)
.../org/apache/rocketmq/common/PlainAccessConfig.java 0.00% <0.00%> (ø)
...org/apache/rocketmq/common/stats/StatsItemSet.java 41.79% <0.00%> (-8.96%) :arrow_down:
...he/rocketmq/controller/impl/DLedgerController.java 66.49% <0.00%> (-3.03%) :arrow_down:
...rocketmq/common/protocol/route/TopicRouteData.java 22.31% <0.00%> (-1.80%) :arrow_down:
.../org/apache/rocketmq/store/timer/TimerMetrics.java 68.50% <0.00%> (-1.75%) :arrow_down:
.../apache/rocketmq/store/ha/DefaultHAConnection.java 65.86% <0.00%> (-1.21%) :arrow_down:
...ent/impl/consumer/DefaultLitePullConsumerImpl.java 68.75% <0.00%> (-1.10%) :arrow_down:
...rocketmq/client/impl/factory/MQClientInstance.java 46.74% <0.00%> (-0.70%) :arrow_down:
...rocketmq/broker/processor/PopMessageProcessor.java 37.63% <0.00%> (-0.54%) :arrow_down:
... and 64 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov-commenter avatar Jul 29 '22 04:07 codecov-commenter

Hello @caigy Thanks for your review, I have solved it

Oliverwqcwrw avatar Aug 12 '22 10:08 Oliverwqcwrw

Please modify this pr as others' suggestion, we will merge this pr, thanks! @Oliverwqcwrw

zongtanghu avatar Aug 13 '22 10:08 zongtanghu

Please modify this pr as others' suggestion, we will merge this pr, thanks! @Oliverwqcwrw

Thanks for your review, I have solved it

Oliverwqcwrw avatar Aug 13 '22 12:08 Oliverwqcwrw

@Oliverwqcwrw Please fix test errors:

Tests run: 25, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 27.275 sec <<< FAILURE! - in org.apache.rocketmq.client.consumer.DefaultLitePullConsumerTest
unnecessary Mockito stubbings(org.apache.rocketmq.client.consumer.DefaultLitePullConsumerTest)  Time elapsed: 0.039 sec  <<< ERROR!
org.mockito.exceptions.misusing.UnnecessaryStubbingException: 
Unnecessary stubbings detected in test class: DefaultLitePullConsumerTest
Clean & maintainable test code requires zero unnecessary code.
Following stubbings are unnecessary (click to navigate to relevant line of code):
  1. -> at org.apache.rocketmq.client.consumer.DefaultLitePullConsumerTest.testPullTaskImpl_ProcessQueueNull(DefaultLitePullConsumerTest.java:356)
Please remove unnecessary stubbings or use 'lenient' strictness. More info: javadoc for UnnecessaryStubbingException class.

caigy avatar Aug 17 '22 04:08 caigy

@Oliverwqcwrw Please fix test errors:

Tests run: 25, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 27.275 sec <<< FAILURE! - in org.apache.rocketmq.client.consumer.DefaultLitePullConsumerTest
unnecessary Mockito stubbings(org.apache.rocketmq.client.consumer.DefaultLitePullConsumerTest)  Time elapsed: 0.039 sec  <<< ERROR!
org.mockito.exceptions.misusing.UnnecessaryStubbingException: 
Unnecessary stubbings detected in test class: DefaultLitePullConsumerTest
Clean & maintainable test code requires zero unnecessary code.
Following stubbings are unnecessary (click to navigate to relevant line of code):
  1. -> at org.apache.rocketmq.client.consumer.DefaultLitePullConsumerTest.testPullTaskImpl_ProcessQueueNull(DefaultLitePullConsumerTest.java:356)
Please remove unnecessary stubbings or use 'lenient' strictness. More info: javadoc for UnnecessaryStubbingException class.

Thanks for your review Which branch is your code? This branch of mine does not have this problem image

Oliverwqcwrw avatar Aug 17 '22 09:08 Oliverwqcwrw

@Oliverwqcwrw Please refer to the result of Travis Ci: https://github.com/apache/rocketmq/pull/4637/checks?check_run_id=7819279185

caigy avatar Aug 17 '22 13:08 caigy

Hello @caigy , I noticed that the code is compiling the develop branch code, so help trigger the compilation of my branch code image thanks :)

Oliverwqcwrw avatar Aug 17 '22 13:08 Oliverwqcwrw

@Oliverwqcwrw Actually your branch is checked out. image

caigy avatar Aug 19 '22 04:08 caigy