### Question:
PisCommonPaymentController implements PisCommonPaymentApi { @Override public ResponseEntity<Void> updateCommonPaymentStatus(String paymentId, String status) { CmsResponse<Boolean> response = pisCommonPaymentServiceEncrypted.updateCommonPaymentStatusById(paymentId, TransactionStatus.getByValue(status)); if (response.isSuccessful() && BooleanUtils.isTrue(response.getPayload())) { return new ResponseEntity<>(HttpStatus.OK); } return new ResponseEntity<>(HttpStatus.BAD_REQUEST); }  @Override ResponseEntity<CreatePisCommonPaymentResponse> createCommonPayment(PisPaymentInfo request); @Override ResponseEntity<PisCommonPaymentDataStatusResponse> getPisCommonPaymentStatusById(String paymentId); @Override ResponseEntity<PisCommonPaymentResponse> getCommonPaymentById(String paymentId); @Override ResponseEntity<Void> updateCommonPaymentStatus(String paymentId, String status); @Override ResponseEntity<CreateAuthorisationResponse> createAuthorisation(String paymentId, CreateAuthorisationRequest request); @Override ResponseEntity<CreateAuthorisationResponse> createAuthorisationCancellation(String paymentId, CreateAuthorisationRequest request); @Override ResponseEntity<Authorisation> updateAuthorisation(String authorisationId, UpdateAuthorisationRequest request); @Override ResponseEntity<Void> updateAuthorisationStatus(String authorisationId, String authorisationStatus); @Override ResponseEntity<Authorisation> getAuthorisation(String authorisationId); @Override ResponseEntity<ScaStatus> getAuthorisationScaStatus(String paymentId, String authorisationId); @Override ResponseEntity<Authorisation> updateCancellationAuthorisation(String authorisationId, UpdateAuthorisationRequest request); @Override ResponseEntity<List<String>> getAuthorisationCancellation(String authorisationId); @Override ResponseEntity<List<String>> getAuthorisationsCancellation(String paymentId); @Override ResponseEntity<ScaStatus> getCancellationAuthorisationScaStatus(String paymentId, String authorisationId); @Override ResponseEntity<List<String>> getAuthorisations(String paymentId); @Override ResponseEntity<Boolean> isAuthenticationMethodDecoupled(String authorisationId, String authenticationMethodId); @Override ResponseEntity<Void> saveAuthenticationMethods(String authorisationId, List<CmsScaMethod> methods); @Override ResponseEntity<Boolean> updateScaApproach(String authorisationId, ScaApproach scaApproach); @Override ResponseEntity<AuthorisationScaApproachResponse> getAuthorisationScaApproach(String authorisationId); @Override ResponseEntity<AuthorisationScaApproachResponse> getCancellationAuthorisationScaApproach(String authorisationId); @Override ResponseEntity<Boolean> updateMultilevelScaRequired(String paymentId, boolean multilevelSca);  }### Answer:
@Test void updateConsentStatus_Success() { ResponseEntity<Void> expected = new ResponseEntity<>(HttpStatus.OK); when(pisCommonPaymentService.updateCommonPaymentStatusById(PAYMENT_ID, TransactionStatus.RCVD)) .thenReturn(CmsResponse.<Boolean>builder().payload(true).build()); ResponseEntity<Void> actual = pisCommonPaymentController.updateCommonPaymentStatus(PAYMENT_ID, STATUS_RECEIVED); assertEquals(expected, actual); }
@Test void updateConsentStatus_Failure() { when(pisCommonPaymentService.updateCommonPaymentStatusById(WRONG_PAYMENT_ID, TransactionStatus.RCVD)) .thenReturn(CmsResponse.<Boolean>builder().payload(false).build()); ResponseEntity<Void> expected = new ResponseEntity<>(HttpStatus.BAD_REQUEST); ResponseEntity<Void> actual = pisCommonPaymentController.updateCommonPaymentStatus(WRONG_PAYMENT_ID, STATUS_RECEIVED); assertEquals(expected, actual); }