use of com.evolveum.midpoint.xml.ns._public.common.common_3.UserType in project midpoint by Evolveum.
the class AbstractAdLdapMultidomainTest method test690ModifyUserSubmanRename.
@Test
public void test690ModifyUserSubmanRename() throws Exception {
final String TEST_NAME = "test690ModifyUserSubmanRename";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(this.getClass().getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
ObjectDelta<UserType> objectDelta = createModifyUserReplaceDelta(USER_SUBMAN_OID, UserType.F_NAME, PrismTestUtil.createPolyString(USER_SUBDOG_USERNAME));
objectDelta.addModificationReplaceProperty(UserType.F_FULL_NAME, PrismTestUtil.createPolyString(USER_SUBDOG_FULL_NAME));
Collection<ObjectDelta<? extends ObjectType>> deltas = MiscSchemaUtil.createCollection(objectDelta);
// WHEN
TestUtil.displayWhen(TEST_NAME);
modelService.executeChanges(deltas, null, task, result);
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
TestUtil.assertSuccess(result);
Entry entry = assertLdapSubAccount(USER_SUBDOG_USERNAME, USER_SUBDOG_FULL_NAME);
assertAttribute(entry, "title", "Underdog");
PrismObject<UserType> user = getUser(USER_SUBMAN_OID);
String shadowOid = getSingleLinkOid(user);
assertEquals("Shadows have moved", accountSubmanOid, shadowOid);
PrismObject<ShadowType> shadow = getObject(ShadowType.class, shadowOid);
display("Shadow after rename (model)", shadow);
PrismObject<ShadowType> repoShadow = repositoryService.getObject(ShadowType.class, shadowOid, null, result);
display("Shadow after rename (repo)", repoShadow);
assertNoLdapSubAccount(USER_SUBMAN_USERNAME, USER_SUBMAN_FULL_NAME);
// assertLdapConnectorInstances(2);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.UserType in project midpoint by Evolveum.
the class AbstractAdLdapMultidomainTest method test213ModifyUserBarbossaShowInAdvancedViewOnlyFalse.
/**
* Modify USER, test boolean value mapping.
*/
@Test
public void test213ModifyUserBarbossaShowInAdvancedViewOnlyFalse() throws Exception {
final String TEST_NAME = "test213ModifyUserBarbossaShowInAdvancedViewOnlyFalse";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(this.getClass().getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
ObjectDelta<ShadowType> delta = ObjectDelta.createEmptyModifyDelta(ShadowType.class, accountBarbossaOid, prismContext);
QName attrQName = new QName(MidPointConstants.NS_RI, "showInAdvancedViewOnly");
ResourceAttributeDefinition<String> attrDef = accountObjectClassDefinition.findAttributeDefinition(attrQName);
PropertyDelta<Boolean> attrDelta = PropertyDelta.createModificationReplaceProperty(new ItemPath(ShadowType.F_ATTRIBUTES, attrQName), attrDef, Boolean.TRUE);
delta.addModification(attrDelta);
// WHEN
TestUtil.displayWhen(TEST_NAME);
modifyUserReplace(USER_BARBOSSA_OID, new ItemPath(UserType.F_EXTENSION, EXTENSION_SHOW_IN_ADVANCED_VIEW_ONLY_QNAME), task, result, Boolean.FALSE);
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
TestUtil.assertSuccess(result);
Entry entry = assertLdapAccount(USER_BARBOSSA_USERNAME, USER_BARBOSSA_FULL_NAME);
assertAttribute(entry, "showInAdvancedViewOnly", "FALSE");
assertAttribute(entry, ATTRIBUTE_USER_ACCOUNT_CONTROL_NAME, "512");
PrismObject<UserType> user = getUser(USER_BARBOSSA_OID);
String shadowOid = getSingleLinkOid(user);
assertEquals("Shadows have moved", accountBarbossaOid, shadowOid);
// assertLdapConnectorInstances(2);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.UserType in project midpoint by Evolveum.
the class AbstractAdLdapMultidomainTest method test809UnAssignAccountSubmarine.
@Test
public void test809UnAssignAccountSubmarine() throws Exception {
final String TEST_NAME = "test809UnAssignAccountSubmarine";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(this.getClass().getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
// WHEN
TestUtil.displayWhen(TEST_NAME);
unassignRole(USER_SUBMARINE_OID, ROLE_SUBMISSIVE_OID, task, result);
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
TestUtil.assertSuccess(result);
assertNoLdapSubAccount(USER_SUBMARINE_USERNAME, USER_SUBMARINE_FULL_NAME);
PrismObject<UserType> user = getUser(USER_SUBMARINE_OID);
assertNoLinkedAccount(user);
// assertLdapConnectorInstances(2);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.UserType in project midpoint by Evolveum.
the class AbstractAdLdapMultidomainTest method test399UnAssignAccountBarbossa.
@Test
public void test399UnAssignAccountBarbossa() throws Exception {
final String TEST_NAME = "test399UnAssignAccountBarbossa";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(this.getClass().getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
// WHEN
TestUtil.displayWhen(TEST_NAME);
unassignAccount(USER_BARBOSSA_OID, getResourceOid(), null, task, result);
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
TestUtil.assertSuccess(result);
assertNoLdapAccount(USER_BARBOSSA_USERNAME, USER_BARBOSSA_FULL_NAME);
assertNoLdapAccount(USER_CPTBARBOSSA_USERNAME, USER_CPTBARBOSSA_FULL_NAME);
PrismObject<UserType> user = getUser(USER_BARBOSSA_OID);
assertNoLinkedAccount(user);
// assertLdapConnectorInstances(2);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.UserType in project midpoint by Evolveum.
the class AbstractAdLdapMultidomainTest method test220ModifyUserBarbossaPassword.
@Test
public void test220ModifyUserBarbossaPassword() throws Exception {
final String TEST_NAME = "test220ModifyUserBarbossaPassword";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(this.getClass().getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
ProtectedStringType userPasswordPs = new ProtectedStringType();
userPasswordPs.setClearValue("here.There.Be.Monsters");
// WHEN
TestUtil.displayWhen(TEST_NAME);
modifyUserReplace(USER_BARBOSSA_OID, new ItemPath(UserType.F_CREDENTIALS, CredentialsType.F_PASSWORD, PasswordType.F_VALUE), task, result, userPasswordPs);
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
TestUtil.assertSuccess(result);
Entry entry = assertLdapAccount(USER_BARBOSSA_USERNAME, USER_BARBOSSA_FULL_NAME);
assertAttribute(entry, "title", "Captain");
assertLdapPassword(USER_BARBOSSA_USERNAME, USER_BARBOSSA_FULL_NAME, "here.There.Be.Monsters");
assertAttribute(entry, ATTRIBUTE_USER_ACCOUNT_CONTROL_NAME, "512");
PrismObject<UserType> user = getUser(USER_BARBOSSA_OID);
String shadowOid = getSingleLinkOid(user);
assertEquals("Shadows have moved", accountBarbossaOid, shadowOid);
// assertLdapConnectorInstances(2);
}
Aggregations