@Test public void testGetLanguage() { ResponseInfo responseInfo = new ResponseInfo("emp", "1.0", "2017-01-18T07:18:23.130Z", "uief87324", "20170310130900", "200"); Language language = new Language().builder().id(100L).name("employee1").tenantId("1").build(); List<Language> languages = new ArrayList<>(); languages.add(language); LanguageResponse languageResponse = LanguageResponse.builder().responseInfo(responseInfo) .language(languages).build(); when(propertiesManager.getEgovCommonMastersServiceHost()).thenReturn("http: when(propertiesManager.getEgovCommonMastersServiceBasepath()).thenReturn("/egov-common-masters"); when(propertiesManager.getEgovCommonMastersServiceLanguageSearchPath()).thenReturn("/languages/_search"); RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); URI uri = null; try { uri = new URI( "http: } catch (URISyntaxException e) { e.printStackTrace(); } when(restTemplate.postForObject(uri, getRequestInfoAsHttpEntity(requestInfoWrapper), LanguageResponse.class)) .thenReturn(languageResponse); }
private HttpEntity<RequestInfoWrapper> getRequestInfoAsHttpEntity(RequestInfoWrapper requestInfoWrapper) { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); HttpEntity<RequestInfoWrapper> httpEntityRequest = new HttpEntity<RequestInfoWrapper>(requestInfoWrapper, headers); return httpEntityRequest; }
CommonMasterService { private HttpEntity<RequestInfoWrapper> getRequestInfoAsHttpEntity(RequestInfoWrapper requestInfoWrapper) { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); HttpEntity<RequestInfoWrapper> httpEntityRequest = new HttpEntity<RequestInfoWrapper>(requestInfoWrapper, headers); return httpEntityRequest; } }
CommonMasterService { private HttpEntity<RequestInfoWrapper> getRequestInfoAsHttpEntity(RequestInfoWrapper requestInfoWrapper) { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); HttpEntity<RequestInfoWrapper> httpEntityRequest = new HttpEntity<RequestInfoWrapper>(requestInfoWrapper, headers); return httpEntityRequest; }  }
CommonMasterService { private HttpEntity<RequestInfoWrapper> getRequestInfoAsHttpEntity(RequestInfoWrapper requestInfoWrapper) { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); HttpEntity<RequestInfoWrapper> httpEntityRequest = new HttpEntity<RequestInfoWrapper>(requestInfoWrapper, headers); return httpEntityRequest; }  Religion getReligion(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); List<Language> getLanguages(List<Long> ids, String tenantId, RequestInfoWrapper requestInfoWrapper); Community getCommunity(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); Category getCategory(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); Department getDepartment(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); }
CommonMasterService { private HttpEntity<RequestInfoWrapper> getRequestInfoAsHttpEntity(RequestInfoWrapper requestInfoWrapper) { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); HttpEntity<RequestInfoWrapper> httpEntityRequest = new HttpEntity<RequestInfoWrapper>(requestInfoWrapper, headers); return httpEntityRequest; }  Religion getReligion(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); List<Language> getLanguages(List<Long> ids, String tenantId, RequestInfoWrapper requestInfoWrapper); Community getCommunity(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); Category getCategory(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); Department getDepartment(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); static final Logger LOGGER; }