use of gov.ca.cwds.testapp.domain.Case in project perry by ca-cwds.
the class ApiSecurityTest method testArgUnauthorizedCompositeObject.
@Test(expected = UnauthorizedException.class)
public void testArgUnauthorizedCompositeObject() throws Exception {
CaseDTO caseDTO = new CaseDTO();
Case caseObject = new Case(2L, "name");
caseDTO.setCaseObject(caseObject);
testService.testCompositeObject(caseDTO);
}
use of gov.ca.cwds.testapp.domain.Case in project perry by ca-cwds.
the class ApiSecurityTest method testArgAuthorizedCompositeObject.
@Test
public void testArgAuthorizedCompositeObject() throws Exception {
CaseDTO caseDTO = new CaseDTO();
Case caseObject = new Case(1L, "name");
caseDTO.setCaseObject(caseObject);
testService.testCompositeObject(caseDTO);
}
use of gov.ca.cwds.testapp.domain.Case in project perry by ca-cwds.
the class BaseAuthorizerTest method check_success_whenOriginalClassInput.
@Test
public void check_success_whenOriginalClassInput() {
// given
final Case input = new Case(1L, "name");
// when
final boolean actualValue = concreteAuthorizer.check(input);
// then
assertThat(actualValue, is(true));
}
use of gov.ca.cwds.testapp.domain.Case in project perry by ca-cwds.
the class AbacPermissionTest method implies_returnFalse_whenNoAuthorizerInInput.
@Test
public void implies_returnFalse_whenNoAuthorizerInInput() {
// given
final AbacPermission input = new AbacPermission() {
{
setSecuredObject(new Case(1L, "name"));
}
};
// when
final boolean actualResult = testSubject.implies(input);
// then
assertThat(actualResult, is(false));
}
use of gov.ca.cwds.testapp.domain.Case in project perry by ca-cwds.
the class AbacPermissionTest method implies_returnTrue_whenAuthorizedObjectInInput.
@Test
public void implies_returnTrue_whenAuthorizedObjectInInput() {
// given
final AbacPermission input = new AbacPermission() {
{
setSecuredObject(new Case(1L, "name"));
Whitebox.setInternalState(this, "authorizer", new CaseAuthorizer());
}
};
// when
final boolean actualResult = testSubject.implies(input);
// then
assertThat(actualResult, is(true));
}