### Question:
AuthorisationServiceRemote implements AuthorisationServiceEncrypted { @Override public CmsResponse<List<String>> getAuthorisationsByParentId(AuthorisationParentHolder parentHolder) { String parentId = parentHolder.getParentId(); try { ResponseEntity<List<String>> request = consentRestTemplate.exchange( authorisationRemoteUrls.getAuthorisationsByParentId(), HttpMethod.GET, null, new ParameterizedTypeReference<List<String>>() { }, parentHolder.getAuthorisationType(), parentId); return CmsResponse.<List<String>>builder() .payload(request.getBody()) .build(); } catch (CmsRestException cmsRestException) { log.info("Couldn't get authorisations by parent ID {}, HTTP response status: {}", parentId, cmsRestException.getHttpStatus()); } return CmsResponse.<List<String>>builder() .error(TECHNICAL_ERROR) .build(); }  @Override CmsResponse<CreateAuthorisationResponse> createAuthorisation(AuthorisationParentHolder parentHolder, CreateAuthorisationRequest request); @Override CmsResponse<Authorisation> getAuthorisationById(String authorisationId); @Override CmsResponse<Authorisation> updateAuthorisation(String authorisationId, UpdateAuthorisationRequest request); @Override CmsResponse<Boolean> updateAuthorisationStatus(String authorisationId, ScaStatus scaStatus); @Override CmsResponse<List<String>> getAuthorisationsByParentId(AuthorisationParentHolder parentHolder); @Override CmsResponse<ScaStatus> getAuthorisationScaStatus(String authorisationId, AuthorisationParentHolder parentHolder); @Override CmsResponse<Boolean> isAuthenticationMethodDecoupled(String authorisationId, String authenticationMethodId); @Override CmsResponse<Boolean> saveAuthenticationMethods(String authorisationId, List<CmsScaMethod> methods); @Override CmsResponse<Boolean> updateScaApproach(String authorisationId, ScaApproach scaApproach); @Override CmsResponse<AuthorisationScaApproachResponse> getAuthorisationScaApproach(String authorisationId);  }### Answer:
@Test void getAuthorisationsByParentId() { when(authorisationRemoteUrls.getAuthorisationsByParentId()).thenReturn(URL); AuthorisationParentHolder authorisationParentHolder = new AuthorisationParentHolder(AUTHORISATION_TYPE, PARENT_ID); List<String> controllerResponse = Collections.singletonList(AUTHORISATION_ID); when(consentRestTemplate.exchange(eq(URL), eq(HttpMethod.GET), eq(null), any(ParameterizedTypeReference.class), eq(AUTHORISATION_TYPE), eq(PARENT_ID))) .thenReturn(new ResponseEntity<>(controllerResponse, HttpStatus.OK)); CmsResponse<List<String>> actualResponse = authorisationServiceRemote.getAuthorisationsByParentId(authorisationParentHolder); assertTrue(actualResponse.isSuccessful()); assertEquals(controllerResponse, actualResponse.getPayload()); }
@Test void getAuthorisationsByParentId_cmsRestException() { when(authorisationRemoteUrls.getAuthorisationsByParentId()).thenReturn(URL); AuthorisationParentHolder authorisationParentHolder = new AuthorisationParentHolder(AUTHORISATION_TYPE, PARENT_ID); when(consentRestTemplate.exchange(eq(URL), eq(HttpMethod.GET), eq(null), any(ParameterizedTypeReference.class), eq(AUTHORISATION_TYPE), eq(PARENT_ID))) .thenThrow(CmsRestException.class); CmsResponse<List<String>> actualResponse = authorisationServiceRemote.getAuthorisationsByParentId(authorisationParentHolder); assertTrue(actualResponse.hasError()); assertEquals(CmsError.TECHNICAL_ERROR, actualResponse.getError()); }