### Question:
XISControllerService { public ResponseEntity<SCALoginResponseTO> performLoginForConsent(String login, String pin, String operationId, String authId, OpTypeTO operationType) { Cookie cookie = WebUtils.getCookie(request, ACCESS_TOKEN_COOKIE); String token = cookie != null ? cookie.getValue() : null; return performLoginForConsent(login, pin, token, operationId, authId, operationType); }  ResponseEntity<AuthorizeResponse> auth(String redirectId, ConsentType consentType, String encryptedConsentId, HttpServletResponse response); ResponseEntity<SCALoginResponseTO> performLoginForConsent(String login, String pin, String operationId, String authId, OpTypeTO operationType); ResponseEntity<PaymentAuthorizeResponse> resolvePaymentWorkflow(PaymentWorkflow workflow);  }### Answer:
@Test void performLoginForConsent() throws NoSuchFieldException { FieldSetter.setField(service, service.getClass().getDeclaredField("request"), new MockHttpServletRequest()); when(userMgmtRestClient.authoriseForConsent(anyString(), anyString(), anyString(), anyString(), any())).thenReturn(getLoginResponse()); ResponseEntity<SCALoginResponseTO> result = service.performLoginForConsent(LOGIN, PIN, CONSENT_ID, AUTH_ID, OpTypeTO.CONSENT); assertEquals(getLoginResponse(), result); }
@Test void performLoginForConsent_fail() throws NoSuchFieldException { FieldSetter.setField(service, service.getClass().getDeclaredField("request"), new MockHttpServletRequest()); assertThrows(AuthorizationException.class, () -> service.performLoginForConsent(null, null, CONSENT_ID, AUTH_ID, OpTypeTO.CONSENT)); }