lhotari commented on PR #19409:
URL: https://github.com/apache/pulsar/pull/19409#issuecomment-1416173794

   @michaeljmarshall The test class ServerCnxAuthorizationTest is doing 
extensive mocking of Netty classes, which is a bad solution. The ServerCnxTest 
has a better solution based on a real class, 
[EmbeddedChannel](https://netty.io/4.1/api/io/netty/channel/embedded/EmbeddedChannel.html)
 . Article: https://www.baeldung.com/testing-netty-embedded-channel
   
   
https://github.com/apache/pulsar/blob/165ee968664670f238bf2e06b8be266d09649b73/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ServerCnxTest.java#L1771-L1786
   
   Instead of adding more mocking to ServerCnxAuthorizationTest, I think it's 
better to refactor it to use EmbeddedChannel. 


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