InvalidCredentialException exception = Mockito.mock(InvalidCredentialException.class);
String code = "message code";
String msgKey ="message key";
Mockito.when(exception.getCode()).thenReturn(code);
Mockito.when(exception.getMsgKey()).thenReturn(msgKey);
Mockito.when(authenticationManager.authenticate(credential)).thenThrow(exception);
LoginResult loginResult = ki4soService.login(credential);
LoginResult expected = new LoginResult();
expected.setSuccess(false);
expected.setCode(code);
expected.setMsgKey(msgKey);