Github user abhishek-chouhan commented on the issue:
https://github.com/apache/zookeeper/pull/541
@anmolnar The second one happens when
zooKeeperSaslClient.initialize(ClientCnxn.this) throws an sasl exception, which
from the code looks like can happen in case of incomplete initialization. In
zookeeperSaslClient's constructor we call createSaslClient which in case of
anything apart from LoginException will swallow the exception and would
initialize the saslClient object as null(which would cause initialize to throw
sasl exception in the null check). It however looks hard to simulate an
exception in the initialization part, since there are static methods involved
and stubbing zookeepersaslclient itself doesn't look to be an option.
---