@Test public void test_should_get_positionhierarchies_by_id() { server.expect(once(), requestTo( "http: .andExpect(method(HttpMethod.POST)) .andRespond(withSuccess(new Resources().getFileContents("positionHierarchyResponse.json"), MediaType.APPLICATION_JSON_UTF8)); final PositionHierarchyResponse positionResponse = positionHierarchyRepository .getByPositionByComplaintTypeAndFromPosition(1l, "complaintTypeCode", "default"); server.verify(); assertEquals(1, positionResponse.getEscalationHierarchies().size()); }
public PositionHierarchyResponse getByPositionByComplaintTypeAndFromPosition(final Long fromPosition, final String serviceCode, final String tenantId) { RequestInfoWrapper wrapper = RequestInfoWrapper.builder().RequestInfo(null).build(); return restTemplate.postForObject(positionHierarchyUrl, wrapper, PositionHierarchyResponse.class, fromPosition, serviceCode, tenantId); }
PositionHierarchyRepository { public PositionHierarchyResponse getByPositionByComplaintTypeAndFromPosition(final Long fromPosition, final String serviceCode, final String tenantId) { RequestInfoWrapper wrapper = RequestInfoWrapper.builder().RequestInfo(null).build(); return restTemplate.postForObject(positionHierarchyUrl, wrapper, PositionHierarchyResponse.class, fromPosition, serviceCode, tenantId); } }
PositionHierarchyRepository { public PositionHierarchyResponse getByPositionByComplaintTypeAndFromPosition(final Long fromPosition, final String serviceCode, final String tenantId) { RequestInfoWrapper wrapper = RequestInfoWrapper.builder().RequestInfo(null).build(); return restTemplate.postForObject(positionHierarchyUrl, wrapper, PositionHierarchyResponse.class, fromPosition, serviceCode, tenantId); } PositionHierarchyRepository(final RestTemplate restTemplate,
                                       @Value("${egov.services.pgrmaster.host}") final String hrMastersServiceHostname,
                                       @Value("${egov.services.pgrmaster.positionhierarchy}") final String url); }
PositionHierarchyRepository { public PositionHierarchyResponse getByPositionByComplaintTypeAndFromPosition(final Long fromPosition, final String serviceCode, final String tenantId) { RequestInfoWrapper wrapper = RequestInfoWrapper.builder().RequestInfo(null).build(); return restTemplate.postForObject(positionHierarchyUrl, wrapper, PositionHierarchyResponse.class, fromPosition, serviceCode, tenantId); } PositionHierarchyRepository(final RestTemplate restTemplate,
                                       @Value("${egov.services.pgrmaster.host}") final String hrMastersServiceHostname,
                                       @Value("${egov.services.pgrmaster.positionhierarchy}") final String url); PositionHierarchyResponse getByPositionByComplaintTypeAndFromPosition(final Long fromPosition, final String serviceCode, final String tenantId); }
PositionHierarchyRepository { public PositionHierarchyResponse getByPositionByComplaintTypeAndFromPosition(final Long fromPosition, final String serviceCode, final String tenantId) { RequestInfoWrapper wrapper = RequestInfoWrapper.builder().RequestInfo(null).build(); return restTemplate.postForObject(positionHierarchyUrl, wrapper, PositionHierarchyResponse.class, fromPosition, serviceCode, tenantId); } PositionHierarchyRepository(final RestTemplate restTemplate,
                                       @Value("${egov.services.pgrmaster.host}") final String hrMastersServiceHostname,
                                       @Value("${egov.services.pgrmaster.positionhierarchy}") final String url); PositionHierarchyResponse getByPositionByComplaintTypeAndFromPosition(final Long fromPosition, final String serviceCode, final String tenantId);  }