@Test public void test_should_fetch_complainttype_for_given_code() throws Exception { server.expect(once(), requestTo("http: .andRespond(withSuccess(new Resources().getFileContents("successComplaintTypeResponse.json"), MediaType.APPLICATION_JSON_UTF8)); final ServiceType complaintType = complaintTypeRepository.fetchServiceTypeByCode("AOS","ap.public"); server.verify(); assertEquals("10", complaintType.getSlaHours().toString()); }
public ServiceType fetchServiceTypeByCode(String serviceCode, String tenantId) { String url = this.complaintTypeServiceHostname + SERVICE_TYPE_BY_CODE_URL; return getComplaintTypeServiceResponse(url, serviceCode, tenantId).getComplaintTypes().get(0); }
ServiceTypeRepository { public ServiceType fetchServiceTypeByCode(String serviceCode, String tenantId) { String url = this.complaintTypeServiceHostname + SERVICE_TYPE_BY_CODE_URL; return getComplaintTypeServiceResponse(url, serviceCode, tenantId).getComplaintTypes().get(0); } }
ServiceTypeRepository { public ServiceType fetchServiceTypeByCode(String serviceCode, String tenantId) { String url = this.complaintTypeServiceHostname + SERVICE_TYPE_BY_CODE_URL; return getComplaintTypeServiceResponse(url, serviceCode, tenantId).getComplaintTypes().get(0); } ServiceTypeRepository(RestTemplate restTemplate,
                                 @Value("${egov.services.pgrrest.host}") String complaintTypeServiceHostname); }
ServiceTypeRepository { public ServiceType fetchServiceTypeByCode(String serviceCode, String tenantId) { String url = this.complaintTypeServiceHostname + SERVICE_TYPE_BY_CODE_URL; return getComplaintTypeServiceResponse(url, serviceCode, tenantId).getComplaintTypes().get(0); } ServiceTypeRepository(RestTemplate restTemplate,
                                 @Value("${egov.services.pgrrest.host}") String complaintTypeServiceHostname); ServiceType fetchServiceTypeByCode(String serviceCode, String tenantId); }
ServiceTypeRepository { public ServiceType fetchServiceTypeByCode(String serviceCode, String tenantId) { String url = this.complaintTypeServiceHostname + SERVICE_TYPE_BY_CODE_URL; return getComplaintTypeServiceResponse(url, serviceCode, tenantId).getComplaintTypes().get(0); } ServiceTypeRepository(RestTemplate restTemplate,
                                 @Value("${egov.services.pgrrest.host}") String complaintTypeServiceHostname); ServiceType fetchServiceTypeByCode(String serviceCode, String tenantId);  }