### Question:
Xs2aPisCommonPaymentService { public CreatePisCommonPaymentResponse createCommonPayment(PisPaymentInfo request) { CmsResponse<CreatePisCommonPaymentResponse> response = pisCommonPaymentServiceEncrypted.createCommonPayment(request); if (response.hasError()) { log.info("Payment ID: [{}]. Pis common payment cannot be created, because can't save to cms DB", request.getPaymentId()); return null; } return response.getPayload(); }  CreatePisCommonPaymentResponse createCommonPayment(PisPaymentInfo request); Optional<PisCommonPaymentResponse> getPisCommonPaymentById(String paymentId); boolean updateMultilevelSca(String paymentId, boolean multilevelScaRequired);  }### Answer:
@Test void createCommonPayment_by_request_success() { when(pisCommonPaymentServiceEncrypted.createCommonPayment(PIS_PAYMENT_INFO)) .thenReturn(CmsResponse.<CreatePisCommonPaymentResponse>builder().payload(CREATE_PIS_COMMON_PAYMENT_RESPONSE).build()); CreatePisCommonPaymentResponse actualResponse = xs2aPisCommonPaymentService.createCommonPayment(PIS_PAYMENT_INFO); assertThat(actualResponse).isEqualTo(CREATE_PIS_COMMON_PAYMENT_RESPONSE); }
@Test void createCommonPayment_by_request_failed() { when(pisCommonPaymentServiceEncrypted.createCommonPayment(PIS_PAYMENT_INFO)) .thenReturn(CmsResponse.<CreatePisCommonPaymentResponse>builder().error(CmsError.TECHNICAL_ERROR).build()); CreatePisCommonPaymentResponse actualResponse = xs2aPisCommonPaymentService.createCommonPayment(PIS_PAYMENT_INFO); assertThat(actualResponse).isNull(); }