use of gov.ca.cwds.cals.service.dto.ComplaintsDTO in project cals-api by ca-cwds.
the class FacilityComplaintResourceTest method getAllFacilityComplaintsTest.
@Test
public void getAllFacilityComplaintsTest() throws Exception {
WebTarget target = clientTestRule.target(FACILITIES + "/" + FACILITY_ID + "/" + Constants.API.COMPLAINTS);
Invocation.Builder invocation = target.request(MediaType.APPLICATION_JSON);
ComplaintsDTO complaintsDTO = invocation.get(ComplaintsDTO.class);
String fixture = fixture("fixtures/facility/complaints-response.json");
assertEqualsResponse(fixture, transformDTOtoJSON(complaintsDTO));
}
use of gov.ca.cwds.cals.service.dto.ComplaintsDTO in project cals-api by ca-cwds.
the class ComplaintsCollectionService method find.
@Override
public Response find(Serializable facilityNumber) {
List<ComplaintReportLic802> facilityComplaints = complaintReportLic802Dao.findComplaintsByFacilityNumber(String.valueOf(facilityNumber));
if (CollectionUtils.isEmpty(facilityComplaints)) {
return null;
}
ComplaintsDTO complaintsDTO = new ComplaintsDTO();
complaintsDTO.setComplaints(complaintMapper.complaintsListToComplaintsDTOList(facilityComplaints));
return complaintsDTO;
}
Aggregations