### Question:
RedirectConsentServiceImpl implements RedirectConsentService { @Override public void updateScaStatusConsentStatusConsentData(String psuId, ConsentWorkflow workflow) { updateCmsAuthorizationScaStatus(workflow, psuId); updateAspspConsentData(workflow); }  @Override void selectScaMethod(String scaMethodId, final ConsentWorkflow workflow); @Override void updateAccessByConsentType(ConsentWorkflow workflow, List<AccountDetailsTO> listOfAccounts); @Override void updateScaStatusConsentStatusConsentData(String psuId, ConsentWorkflow workflow); @Override void startConsent(final ConsentWorkflow workflow, AisConsentTO aisConsent, List<AccountDetailsTO> listOfAccounts); @Override ConsentWorkflow identifyConsent(String encryptedConsentId, String authorizationId, boolean strict, String consentCookieString, BearerTokenTO bearerToken);  }### Answer:
@Test void updateScaStatusConsentStatusConsentData() throws IOException { when(cmsPsuAisClient.updateAuthorisationStatus(any(), any(), any(), any(), any(), any(), any(), any(), any())).thenReturn(ResponseEntity.ok().build()); when(tokenStorageService.toBase64String(any())).thenReturn(CONSENT_ID); when(aspspConsentDataClient.updateAspspConsentData(any(), any())).thenReturn(ResponseEntity.ok().build()); redirectConsentService.updateScaStatusConsentStatusConsentData(USER_ID, getConsentWorkflow(AisConsentRequestType.DEDICATED_ACCOUNTS, IBAN_DE)); verify(aspspConsentDataClient, times(1)).updateAspspConsentData(ENCRYPTED_CONSENT_ID, new CmsAspspConsentDataBase64(CONSENT_ID, CONSENT_ID)); }
@Test void updateScaStatusConsentStatusConsentData_failure() throws IOException { when(cmsPsuAisClient.updateAuthorisationStatus(any(), any(), any(), any(), any(), any(), any(), any(), any())).thenReturn(ResponseEntity.ok().build()); when(tokenStorageService.toBase64String(any())).thenThrow(IOException.class); assertThrows(AuthorizationException.class, () -> redirectConsentService.updateScaStatusConsentStatusConsentData(USER_ID, getConsentWorkflow(AisConsentRequestType.DEDICATED_ACCOUNTS, IBAN_DE))); }