### Question:
UpdatePaymentAfterSpiServiceRemote implements UpdatePaymentAfterSpiServiceEncrypted { @Override public CmsResponse<Boolean> updatePaymentCancellationTppRedirectUri(@NotNull String encryptedPaymentId, @NotNull TppRedirectUri tppRedirectUri) { try { MultiValueMap<String, String> headers = new LinkedMultiValueMap<>(); headers.add("tpp-redirect-uri", StringUtils.defaultIfBlank(tppRedirectUri.getUri(), "")); headers.add("tpp-nok-redirect-uri", StringUtils.defaultIfBlank(tppRedirectUri.getNokUri(), "")); consentRestTemplate.exchange(pisPaymentRemoteUrls.updatePaymentCancellationRedirectURIs(), HttpMethod.PUT, new HttpEntity<>(headers), Void.class, encryptedPaymentId); return CmsResponse.<Boolean>builder() .payload(true) .build(); } catch (CmsRestException e) { log.error(PAYMENT_NOT_FOUND_MESSAGE, encryptedPaymentId); } return CmsResponse.<Boolean>builder() .payload(false) .build(); }  @Override CmsResponse<Boolean> updatePaymentStatus(@NotNull String encryptedPaymentId, @NotNull TransactionStatus status); @Override CmsResponse<Boolean> updatePaymentCancellationTppRedirectUri(@NotNull String encryptedPaymentId, @NotNull TppRedirectUri tppRedirectUri); @Override CmsResponse<Boolean> updatePaymentCancellationInternalRequestId(@NotNull String encryptedPaymentId, @NotNull String internalRequestId); static final String PAYMENT_NOT_FOUND_MESSAGE; }### Answer:
@Test void updatePaymentCancellationTppRedirectUri_success() { ArgumentCaptor<HttpEntity> httpEntityCaptor = ArgumentCaptor.forClass(HttpEntity.class); TppRedirectUri tppRedirectUri = new TppRedirectUri("ok_url", "nok_url"); when(pisPaymentRemoteUrls.updatePaymentCancellationRedirectURIs()).thenReturn(URL); when(consentRestTemplate.exchange(eq(URL), eq(HttpMethod.PUT), httpEntityCaptor.capture(), eq(Void.class), eq(ENCRYPTED_PAYMENT_ID))).thenReturn(new ResponseEntity<>(HttpStatus.OK)); assertTrue(updatePaymentAfterSpiServiceRemote.updatePaymentCancellationTppRedirectUri(ENCRYPTED_PAYMENT_ID, tppRedirectUri).getPayload()); assertEquals(2, httpEntityCaptor.getValue().getHeaders().size()); assertEquals("ok_url", httpEntityCaptor.getValue().getHeaders().get("tpp-redirect-uri").get(0)); assertEquals("nok_url", httpEntityCaptor.getValue().getHeaders().get("tpp-nok-redirect-uri").get(0)); }