### Question:
AuthorizationServiceImpl implements AuthorizationService { @Override public SCALoginResponseTO login(String login, String pin) { try { return userMgmtRestClient.authorise(login, pin, UserRoleTO.CUSTOMER).getBody(); } catch (FeignException e) { log.error(LOGIN_ERROR_MSG_LOGGER, login, e.status(), e.getMessage()); throw AuthorizationException.builder() .devMessage(String.format(LOGIN_ERROR_MSG, login)) .errorCode(AuthErrorCode.LOGIN_FAILED) .build(); } }  @Override SCALoginResponseTO login(String login, String pin); @Override String resolveAuthConfirmationCodeRedirectUri(String redirectUri, String code);  }### Answer:
@Test void login() { when(userMgmtRestClient.authorise(any(), any(), eq(UserRoleTO.CUSTOMER))).thenReturn(getLoginResponse()); SCALoginResponseTO result = service.login(LOGIN, PIN); assertThat(result).isEqualTo(getLoginResponse().getBody()); }
@Test void login_fail() { when(userMgmtRestClient.authorise(any(), any(), eq(UserRoleTO.CUSTOMER))).thenThrow(getFeignExceptionWithDevMsg()); assertThrows(AuthorizationException.class, () -> { SCALoginResponseTO result = service.login(LOGIN, PIN); assertThat(result).isEqualToComparingFieldByFieldRecursively(getLoginResponse()); }); }