codelipenghui commented on code in PR #4924:
URL: https://github.com/apache/bookkeeper/pull/4924#discussion_r4526473266


##########
bookkeeper-server/src/test/java/org/apache/bookkeeper/client/PendingAddOpTest.java:
##########
@@ -24,23 +24,40 @@
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
 import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.anyLong;
+import static org.mockito.ArgumentMatchers.anyList;

Review Comment:
   **Fix static import order so checkstyle passes**
   
   Running the project's checkstyle gate, as the required PR Validation CI job 
does with 'mvn ... checkstyle:check ...'. 'checkstyle:check' fails with an 
error-severity violation, so the required PR Validation job fails and the PR 
cannot merge. There is no runtime effect.
   
   The [checkstyle 
config](<apache/bookkeeper/pr-4924/buildtools/src/main/resources/bookkeeper/checkstyle.xml#L106-L115>)
 enables ImportOrder with sortStaticImportsAlphabetically=true at error 
severity. The [plugin 
configuration](<apache/bookkeeper/pr-4924/pom.xml#L972-L980>) sets 
failOnViolation=true and includeTestSourceDirectory=true. The [CI 
workflow](<apache/bookkeeper/pr-4924/.github/workflows/bk-ci.yml#L89-L93>) runs 
checkstyle:check. At 
[PendingAddOpTest:30–31](<apache/bookkeeper/pr-4924/bookkeeper-server/src/test/java/org/apache/bookkeeper/client/PendingAddOpTest.java#L30-L31>),
 'anyLong' precedes 'anyList', but "anyList" sorts first ('i' < 'o'). The 
managed '-pl bookkeeper-server checkstyle:check' run reported exactly one 
violation: "PendingAddOpTest.java:[31,1] (imports) ImportOrder: Import 
org.mockito.ArgumentMatchers.anyList appears after other imports that it should 
precede" and ended with BUILD FAILURE.
   
   Swap the two imports so 'import static 
org.mockito.ArgumentMatchers.anyList;' precedes 'import static 
org.mockito.ArgumentMatchers.anyLong;'. Then re-run 'mvn -pl bookkeeper-server 
checkstyle:check'.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to