### Question:
CmsPsuConfirmationOfFundsController implements CmsPsuConfirmationOfFundsApi { @Override public ResponseEntity<Void> updateConsentStatus(String consentId, String status, String instanceId) { ConsentStatus consentStatus; try { consentStatus = ConsentStatus.valueOf(status); } catch (IllegalArgumentException exception) { log.info("Consent ID [{}], Instance ID: [{}]. Bad request: SCA status [{}] incorrect.", consentId, instanceId, status); return ResponseEntity.badRequest().build(); } return cmsPsuConfirmationOfFundsService.updateConsentStatus(consentId, consentStatus, instanceId) ? ResponseEntity.ok().build() : ResponseEntity.badRequest().build(); }  @Override ResponseEntity<Object> updateAuthorisationStatus(String consentId, String status, String authorisationId, String psuId, String psuIdType, String psuCorporateId, String psuCorporateIdType, String instanceId, AuthenticationDataHolder authenticationDataHolder); @Override ResponseEntity<CmsConfirmationOfFundsResponse> getConsentByRedirectId(String redirectId, String instanceId); @Override ResponseEntity<Object> updatePsuDataInConsent(String consentId, String authorisationId, String instanceId, PsuIdData psuIdData); @Override ResponseEntity getAuthorisationByAuthorisationId(String authorisationId, String instanceId); @Override ResponseEntity<Void> updateConsentStatus(String consentId, String status, String instanceId); @Override ResponseEntity<CmsConfirmationOfFundsConsent> getConsentByConsentId(String consentId, String psuId, String psuIdType,
                                                                               String psuCorporateId, String psuCorporateIdType,
                                                                               String instanceId);  }### Answer:
@Test void updateConsentStatus_withInvalidStatus_shouldReturnBadRequest() throws Exception { String invalidStatus = "invalid status"; mockMvc.perform(put("/psu-api/v2/piis/consent/{consent-id}/status/{status}", CONSENT_ID, invalidStatus) .headers(INSTANCE_ID_HEADERS) .headers(PSU_HEADERS) .contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isBadRequest()); verify(cmsPsuConfirmationOfFundsService, never()).updateConsentStatus(anyString(), any(ConsentStatus.class), anyString()); }
@Test void updateConsentStatus_consentNotFound_shouldReturnOk() throws Exception { ConsentStatus consentStatus = ConsentStatus.VALID; when(cmsPsuConfirmationOfFundsService.updateConsentStatus(CONSENT_ID, consentStatus, INSTANCE_ID)) .thenReturn(false); mockMvc.perform(put("/psu-api/v2/piis/consent/{consent-id}/status/{status}", CONSENT_ID, consentStatus) .headers(INSTANCE_ID_HEADERS) .headers(PSU_HEADERS) .contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isBadRequest()); verify(cmsPsuConfirmationOfFundsService).updateConsentStatus(CONSENT_ID, consentStatus, INSTANCE_ID); }