((RSAPublicKey)kp.getPublic()).getModulus(),
((RSAPublicKey)kp.getPublic()).getPublicExponent());
UserAuthPublicKeyOk uapkok = new UserAuthPublicKeyOk();
uapkok.setAlgorithm("ssh-rsa");
uapkok.setPubkey(pkey.encode());
UserAuthSuccessMessage uasm = new UserAuthSuccessMessage();
when(transport.readMessage("publickey")).thenReturn(uapkok).thenReturn(uasm);
when(transport.getSessionId()).thenReturn(new byte[20]);
// When
AuthenticationResult res = authMgr.authenticate("user", pkey, signature);
// Then