@Test public void test_should_fetch_boundary_for_given_id() throws Exception { server.expect(once(), requestTo("http: .andExpect(method(HttpMethod.GET)) .andRespond(withSuccess(new Resources().getFileContents("successBoundaryResponse.json"), MediaType.APPLICATION_JSON_UTF8)); final Boundary boundary = boundaryRepository.fetchBoundaryById(1L,"ap.public"); server.verify(); assertEquals(Long.valueOf(1), boundary.getId()); assertEquals("Kurnool", boundary.getName()); }
public Boundary fetchBoundaryById(Long id, String tenantId) { String url = this.boundaryServiceHost + "egov-location/boundarys?boundary.id={id}&boundary.tenantId={tenantId}"; return getBoundaryServiceResponse(url, id, tenantId).getBoundaries().get(0); }
BoundaryRepository { public Boundary fetchBoundaryById(Long id, String tenantId) { String url = this.boundaryServiceHost + "egov-location/boundarys?boundary.id={id}&boundary.tenantId={tenantId}"; return getBoundaryServiceResponse(url, id, tenantId).getBoundaries().get(0); } }
BoundaryRepository { public Boundary fetchBoundaryById(Long id, String tenantId) { String url = this.boundaryServiceHost + "egov-location/boundarys?boundary.id={id}&boundary.tenantId={tenantId}"; return getBoundaryServiceResponse(url, id, tenantId).getBoundaries().get(0); } BoundaryRepository(RestTemplate restTemplate,
                              @Value("${egov.services.boundary.host}") String boundaryServiceHost); }
BoundaryRepository { public Boundary fetchBoundaryById(Long id, String tenantId) { String url = this.boundaryServiceHost + "egov-location/boundarys?boundary.id={id}&boundary.tenantId={tenantId}"; return getBoundaryServiceResponse(url, id, tenantId).getBoundaries().get(0); } BoundaryRepository(RestTemplate restTemplate,
                              @Value("${egov.services.boundary.host}") String boundaryServiceHost); Boundary fetchBoundaryById(Long id, String tenantId); }
BoundaryRepository { public Boundary fetchBoundaryById(Long id, String tenantId) { String url = this.boundaryServiceHost + "egov-location/boundarys?boundary.id={id}&boundary.tenantId={tenantId}"; return getBoundaryServiceResponse(url, id, tenantId).getBoundaries().get(0); } BoundaryRepository(RestTemplate restTemplate,
                              @Value("${egov.services.boundary.host}") String boundaryServiceHost); Boundary fetchBoundaryById(Long id, String tenantId);  }