### Question:
CommonPaymentDataService { @Transactional public boolean updateStatusInPaymentData(PisCommonPaymentData paymentData, TransactionStatus status) { paymentData.setTransactionStatus(status); if (status == TransactionStatus.PATC) { paymentData.setMultilevelScaRequired(true); } 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 updateStatusInPaymentData_TransactionStatusACSP() { TransactionStatus transactionStatus = TransactionStatus.ACSP; PisCommonPaymentData paymentData = new PisCommonPaymentData(); assertNull(paymentData.getTransactionStatus()); when(pisCommonPaymentDataRepository.save(paymentData)).thenReturn(new PisCommonPaymentData()); commonPaymentDataService.updateStatusInPaymentData(paymentData, transactionStatus); assertEquals(transactionStatus, paymentData.getTransactionStatus()); }
@Test void updateStatusInPaymentData_TransactionStatusPATC() { TransactionStatus transactionStatus = TransactionStatus.PATC; PisCommonPaymentData paymentData = new PisCommonPaymentData(); assertNull(paymentData.getTransactionStatus()); assertFalse(paymentData.isMultilevelScaRequired()); when(pisCommonPaymentDataRepository.save(paymentData)).thenReturn(new PisCommonPaymentData()); commonPaymentDataService.updateStatusInPaymentData(paymentData, transactionStatus); assertEquals(transactionStatus, paymentData.getTransactionStatus()); assertTrue(paymentData.isMultilevelScaRequired()); }