@Test public void testGetRecruitmentType() { ResponseInfo responseInfo = new ResponseInfo("emp", "1.0", "2017-01-18T07:18:23.130Z", "uief87324", "20170310130900", "200"); RecruitmentType recruitmentType = new RecruitmentType().builder().id(10L).name("rec").description("emp") .tenantId("1").build(); List<RecruitmentType> recruitmentTypes = new ArrayList<>(); recruitmentTypes.add(recruitmentType); RecruitmentTypeResponse recruitmentTypeResponse = new RecruitmentTypeResponse().builder() .responseInfo(responseInfo).recruitmentType(recruitmentTypes).build(); when(propertiesManager.getHrMastersServiceHost()).thenReturn("http: when(propertiesManager.getHrMastersServiceBasepath()).thenReturn("/hr-masters"); when(propertiesManager.getHrMastersServiceRecruitmentTypeSearchPath()).thenReturn("/recruitmenttypes/_search"); RequestInfoWrapper requestInfoWrapper = new RequestInfoWrapper(); URI uri = null; try { uri = new URI( "http: } catch (URISyntaxException e) { e.printStackTrace(); } when(restTemplate.postForObject(uri, getRequestInfoAsHttpEntity(requestInfoWrapper), RecruitmentTypeResponse.class)).thenReturn(recruitmentTypeResponse); RecruitmentType insertedsRecruitmentType = hrMasterService.getRecruitmentType(100L, "1", new RequestInfoWrapper()); assertEquals(insertedsRecruitmentType, recruitmentType); }
public RecruitmentType getRecruitmentType(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper) { URI url = null; RecruitmentTypeResponse recruitmentTypeResponse = null; try { url = new URI(propertiesManager.getHrMastersServiceHost() + propertiesManager.getHrMastersServiceBasepath() + propertiesManager.getHrMastersServiceRecruitmentTypeSearchPath() + "?id=" + id + "&tenantId=" + tenantId); LOGGER.info(url.toString()); recruitmentTypeResponse = restTemplate.postForObject(url, getRequestInfoAsHttpEntity(requestInfoWrapper), RecruitmentTypeResponse.class); } catch (Exception e) { e.printStackTrace(); LOGGER.error("Following exception occurred while generating URI : " + e.getMessage()); return null; } return recruitmentTypeResponse.getRecruitmentType().get(0); }
HRMasterService { public RecruitmentType getRecruitmentType(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper) { URI url = null; RecruitmentTypeResponse recruitmentTypeResponse = null; try { url = new URI(propertiesManager.getHrMastersServiceHost() + propertiesManager.getHrMastersServiceBasepath() + propertiesManager.getHrMastersServiceRecruitmentTypeSearchPath() + "?id=" + id + "&tenantId=" + tenantId); LOGGER.info(url.toString()); recruitmentTypeResponse = restTemplate.postForObject(url, getRequestInfoAsHttpEntity(requestInfoWrapper), RecruitmentTypeResponse.class); } catch (Exception e) { e.printStackTrace(); LOGGER.error("Following exception occurred while generating URI : " + e.getMessage()); return null; } return recruitmentTypeResponse.getRecruitmentType().get(0); } }
HRMasterService { public RecruitmentType getRecruitmentType(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper) { URI url = null; RecruitmentTypeResponse recruitmentTypeResponse = null; try { url = new URI(propertiesManager.getHrMastersServiceHost() + propertiesManager.getHrMastersServiceBasepath() + propertiesManager.getHrMastersServiceRecruitmentTypeSearchPath() + "?id=" + id + "&tenantId=" + tenantId); LOGGER.info(url.toString()); recruitmentTypeResponse = restTemplate.postForObject(url, getRequestInfoAsHttpEntity(requestInfoWrapper), RecruitmentTypeResponse.class); } catch (Exception e) { e.printStackTrace(); LOGGER.error("Following exception occurred while generating URI : " + e.getMessage()); return null; } return recruitmentTypeResponse.getRecruitmentType().get(0); }  }
HRMasterService { public RecruitmentType getRecruitmentType(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper) { URI url = null; RecruitmentTypeResponse recruitmentTypeResponse = null; try { url = new URI(propertiesManager.getHrMastersServiceHost() + propertiesManager.getHrMastersServiceBasepath() + propertiesManager.getHrMastersServiceRecruitmentTypeSearchPath() + "?id=" + id + "&tenantId=" + tenantId); LOGGER.info(url.toString()); recruitmentTypeResponse = restTemplate.postForObject(url, getRequestInfoAsHttpEntity(requestInfoWrapper), RecruitmentTypeResponse.class); } catch (Exception e) { e.printStackTrace(); LOGGER.error("Following exception occurred while generating URI : " + e.getMessage()); return null; } return recruitmentTypeResponse.getRecruitmentType().get(0); }  EmployeeType getEmployeeType(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); RecruitmentMode getRecruitmentMode(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); RecruitmentQuota getRecruitmentQuota(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); RecruitmentType getRecruitmentType(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); Grade getGrade(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); Group getGroup(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); Position getPosition(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); Designation getDesignation(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); HRStatus getEmployeeStatus(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); }
HRMasterService { public RecruitmentType getRecruitmentType(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper) { URI url = null; RecruitmentTypeResponse recruitmentTypeResponse = null; try { url = new URI(propertiesManager.getHrMastersServiceHost() + propertiesManager.getHrMastersServiceBasepath() + propertiesManager.getHrMastersServiceRecruitmentTypeSearchPath() + "?id=" + id + "&tenantId=" + tenantId); LOGGER.info(url.toString()); recruitmentTypeResponse = restTemplate.postForObject(url, getRequestInfoAsHttpEntity(requestInfoWrapper), RecruitmentTypeResponse.class); } catch (Exception e) { e.printStackTrace(); LOGGER.error("Following exception occurred while generating URI : " + e.getMessage()); return null; } return recruitmentTypeResponse.getRecruitmentType().get(0); }  EmployeeType getEmployeeType(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); RecruitmentMode getRecruitmentMode(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); RecruitmentQuota getRecruitmentQuota(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); RecruitmentType getRecruitmentType(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); Grade getGrade(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); Group getGroup(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); Position getPosition(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); Designation getDesignation(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); HRStatus getEmployeeStatus(Long id, String tenantId, RequestInfoWrapper requestInfoWrapper); static final Logger LOGGER; }