### Question:
CommonPaymentDataService { @Transactional public boolean updateCancelTppRedirectURIs(PisCommonPaymentData paymentData, @NotNull TppRedirectUri tppRedirectUri) { paymentData.getAuthorisationTemplate().setCancelRedirectUri(tppRedirectUri.getUri()); paymentData.getAuthorisationTemplate().setCancelNokRedirectUri(tppRedirectUri.getNokUri()); PisCommonPaymentData saved = pisCommonPaymentDataRepository.save(paymentData); return saved.getPaymentId() != null; }  Optional<PisCommonPaymentData> getPisCommonPaymentData(String paymentId, @Nullable String instanceId); @Transactional boolean updateStatusInPaymentData(PisCommonPaymentData paymentData, TransactionStatus status); @Transactional boolean updateCancelTppRedirectURIs(PisCommonPaymentData paymentData, @NotNull TppRedirectUri tppRedirectUri); @Transactional boolean updatePaymentCancellationInternalRequestId(PisCommonPaymentData paymentData, @NotNull String internalRequestId);  }### Answer:
@Test void updateCancelTppRedirectURIs() { PisCommonPaymentData paymentData = new PisCommonPaymentData(); paymentData.setAuthorisationTemplate(new AuthorisationTemplateEntity()); TppRedirectUri tppRedirectUri = new TppRedirectUri("ok_url", "nok_url"); when(pisCommonPaymentDataRepository.save(paymentData)).thenReturn(new PisCommonPaymentData()); commonPaymentDataService.updateCancelTppRedirectURIs(paymentData, tppRedirectUri); assertEquals("ok_url", paymentData.getAuthorisationTemplate().getCancelRedirectUri()); assertEquals("nok_url", paymentData.getAuthorisationTemplate().getCancelNokRedirectUri()); }
@Test void updateCancelTppRedirectURIs_Fail() { PisCommonPaymentData paymentData = new PisCommonPaymentData(); paymentData.setAuthorisationTemplate(new AuthorisationTemplateEntity()); TppRedirectUri tppRedirectUri = new TppRedirectUri("ok_url", "nok_url"); when(pisCommonPaymentDataRepository.save(paymentData)).thenReturn(paymentData); assertFalse(commonPaymentDataService.updateCancelTppRedirectURIs(paymentData, tppRedirectUri)); }