use of gov.ca.cwds.test.support.JsonIdentityAuthParams in project cals-api by ca-cwds.
the class FacilityResourceTest method testCallGetFacilityByFacilityIdByPrivCWSCaseManagementSystem.
@Test
public void testCallGetFacilityByFacilityIdByPrivCWSCaseManagementSystem() throws Exception {
String targetString = Constants.API.FACILITIES + "/" + FACILITY_ID + '?' + TestSecurityFilter.PATH_TO_PRINCIPAL_FIXTURE + '=' + PRINCIPAL_PRIV_CWS_CASE_MANAGEMENT_SYSTEM_JSON;
JsonIdentityAuthParams params = new JsonIdentityAuthParams(fixture(PRINCIPAL_PRIV_CWS_CASE_MANAGEMENT_SYSTEM_JSON));
WebTarget target = clientTestRule.target(targetString, params);
Invocation.Builder invocation = target.request(MediaType.APPLICATION_JSON);
Response response = invocation.get();
assertEquals(HttpStatus.SC_OK, response.getStatus());
}
use of gov.ca.cwds.test.support.JsonIdentityAuthParams in project cals-api by ca-cwds.
the class FacilityChildResourceTest method testGetFacilityChildrenWithAssignedWorkerPresent.
@Test
public void testGetFacilityChildrenWithAssignedWorkerPresent() throws Exception {
String pathInfo = FACILITIES + "/{" + FACILITY_ID + "}/" + CHILDREN + "?" + TestSecurityFilter.PATH_TO_PRINCIPAL_FIXTURE + '=' + SECURITY_CLIENT_PRINCIPAL_SAME_COUNTY_SEALED_JSON;
pathInfo = pathInfo.replace("{" + FACILITY_ID + "}", "412252222");
JsonIdentityAuthParams params = new JsonIdentityAuthParams(fixture(SECURITY_CLIENT_PRINCIPAL_SAME_COUNTY_SEALED_JSON));
WebTarget target = clientTestRule.target(pathInfo, params);
Invocation.Builder invocation = target.request(MediaType.APPLICATION_JSON);
FacilityChildrenDto facilityChildDTO = invocation.get(FacilityChildrenDto.class);
String fixture = fixture("fixtures/facility/facility-children-response-assigned-worker-present.json");
assertEqualsResponse(fixture, transformDTOtoJSON(facilityChildDTO));
}
use of gov.ca.cwds.test.support.JsonIdentityAuthParams in project cals-api by ca-cwds.
the class FacilityResourceTest method testCallGetFacilityByFacilityIdByPrivResourceManagement.
@Test
public void testCallGetFacilityByFacilityIdByPrivResourceManagement() throws Exception {
String targetString = Constants.API.FACILITIES + "/" + FACILITY_ID + '?' + TestSecurityFilter.PATH_TO_PRINCIPAL_FIXTURE + '=' + PRINCIPAL_PRIV_RESOURCE_MANAGEMENT_JSON;
JsonIdentityAuthParams params = new JsonIdentityAuthParams(fixture(PRINCIPAL_PRIV_RESOURCE_MANAGEMENT_JSON));
WebTarget target = clientTestRule.target(targetString, params);
Invocation.Builder invocation = target.request(MediaType.APPLICATION_JSON);
Response response = invocation.get();
assertEquals(HttpStatus.SC_OK, response.getStatus());
}
Aggregations