@Test public void test_should_fetch_location_for_given_coordinates() { server.expect(once(), requestTo("http: .andExpect(method(HttpMethod.GET)) .andRespond( withSuccess(new Resources().getFileContents("successBoundaryResponse.json"), MediaType.APPLICATION_JSON_UTF8)); final BoundaryResponse boundary = boundaryRepository.findBoundary("1.11", "2.22","ap.public"); server.verify(); assertEquals(Long.valueOf(1), boundary.getId()); assertEquals("foo", boundary.getName()); }
public BoundaryResponse findBoundary(String latitude, String longitude,String tenantid) { final BoundaryServiceResponse serviceResponse = restTemplate.getForObject(this.url, BoundaryServiceResponse.class, latitude, longitude,tenantid); return serviceResponse.getBoundary(); }
BoundaryRepository { public BoundaryResponse findBoundary(String latitude, String longitude,String tenantid) { final BoundaryServiceResponse serviceResponse = restTemplate.getForObject(this.url, BoundaryServiceResponse.class, latitude, longitude,tenantid); return serviceResponse.getBoundary(); } }
BoundaryRepository { public BoundaryResponse findBoundary(String latitude, String longitude,String tenantid) { final BoundaryServiceResponse serviceResponse = restTemplate.getForObject(this.url, BoundaryServiceResponse.class, latitude, longitude,tenantid); return serviceResponse.getBoundary(); } @Autowired  BoundaryRepository(RestTemplate restTemplate,
                              @Value("${egov.services.boundary.host}") String boundaryServiceHost,
                              @Value("${egov.services.boundary.context.fetch_by_lat_lng}") String latLongUrl); }
BoundaryRepository { public BoundaryResponse findBoundary(String latitude, String longitude,String tenantid) { final BoundaryServiceResponse serviceResponse = restTemplate.getForObject(this.url, BoundaryServiceResponse.class, latitude, longitude,tenantid); return serviceResponse.getBoundary(); } @Autowired  BoundaryRepository(RestTemplate restTemplate,
                              @Value("${egov.services.boundary.host}") String boundaryServiceHost,
                              @Value("${egov.services.boundary.context.fetch_by_lat_lng}") String latLongUrl); BoundaryResponse findBoundary(String latitude, String longitude,String tenantid); }
BoundaryRepository { public BoundaryResponse findBoundary(String latitude, String longitude,String tenantid) { final BoundaryServiceResponse serviceResponse = restTemplate.getForObject(this.url, BoundaryServiceResponse.class, latitude, longitude,tenantid); return serviceResponse.getBoundary(); } @Autowired  BoundaryRepository(RestTemplate restTemplate,
                              @Value("${egov.services.boundary.host}") String boundaryServiceHost,
                              @Value("${egov.services.boundary.context.fetch_by_lat_lng}") String latLongUrl); BoundaryResponse findBoundary(String latitude, String longitude,String tenantid);  }