when(user.getLoginName()).thenReturn("john");
}
@Test
public void testLogin() throws Exception {
AuthenticationResult result = AuthenticationResult.SUCCESS;
when(identity.login()).thenReturn(result);
when(credentialMatcher.isValid()).thenReturn(true);
boolean status = authenticationManager.login(user, "123");
assertTrue("Login result should return true", status);
}