Credential credential = Mockito.mock(Credential.class);
LoginResult loginResult = Mockito.mock(LoginResult.class);
ModelAndView result = Mockito.mock(ModelAndView.class);
Mockito.when(credentialResolver.resolveCredential(request)).thenReturn(credential);
Ki4soService ki4soService = Mockito.mock(Ki4soService.class);
action.setKi4soService(ki4soService);
LoginResultToView loginResultToView = Mockito.mock(LoginResultToView.class);
action.setLoginResultToView(loginResultToView);
Mockito.when(ki4soService.login(Mockito.any(Credential.class))).thenReturn(loginResult);
Mockito.when(loginResultToView.loginResultToView(Mockito.any(ModelAndView.class), Mockito.any(LoginResult.class), Mockito.any(HttpServletRequest.class), Mockito.any(HttpServletResponse.class))).thenReturn(result);
mv = action.login(request, response);
Assert.assertTrue(mv == result);
}