@Test public void test_should_get_boundaries_by_id() { server.expect(once(), requestTo("http: .andExpect(method(HttpMethod.GET)) .andRespond(withSuccess(new Resources().getFileContents("boundaryResponse.json"), MediaType.APPLICATION_JSON_UTF8)); final BoundaryResponse boundaryResponse = boundaryRepository.fetchBoundaryById(1l, "tenantId"); server.verify(); assertEquals(2, boundaryResponse.getId().intValue()); assertEquals("Srinivas Nagar", boundaryResponse.getName()); }
public BoundaryResponse fetchBoundaryById(final Long id, final String tenantId) { final BoundaryServiceResponse boudaryServiceResponse = restTemplate.getForObject(url, BoundaryServiceResponse.class, id, tenantId); return boudaryServiceResponse.getBoundary().get(0); }
BoundaryRepository { public BoundaryResponse fetchBoundaryById(final Long id, final String tenantId) { final BoundaryServiceResponse boudaryServiceResponse = restTemplate.getForObject(url, BoundaryServiceResponse.class, id, tenantId); return boudaryServiceResponse.getBoundary().get(0); } }
BoundaryRepository { public BoundaryResponse fetchBoundaryById(final Long id, final String tenantId) { final BoundaryServiceResponse boudaryServiceResponse = restTemplate.getForObject(url, BoundaryServiceResponse.class, id, tenantId); return boudaryServiceResponse.getBoundary().get(0); } BoundaryRepository(final RestTemplate restTemplate,
            @Value("${egov.services.boundary.host}") final String boundaryServiceHost,
            @Value("${egov.services.location.boundaries_by_id}") final String url); }
BoundaryRepository { public BoundaryResponse fetchBoundaryById(final Long id, final String tenantId) { final BoundaryServiceResponse boudaryServiceResponse = restTemplate.getForObject(url, BoundaryServiceResponse.class, id, tenantId); return boudaryServiceResponse.getBoundary().get(0); } BoundaryRepository(final RestTemplate restTemplate,
            @Value("${egov.services.boundary.host}") final String boundaryServiceHost,
            @Value("${egov.services.location.boundaries_by_id}") final String url); BoundaryResponse fetchBoundaryById(final Long id, final String tenantId); }
BoundaryRepository { public BoundaryResponse fetchBoundaryById(final Long id, final String tenantId) { final BoundaryServiceResponse boudaryServiceResponse = restTemplate.getForObject(url, BoundaryServiceResponse.class, id, tenantId); return boudaryServiceResponse.getBoundary().get(0); } BoundaryRepository(final RestTemplate restTemplate,
            @Value("${egov.services.boundary.host}") final String boundaryServiceHost,
            @Value("${egov.services.location.boundaries_by_id}") final String url); BoundaryResponse fetchBoundaryById(final Long id, final String tenantId);  }