AnonHxy commented on code in PR #17084:
URL: https://github.com/apache/pulsar/pull/17084#discussion_r947461907
##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ServerCnxTest.java:
##########
@@ -2153,4 +2167,157 @@ public void
testHandleAuthResponseWithoutClientVersion() {
verify(authResponse, times(1)).hasClientVersion();
verify(authResponse, times(0)).getClientVersion();
}
+
+ @Test(expectedExceptions = IllegalArgumentException.class)
+ void shouldFailHandleLookup() throws Exception {
+ resetChannel();
+ Field stateUpdater = ServerCnx.class.getDeclaredField("state");
+ stateUpdater.setAccessible(true);
+ stateUpdater.set(serverCnx, ServerCnx.State.Failed);
Review Comment:
This modification will break `serverCnx` state, which is a common component
in the test class. I think it is better to mock a new `ServerCnx` without
using the true `serverCnx ` instance
--
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]