### Question:
AuthorisationController implements AuthorisationApi { @Override public ResponseEntity<Void> updateAuthorisation(String authorisationId, UpdateAuthorisationRequest authorisationRequest) { CmsResponse<Authorisation> response = authorisationServiceEncrypted.updateAuthorisation(authorisationId, authorisationRequest); if (response.isSuccessful() && response.getPayload() != null && response.getPayload().getParentId() != null) { return new ResponseEntity<>(HttpStatus.OK); } return new ResponseEntity<>(HttpStatus.NOT_FOUND); }  @Override ResponseEntity<CreateAuthorisationResponse> createConsentAuthorisation(AuthorisationType authorisationType, String parentId, CreateAuthorisationRequest authorisationRequest); @Override ResponseEntity<Authorisation> getAuthorisation(String authorisationId); @Override ResponseEntity<Void> updateAuthorisation(String authorisationId, UpdateAuthorisationRequest authorisationRequest); @Override ResponseEntity<Void> updateAuthorisationStatus(String authorisationId, String scaStatus); @Override ResponseEntity<ScaStatus> getAuthorisationScaStatus(AuthorisationType authorisationType, String parentId, String authorisationId); @Override ResponseEntity<List<String>> getAuthorisationsByParentId(AuthorisationType authorisationType, String parentId); @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);  }### Answer:
@Test void updateAuthorisation() throws Exception { UpdateAuthorisationRequest request = jsonReader.getObjectFromFile("json/controller/update-authorisation-request.json", UpdateAuthorisationRequest.class); Authorisation authorisation = new Authorisation(); authorisation.setParentId(PARENT_ID); when(authorisationServiceEncrypted.updateAuthorisation(AUTHORISATION_ID, request)) .thenReturn(CmsResponse.<Authorisation>builder() .payload(authorisation).build()); mockMvc.perform(MockMvcRequestBuilders.put(UriComponentsBuilder.fromPath("/api/v1/authorisations/{authorisation-id}") .buildAndExpand(AUTHORISATION_ID) .toUriString()) .contentType(MediaType.APPLICATION_JSON_VALUE) .content(jsonReader.getStringFromFile("json/controller/update-authorisation-request.json"))) .andExpect(status().is(HttpStatus.OK.value())); }
@Test void updateAuthorisation_notParentId_notFoundHttpStatus() throws Exception { UpdateAuthorisationRequest request = jsonReader.getObjectFromFile("json/controller/update-authorisation-request.json", UpdateAuthorisationRequest.class); Authorisation authorisation = new Authorisation(); when(authorisationServiceEncrypted.updateAuthorisation(AUTHORISATION_ID, request)) .thenReturn(CmsResponse.<Authorisation>builder() .payload(authorisation).build()); mockMvc.perform(MockMvcRequestBuilders.put(UriComponentsBuilder.fromPath("/api/v1/authorisations/{authorisation-id}") .buildAndExpand(AUTHORISATION_ID) .toUriString()) .contentType(MediaType.APPLICATION_JSON_VALUE) .content(jsonReader.getStringFromFile("json/controller/update-authorisation-request.json"))) .andExpect(status().is(HttpStatus.NOT_FOUND.value())); }