Search in sources :

Example 1 with ComplaintsDTO

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));
}
Also used : Invocation(javax.ws.rs.client.Invocation) ComplaintsDTO(gov.ca.cwds.cals.service.dto.ComplaintsDTO) WebTarget(javax.ws.rs.client.WebTarget) Test(org.junit.Test) BaseCalsApiIntegrationTest(gov.ca.cwds.cals.BaseCalsApiIntegrationTest)

Example 2 with 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;
}
Also used : ComplaintsDTO(gov.ca.cwds.cals.service.dto.ComplaintsDTO) ComplaintReportLic802(gov.ca.cwds.cals.persistence.model.fas.ComplaintReportLic802)

Aggregations

ComplaintsDTO (gov.ca.cwds.cals.service.dto.ComplaintsDTO)2 BaseCalsApiIntegrationTest (gov.ca.cwds.cals.BaseCalsApiIntegrationTest)1 ComplaintReportLic802 (gov.ca.cwds.cals.persistence.model.fas.ComplaintReportLic802)1 Invocation (javax.ws.rs.client.Invocation)1 WebTarget (javax.ws.rs.client.WebTarget)1 Test (org.junit.Test)1