use of com.evolveum.midpoint.xml.ns._public.common.common_3.OwnedObjectSelectorType in project midpoint by Evolveum.
the class AbstractSecurityTest method test000Sanity.
@Test
public void test000Sanity() throws Exception {
final String TEST_NAME = "test000Sanity";
TestUtil.displayTestTile(this, TEST_NAME);
assertLoggedInUser(USER_ADMINISTRATOR_USERNAME);
// WHEN
PrismObject<RoleType> roleSelf = getRole(ROLE_SELF_OID);
// THEN
display("Role self", roleSelf);
List<AuthorizationType> authorizations = roleSelf.asObjectable().getAuthorization();
assertEquals("Wrong number of authorizations", 2, authorizations.size());
AuthorizationType authRead = findAutz(authorizations, ModelAuthorizationAction.READ.getUrl());
assertEquals("Wrong action in authorization", ModelAuthorizationAction.READ.getUrl(), authRead.getAction().get(0));
List<OwnedObjectSelectorType> objectSpecs = authRead.getObject();
assertEquals("Wrong number of object specs in authorization", 1, objectSpecs.size());
SubjectedObjectSelectorType objectSpec = objectSpecs.get(0);
List<SpecialObjectSpecificationType> specials = objectSpec.getSpecial();
assertEquals("Wrong number of specials in object specs in authorization", 1, specials.size());
SpecialObjectSpecificationType special = specials.get(0);
assertEquals("Wrong special in object specs in authorization", SpecialObjectSpecificationType.SELF, special);
}
Aggregations