use of gov.ca.cwds.cals.service.dto.FacilityDTO in project cals-api by ca-cwds.
the class FacilityResourceTest method testGetFacilityByFacilityIdWithZeroInCountyAndFacilityType.
@Test
public void testGetFacilityByFacilityIdWithZeroInCountyAndFacilityType() throws Exception {
WebTarget target = clientTestRule.target(Constants.API.FACILITIES + "/BITrEV40OU");
Invocation.Builder invocation = target.request(MediaType.APPLICATION_JSON);
FacilityDTO facilityDTO = invocation.get(FacilityDTO.class);
String fixture = fixture("fixtures/facility/facility-by-id-with-zero-in-county-and-facility-type-response.json");
assertEqualsResponse(fixture, transformDTOtoJSON(facilityDTO));
}
use of gov.ca.cwds.cals.service.dto.FacilityDTO in project cals-api by ca-cwds.
the class FacilityResourceTest method testGetFacilityWithLastCapacityChanged.
@Test
public void testGetFacilityWithLastCapacityChanged() throws Exception {
WebTarget target = clientTestRule.target(Constants.API.FACILITIES + "/" + FACILITY_FROM_LIS_ID);
Invocation.Builder invocation = target.request(MediaType.APPLICATION_JSON);
FacilityDTO facilityDTO = invocation.get(FacilityDTO.class);
assertEquals(2006, facilityDTO.getCapacityLastChanged().getYear());
assertEquals(10, facilityDTO.getCapacityLastChanged().getMonthValue());
assertEquals(13, facilityDTO.getCapacityLastChanged().getDayOfMonth());
}
use of gov.ca.cwds.cals.service.dto.FacilityDTO in project cals-api by ca-cwds.
the class FacilityResourceTest method testGetFacilityByLicenseNumber.
@Test
public void testGetFacilityByLicenseNumber() throws Exception {
WebTarget target = clientTestRule.target(Constants.API.FACILITIES + "/" + LICENSE_NUMBER);
Invocation.Builder invocation = target.request(MediaType.APPLICATION_JSON);
FacilityDTO facilityDTO = invocation.get(FacilityDTO.class);
String fixture = fixture("fixtures/facility/facility-by-license-number-response.json");
assertEqualsResponse(fixture, transformDTOtoJSON(facilityDTO));
}
use of gov.ca.cwds.cals.service.dto.FacilityDTO in project cals-api by ca-cwds.
the class FacilityResourceTest method testGetFacilityByFacilityId.
@Test
public void testGetFacilityByFacilityId() throws Exception {
WebTarget target = clientTestRule.target(Constants.API.FACILITIES + "/" + FACILITY_ID);
Invocation.Builder invocation = target.request(MediaType.APPLICATION_JSON);
FacilityDTO facilityDTO = invocation.get(FacilityDTO.class);
String fixture = fixture("fixtures/facility/facility-by-id-response.json");
assertEqualsResponse(fixture, transformDTOtoJSON(facilityDTO));
}
use of gov.ca.cwds.cals.service.dto.FacilityDTO in project cals-api by ca-cwds.
the class FacilityService method loadFacilityFromCwsCms.
private FacilityDTO loadFacilityFromCwsCms(FacilityParameterObject parameterObject) {
FacilityDTO facilityDto = cwsFacilityService.loadFacilityFromCwsCms(parameterObject);
if (parameterObject.isExpanded()) {
List<FacilityChildDTO> facilityChildren = cwsFacilityService.findFacilityChildrenByFacilityId(parameterObject.getFacilityId());
List<FacilityInspectionDTO> inspections = fasFacilityService.findInspectionsByFacilityId(facilityDto.getLicenseNumber());
List<ComplaintDTO> complaints = fasFacilityService.findComplaintsByFacilityId(facilityDto.getLicenseNumber());
facilityDto = facilityMapper.toExpandedFacilityDTO(facilityDto, facilityChildren, inspections, complaints);
}
return facilityDto;
}
Aggregations