@Test public void test_should_get_complaint_type_id_for_given_complaint_code() { server.expect(once(), requestTo("http: .andExpect(method(HttpMethod.POST)) .andRespond(withSuccess(resources.getFileContents("serviceTypeResponse.json"), MediaType.APPLICATION_JSON_UTF8)); final ServiceType serviceType = serviceTypeRepository .getServiceTypeByCode("serviceTypeCode", "ap.kurnool"); server.verify(); assertNotNull(serviceType); assertEquals("servicename", serviceType.getName()); assertEquals(Arrays.asList("keyword1", "keyword2"), serviceType.getKeywords()); }
public ServiceType getServiceTypeByCode(String serviceTypeCode, String tenantId) { final RequestInfoBody request = new RequestInfoBody(RequestInfo.builder().build()); final ServiceTypeResponse response = restTemplate .postForObject(url, request, ServiceTypeResponse.class, serviceTypeCode, tenantId); return response.toDomain(); }
ServiceTypeRepository { public ServiceType getServiceTypeByCode(String serviceTypeCode, String tenantId) { final RequestInfoBody request = new RequestInfoBody(RequestInfo.builder().build()); final ServiceTypeResponse response = restTemplate .postForObject(url, request, ServiceTypeResponse.class, serviceTypeCode, tenantId); return response.toDomain(); } }
ServiceTypeRepository { public ServiceType getServiceTypeByCode(String serviceTypeCode, String tenantId) { final RequestInfoBody request = new RequestInfoBody(RequestInfo.builder().build()); final ServiceTypeResponse response = restTemplate .postForObject(url, request, ServiceTypeResponse.class, serviceTypeCode, tenantId); return response.toDomain(); } ServiceTypeRepository(RestTemplate restTemplate,
                                 @Value("${pgr.host}") String pgrRestHost,
                                 @Value("${get.pgr.servicetype}") String complaintTypeUrl); }
ServiceTypeRepository { public ServiceType getServiceTypeByCode(String serviceTypeCode, String tenantId) { final RequestInfoBody request = new RequestInfoBody(RequestInfo.builder().build()); final ServiceTypeResponse response = restTemplate .postForObject(url, request, ServiceTypeResponse.class, serviceTypeCode, tenantId); return response.toDomain(); } ServiceTypeRepository(RestTemplate restTemplate,
                                 @Value("${pgr.host}") String pgrRestHost,
                                 @Value("${get.pgr.servicetype}") String complaintTypeUrl); ServiceType getServiceTypeByCode(String serviceTypeCode, String tenantId); }
ServiceTypeRepository { public ServiceType getServiceTypeByCode(String serviceTypeCode, String tenantId) { final RequestInfoBody request = new RequestInfoBody(RequestInfo.builder().build()); final ServiceTypeResponse response = restTemplate .postForObject(url, request, ServiceTypeResponse.class, serviceTypeCode, tenantId); return response.toDomain(); } ServiceTypeRepository(RestTemplate restTemplate,
                                 @Value("${pgr.host}") String pgrRestHost,
                                 @Value("${get.pgr.servicetype}") String complaintTypeUrl); ServiceType getServiceTypeByCode(String serviceTypeCode, String tenantId);  }