use of com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType in project midpoint by Evolveum.
the class ProjectionCredentialsProcessor method processProjectionCredentialsFocus.
public <F extends FocusType> void processProjectionCredentialsFocus(LensContext<F> context, LensProjectionContext projectionContext, XMLGregorianCalendar now, Task task, OperationResult result) throws ExpressionEvaluationException, ObjectNotFoundException, SchemaException, PolicyViolationException, CommunicationException, ConfigurationException, SecurityViolationException {
ValuePolicyType passwordPolicy = determinePasswordPolicy(context, projectionContext, now, task, result);
processProjectionPasswordMapping(context, projectionContext, passwordPolicy, now, task, result);
validateProjectionPassword(context, projectionContext, passwordPolicy, now, task, result);
applyMetadata(context, projectionContext, now, task, result);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType in project midpoint by Evolveum.
the class TestReconScript method test003testReconcileScriptsAddUserAction.
@Test
public void test003testReconcileScriptsAddUserAction() throws Exception {
final String TEST_NAME = "test003testReconcileScriptsAddUserAction";
TestUtil.displayTestTile(this, TEST_NAME);
Task task = taskManager.createTaskInstance(TEST_NAME);
OperationResult parentResult = new OperationResult(TEST_NAME);
ShadowType shadow = parseObjectType(new File(ACCOUNT_BEFORE_SCRIPT_FILENAME), ShadowType.class);
provisioningService.addObject(shadow.asPrismObject(), null, null, task, parentResult);
getDummyResource().getScriptHistory().clear();
waitForTaskStart(TASK_RECON_DUMMY_OID, false, DEFAULT_TASK_WAIT_TIMEOUT);
waitForTaskNextRunAssertSuccess(TASK_RECON_DUMMY_OID, false, DEFAULT_TASK_WAIT_TIMEOUT);
waitForTaskFinish(TASK_RECON_DUMMY_OID, true);
PrismObject<ShadowType> afterRecon = repositoryService.getObject(ShadowType.class, ACCOUNT_BEFORE_SCRIPT_OID, null, parentResult);
AssertJUnit.assertNotNull(afterRecon);
ShadowType afterReconShadow = afterRecon.asObjectable();
if (afterReconShadow.getResult() != null) {
OperationResult beforeScriptResult = OperationResult.createOperationResult(afterReconShadow.getResult());
display("result in shadow: " + beforeScriptResult);
AssertJUnit.fail("Operation in shadow not null, recocniliation failed. ");
}
PrismObject<FocusType> user = repositoryService.searchShadowOwner(ACCOUNT_BEFORE_SCRIPT_OID, null, parentResult);
AssertJUnit.assertNotNull("Owner for account " + shadow.asPrismObject() + " not found. Some probelm in recon occured.", user);
for (ScriptHistoryEntry script : getDummyResource().getScriptHistory()) {
String userName = (String) script.getParams().get("midpoint_usercn");
String idPath = (String) script.getParams().get("midpoint_idpath");
String tempPath = (String) script.getParams().get("midpoint_temppath");
LOGGER.trace("userName {} idPath {} tempPath {}", new Object[] { userName, idPath, tempPath });
if (!idPath.contains(userName)) {
AssertJUnit.fail("Expected that idPath will contain userName [idPath: " + idPath + ", userName " + userName + "]");
}
if (!tempPath.contains(userName)) {
AssertJUnit.fail("Expected that tempPath will contain userName [idPath: " + idPath + ", userName " + userName + "]");
}
}
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType in project midpoint by Evolveum.
the class TestReconScript method test005TestDryRunDelete.
@Test
public void test005TestDryRunDelete() throws Exception {
final String TEST_NAME = "test005TestDryRunDelete";
TestUtil.displayTestTile(this, TEST_NAME);
PrismObject<TaskType> task = getTask(TASK_RECON_DUMMY_OID);
OperationResult parentResult = new OperationResult(TEST_NAME);
PropertyDelta dryRunDelta = PropertyDelta.createModificationReplaceProperty(new ItemPath(TaskType.F_EXTENSION, SchemaConstants.MODEL_EXTENSION_DRY_RUN), task.getDefinition(), true);
Collection<PropertyDelta> modifications = new ArrayList<>();
modifications.add(dryRunDelta);
repositoryService.modifyObject(TaskType.class, TASK_RECON_DUMMY_OID, modifications, parentResult);
getDummyResource().deleteAccountByName("beforeScript");
waitForTaskStart(TASK_RECON_DUMMY_OID, false);
waitForTaskNextRunAssertSuccess(TASK_RECON_DUMMY_OID, false);
waitForTaskFinish(TASK_RECON_DUMMY_OID, false);
PrismObject<ShadowType> shadow = repositoryService.getObject(ShadowType.class, ACCOUNT_BEFORE_SCRIPT_OID, null, parentResult);
AssertJUnit.assertNotNull(shadow);
PrismObject<FocusType> user = repositoryService.searchShadowOwner(ACCOUNT_BEFORE_SCRIPT_OID, null, parentResult);
AssertJUnit.assertNotNull("Owner for account " + shadow + " not found. Some probelm in dry run occured.", user);
}
Aggregations