use of com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType in project midpoint by Evolveum.
the class TestEntertainment method test000Sanity.
@Test
public void test000Sanity() throws Exception {
final String TEST_NAME = "test000Sanity";
displayTestTile(TEST_NAME);
Task task = taskManager.createTaskInstance(TestTrafo.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
OperationResult testResultOpenDj = modelService.testResource(RESOURCE_OPENDJ_OID, task);
assertSuccess(testResultOpenDj);
SystemConfigurationType systemConfiguration = getSystemConfiguration();
assertNotNull("No system configuration", systemConfiguration);
display("System config", systemConfiguration);
PrismObject<RoleType> metaRole = modelService.getObject(RoleType.class, ROLE_META_CREATE_ORG_GROUPS_OID, null, task, result);
assertNotNull("No metarole, probably probelm with initialization", metaRole);
result.computeStatus();
assertSuccess("Role not fetch successfully", result);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType in project midpoint by Evolveum.
the class TestOrgSync method assertResponsibility.
private String assertResponsibility(PrismObject<UserType> user, String respName) throws SchemaException, ObjectNotFoundException, SecurityViolationException, CommunicationException, ConfigurationException, DirectoryException, ExpressionEvaluationException {
String respRoleName = "R_" + respName;
PrismObject<RoleType> respRole = searchObjectByName(RoleType.class, respRoleName);
assertNotNull("No role for responsibility " + respName);
display("Responsibility role for " + respName, respRole);
assertAssignedRole(user, respRole.getOid());
PrismReferenceValue linkRef = getSingleLinkRef(respRole);
PrismObject<ShadowType> shadow = getShadowModel(linkRef.getOid());
display("Role " + respRoleName + " shadow", shadow);
// TODO assert shadow content
String groupDn = "cn=" + respRoleName + ",ou=groups," + openDJController.getSuffix();
Entry groupEntry = openDJController.fetchAndAssertEntry(groupDn, "groupOfUniqueNames");
display("Group entry", groupEntry);
PrismReferenceValue accountLinkRef = getLinkRef(user, RESOURCE_OPENDJ_OID);
PrismObject<ShadowType> accountShadow = getShadowModel(accountLinkRef.getOid());
String accountDn = IntegrationTestTools.getSecondaryIdentifier(accountShadow);
openDJController.assertUniqueMember(groupEntry, accountDn);
IntegrationTestTools.assertAssociation(accountShadow, OPENDJ_ASSOCIATION_GROUP_NAME, shadow.getOid());
return respRole.getOid();
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType in project midpoint by Evolveum.
the class TestNotoriousRole method addNotoriousRole.
private void addNotoriousRole(OperationResult result) throws Exception {
PrismObject<RoleType> role = parseObject(ROLE_NOTORIOUS_FILE);
RoleType roleType = role.asObjectable();
for (int i = 0; i < NUMBER_OF_LEVEL_B_ROLES; i++) {
roleType.beginInducement().targetRef(generateRoleOid(ROLE_LEVEL_B_OID_FORMAT, i), RoleType.COMPLEX_TYPE).end();
}
LOGGER.info("Adding {}:\n{}", role, role.debugDump(1));
repositoryService.addObject(role, null, result);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType in project midpoint by Evolveum.
the class TestNullAttribute method initSystem.
@Override
public void initSystem(Task initTask, OperationResult initResult) throws Exception {
super.initSystem(initTask, initResult);
// Resources
//default instance, no instance id
//when id is set it is required to be present in resource.xml (I guess)
dummyResourceCtl = DummyResourceContoller.create(null, resourceDummy);
DummyObjectClass dummyAdAccountObjectClass = dummyResourceCtl.getDummyResource().getAccountObjectClass();
//attributes
dummyResourceCtl.addAttrDef(dummyAdAccountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_FULLNAME, String.class, false, false);
dummyResourceCtl.addAttrDef(dummyAdAccountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_SHIP, String.class, false, false);
dummyResourceCtl.addAttrDef(dummyAdAccountObjectClass, DUMMY_ACCOUNT_ATTRIBUTE_WEAPON, String.class, false, false);
dummyResource = dummyResourceCtl.getDummyResource();
resourceDummy = importAndGetObjectFromFile(ResourceType.class, RESOURCE_DUMMY_FILE, RESOURCE_DUMMY_OID, initTask, initResult);
dummyResourceCtl.setResource(resourceDummy);
// dummyResource.setSyncStyle(DummySyncStyle.SMART);
//
assumeAssignmentPolicy(AssignmentPolicyEnforcementType.FULL);
// Object Templates
importObjectFromFile(OBJECT_TEMPLATE_USER_FILE, initResult);
setDefaultUserTemplate(OBJECT_TEMPLATE_USER_OID);
// Role
importObjectFromFile(ROLE_ACCOUNTONLY_FILE, initResult);
importObjectFromFile(ROLE_SHIPNWEAPON_FILE, initResult);
PrismObject<RoleType> rolesw = getRole(ROLE_SHIPNWEAPON_OID);
display("role shipNWeapon initial", rolesw);
//User
importObjectFromFile(USER_SMACK_FILE, initResult);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType in project midpoint by Evolveum.
the class TestWSSecurity method test136AddRoleAsDarthAdder.
@Test
public void test136AddRoleAsDarthAdder() throws Exception {
final String TEST_NAME = "test136AddRoleAsDarthAdder";
displayTestTitle(TEST_NAME);
LogfileTestTailer tailer = createLogTailer();
RoleType role = ModelClientUtil.unmarshallFile(ROLE_MODIFIER_FILE);
/// WHEN
addObject(role);
// THEN
tailer.tail();
displayAudit(tailer);
assertAuditLoginLogout(tailer);
assertAuditIds(tailer);
assertAuditOperation(tailer, "ADD_OBJECT");
tailer.assertAudit(4);
assertObjectCount(UserType.class, 6);
assertObjectCount(RoleType.class, 6);
}
Aggregations