@Test public void getComplaintTypes() throws Exception { when(serviceRequestTypeService.getComplaintType("BPS", AP_PUBLIC)).thenReturn(getComplaintType()); mockMvc.perform(post("/services/v1/BPS/_search?tenantId=ap.public") .content(resources.getFileContents("requestinfobody.json")) .contentType(MediaType.APPLICATION_JSON_UTF8)) .andExpect(status().isOk()) .andExpect(content().json(resources.getFileContents("complaintTypeResponse.json"))); }
private List<ServiceType> getComplaintType(org.egov.pgrrest.common.persistence.entity.ServiceType complaintType) { if (complaintType == null) return Collections.emptyList(); else return Collections.singletonList(new ServiceType(complaintType)); }
ServiceTypeController { private List<ServiceType> getComplaintType(org.egov.pgrrest.common.persistence.entity.ServiceType complaintType) { if (complaintType == null) return Collections.emptyList(); else return Collections.singletonList(new ServiceType(complaintType)); } }
ServiceTypeController { private List<ServiceType> getComplaintType(org.egov.pgrrest.common.persistence.entity.ServiceType complaintType) { if (complaintType == null) return Collections.emptyList(); else return Collections.singletonList(new ServiceType(complaintType)); } ServiceTypeController(ServiceRequestTypeService serviceRequestTypeService); }
ServiceTypeController { private List<ServiceType> getComplaintType(org.egov.pgrrest.common.persistence.entity.ServiceType complaintType) { if (complaintType == null) return Collections.emptyList(); else return Collections.singletonList(new ServiceType(complaintType)); } ServiceTypeController(ServiceRequestTypeService serviceRequestTypeService); @PostMapping(value = "/v1/_search") ServiceTypeResponse getServiceTypes(@RequestParam String type,
                                               @RequestParam(required = false) Long categoryId,
                                               @RequestParam(required = false) Integer count,
                                               @RequestParam(value = "tenantId", defaultValue = "default")
                                                   final String tenantId,
                                               @RequestBody RequestInfoBody requestInfo); @PostMapping("/v1/{serviceCode}/_search") ServiceTypeResponse getServiceTypes(@PathVariable(name = "serviceCode") String complaintTypeCode,
                                               @RequestParam(value = "tenantId", defaultValue = "default")
                                                   String tenantId,
                                               @RequestBody RequestInfoBody requestInfo); }
ServiceTypeController { private List<ServiceType> getComplaintType(org.egov.pgrrest.common.persistence.entity.ServiceType complaintType) { if (complaintType == null) return Collections.emptyList(); else return Collections.singletonList(new ServiceType(complaintType)); } ServiceTypeController(ServiceRequestTypeService serviceRequestTypeService); @PostMapping(value = "/v1/_search") ServiceTypeResponse getServiceTypes(@RequestParam String type,
                                               @RequestParam(required = false) Long categoryId,
                                               @RequestParam(required = false) Integer count,
                                               @RequestParam(value = "tenantId", defaultValue = "default")
                                                   final String tenantId,
                                               @RequestBody RequestInfoBody requestInfo); @PostMapping("/v1/{serviceCode}/_search") ServiceTypeResponse getServiceTypes(@PathVariable(name = "serviceCode") String complaintTypeCode,
                                               @RequestParam(value = "tenantId", defaultValue = "default")
                                                   String tenantId,
                                               @RequestBody RequestInfoBody requestInfo);  }