### Question:
UserAuthentication { public String getPassword() { return password; } UserAuthentication(String userid, String password, boolean adminUser); String getUserid(); String getPassword(); boolean isAdminUser(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void testSuccessWithPlaintext() throws PEException { new UserCredentials(getUser(), getPassword()).authenticate(ssConn); }
@Test (expected=PEException.class) public void testUserFailureWithPlaintext() throws PEException { new UserCredentials("x" + getUser(), getPassword()).authenticate(ssConn); }
@Test (expected=PEException.class) public void testPwdFailureWithPlaintext() throws PEException { new UserCredentials(getUser(), "x" + getPassword()).authenticate(ssConn); }
@Test public void testSuccessWithHashed() throws Exception { String hashPass = MSPAuthenticateV10MessageMessage.computeSecurePasswordString(getPassword(), ssConn.getHandshake().getSalt()); new UserCredentials("root", hashPass, false).authenticate(ssConn); }