### Question:
CnfAdapterService { public ResponseEntity<InstanceMiniResponseList> getInstanceByRBNameOrRBVersionOrProfileName(String rbName, String rbVersion, String profileName) throws JsonParseException, JsonMappingException, IOException { logger.info("CnfAdapterService createInstance called"); ResponseEntity<InstanceMiniResponseList> instanceMiniResponseList = null; try { String uri = "http: String path = "/v1/instance" + "?rb-name=" + rbName + "&rb-version=" + rbVersion + "&profile-name=" + profileName; String endPoint = uri + path; HttpEntity<?> requestEntity = new HttpEntity<>(getHttpHeaders()); instanceMiniResponseList = restTemplate.exchange(endPoint, HttpMethod.GET, requestEntity, InstanceMiniResponseList.class); return instanceMiniResponseList; } catch (HttpClientErrorException e) { logger.error("Error Calling Multicloud, e"); if (HttpStatus.SC_NOT_FOUND == e.getStatusCode().value()) { throw new EntityNotFoundException(e.getResponseBodyAsString()); } throw e; } catch (HttpStatusCodeException e) { logger.error("Error in Multicloud, e"); String responseString = e.getResponseBodyAsString(); InstanceMiniResponseList result = new InstanceMiniResponseList(responseString.trim()); return ResponseEntity.status(e.getStatusCode()).body(result); } }  ResponseEntity<String> healthCheck(); ResponseEntity<InstanceResponse> createInstance(BpmnInstanceRequest bpmnInstanceRequest); ResponseEntity<InstanceResponse> getInstanceByInstanceId(String instanceId); ResponseEntity<InstanceStatusResponse> getInstanceStatusByInstanceId(String instanceId); ResponseEntity<InstanceMiniResponseList> getInstanceByRBNameOrRBVersionOrProfileName(String rbName,
            String rbVersion, String profileName); ResponseEntity<String> deleteInstanceByInstanceId(String instanceId);  }### Answer:
@Test public void getInstanceByRBNameOrRBVersionOrProfileNameTest() throws Exception { ResponseEntity<InstanceMiniResponseList> response = new ResponseEntity<InstanceMiniResponseList>(HttpStatus.OK); String rbName = "xyz"; String rbVersion = "v1"; String profileName = "p1"; Mockito.when(restTemplate.exchange(Matchers.anyString(), Matchers.any(HttpMethod.class), Matchers.<HttpEntity<?>>any(), Matchers.<Class<InstanceMiniResponseList>>any())).thenReturn(response); ResponseEntity<InstanceMiniResponseList> actualResponse = cnfAdapterService.getInstanceByRBNameOrRBVersionOrProfileName(rbName, rbVersion, profileName); Assert.assertNotNull(actualResponse); Assert.assertEquals(HttpStatus.OK, actualResponse.getStatusCode()); }