when(user.getName()).thenReturn("bob");
when(user.hasCredential(eq("password"), eq("secret"))).thenReturn(Boolean.TRUE);
when(m_userAdmin.getUser(eq("username"), eq("bob"))).thenReturn(user);
User result = new PasswordAuthenticationProcessor().authenticate(m_userAdmin, "bob", "secret");
assert result != null : "Expected a valid user to be returned!";
assert "bob".equals(user.getName()) : "Expected bob to be returned!";
}