use of com.evolveum.icf.dummy.resource.DummyAccount in project midpoint by Evolveum.
the class TestIteration method test724DarkVioletAddLe_Chuck.
/*
* Create account with fullname Le_Chuck. This does not conflict with the orig value,
* but it does conflict on polystring norm value.
* User with name le_chuck.1 should be created. This is the third conflict, but the .1
* suffix is free, therefore it is reused.
* MID-5199
*/
@Test
public void test724DarkVioletAddLe_Chuck() throws Exception {
// GIVEN
dummyAuditService.clear();
DummyAccount account = new DummyAccount(ACCOUNT_LE_CHUCK_USERNAME);
account.setEnabled(true);
account.addAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_FULLNAME_NAME, LE_CHUCK_FULLNAME);
account.addAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_LOCATION_NAME, "Melee Island");
// WHEN
when();
displayValue("Adding dummy account", account.debugDump());
getDummyResource(RESOURCE_DUMMY_DARK_VIOLET_NAME).addAccount(account);
waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_DARK_VIOLET_OID, true);
// THEN
then();
displayAllUsers();
assertUserNick(ACCOUNT_LECHUCK_USERNAME, LECHUCK_FULLNAME, LECHUCK_FULLNAME);
assertUserNick(ACCOUNT_LE_CHUCK_USERNAME, LE_CHUCK_FULLNAME, LE_CHUCK_FULLNAME + ".1", "Melee Island");
assertUserNick(ACCOUNT_SHINETOP_USERNAME, CHUCKIE_FULLNAME, CHUCKIE_FULLNAME, "Monkey Island");
assertNoUserNick(ACCOUNT_SHINETOP_USERNAME, LECHUCK_FULLNAME + ".2");
}
use of com.evolveum.icf.dummy.resource.DummyAccount in project midpoint by Evolveum.
the class TestInbounds method test200AssignAccountOrange.
/**
* Not much happens here. Just ordinary account assign. Just make sure
* that the inbound mappings do not fail for empty values and that
* we have a good environment for the following tests.
* MID-2689
*/
@Test
public void test200AssignAccountOrange() throws Exception {
// GIVEN
Task task = getTestTask();
OperationResult result = task.getResult();
PrismObject<UserType> userBefore = getUser(USER_GUYBRUSH_OID);
display("User before", userBefore);
// WHEN
when();
assignAccountToUser(USER_GUYBRUSH_OID, RESOURCE_DUMMY_ORANGE_OID, null, task, result);
// THEN
then();
assertSuccess(result);
PrismObject<UserType> userAfter = getUser(USER_GUYBRUSH_OID);
display("User after", userAfter);
assertUser(userAfter, USER_GUYBRUSH_OID, USER_GUYBRUSH_USERNAME, USER_GUYBRUSH_FULL_NAME, USER_GUYBRUSH_GIVEN_NAME, USER_GUYBRUSH_FAMILY_NAME);
assertAssignedAccount(userAfter, RESOURCE_DUMMY_ORANGE_OID);
assertAssignedNoRole(userAfter);
assertAssignments(userAfter, 1);
assertLiveLinks(userAfter, 2);
DummyAccount dummyAccount = assertDummyAccount(RESOURCE_DUMMY_ORANGE_NAME, USER_GUYBRUSH_USERNAME, USER_GUYBRUSH_FULL_NAME, true);
displayDumpable("Orange account", dummyAccount);
guybrushShadowOrangeOid = getLiveLinkRefOid(userAfter, RESOURCE_DUMMY_ORANGE_OID);
PrismObject<ShadowType> shadowOrange = getShadowModel(guybrushShadowOrangeOid);
display("Orange shadow", shadowOrange);
}
use of com.evolveum.icf.dummy.resource.DummyAccount in project midpoint by Evolveum.
the class TestInbounds method test210ModifyAccountOrangeQuoteMonkey.
/**
* Modify 'quote' on account (through shadow). That attribute has an inbound
* expression that passes some values to description user property.
* This will not pass.
* MID-2421
*/
@Test
public void test210ModifyAccountOrangeQuoteMonkey() throws Exception {
// GIVEN
Task task = getTestTask();
OperationResult result = task.getResult();
PrismObject<UserType> userBefore = getUser(USER_GUYBRUSH_OID);
display("User before", userBefore);
// WHEN
modifyObjectReplaceProperty(ShadowType.class, guybrushShadowOrangeOid, getDummyResourceController(RESOURCE_DUMMY_ORANGE_NAME).getAttributePath(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_QUOTE_NAME), task, result, "Look behind you, a Three-Headed Monkey!");
// THEN
result.computeStatus();
TestUtil.assertSuccess(result);
PrismObject<UserType> userAfter = getUser(USER_GUYBRUSH_OID);
display("User after", userAfter);
assertUser(userAfter, USER_GUYBRUSH_OID, USER_GUYBRUSH_USERNAME, USER_GUYBRUSH_FULL_NAME, USER_GUYBRUSH_GIVEN_NAME, USER_GUYBRUSH_FAMILY_NAME);
assertNull("Wrong description", userAfter.asObjectable().getDescription());
assertAssignedAccount(userAfter, RESOURCE_DUMMY_ORANGE_OID);
assertAssignedNoRole(userAfter);
assertAssignments(userAfter, 1);
assertLiveLinks(userAfter, 2);
// Second inbound expression should work here
PrismAsserts.assertPropertyValue(userAfter, getExtensionPath(PIRACY_TALES), "Look behind you, a Three-Headed Monkey!");
DummyAccount dummyAccount = assertDummyAccount(RESOURCE_DUMMY_ORANGE_NAME, USER_GUYBRUSH_USERNAME, USER_GUYBRUSH_FULL_NAME, true);
displayDumpable("Orange account", dummyAccount);
guybrushShadowOrangeOid = getLiveLinkRefOid(userAfter, RESOURCE_DUMMY_ORANGE_OID);
PrismObject<ShadowType> shadowOrange = getShadowModel(guybrushShadowOrangeOid);
display("Orange shadow", shadowOrange);
}
use of com.evolveum.icf.dummy.resource.DummyAccount in project midpoint by Evolveum.
the class TestInbounds method test259ModifyAccountOrangeGossipRemoveRecon.
/**
* Similar to test209ModifyAccountOrangeGossipRemove, but uses direct account modification
* and reconciliation.
* MID-3080
*/
@Test
public void test259ModifyAccountOrangeGossipRemoveRecon() throws Exception {
// GIVEN
Task task = getTestTask();
OperationResult result = task.getResult();
PrismObject<UserType> userBefore = getUser(USER_GUYBRUSH_OID);
display("User before", userBefore);
DummyAccount dummyAccountBefore = getDummyAccount(RESOURCE_DUMMY_ORANGE_NAME, USER_GUYBRUSH_USERNAME);
dummyAccountBefore.replaceAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_GOSSIP_NAME);
displayDumpable("Account orange before", dummyAccountBefore);
// WHEN
reconcileUser(USER_GUYBRUSH_OID, task, result);
// THEN
result.computeStatus();
TestUtil.assertSuccess(result);
PrismObject<UserType> userAfter = getUser(USER_GUYBRUSH_OID);
display("User after", userAfter);
assertUser(userAfter, USER_GUYBRUSH_OID, USER_GUYBRUSH_USERNAME, USER_GUYBRUSH_FULL_NAME, USER_GUYBRUSH_GIVEN_NAME, USER_GUYBRUSH_FAMILY_NAME);
// The inbound mapping is tolerant. It will NOT remove the value.
assertAssignedAccount(userAfter, RESOURCE_DUMMY_ORANGE_OID);
assertAssignedRole(userAfter, ROLE_THIEF_OID);
assertAssignments(userAfter, 2);
assertUser(userAfter, "after").assertLinks(1, 0);
DummyAccount dummyAccount = assertDummyAccount(RESOURCE_DUMMY_ORANGE_NAME, USER_GUYBRUSH_USERNAME, USER_GUYBRUSH_FULL_NAME, true);
displayDumpable("Orange account", dummyAccount);
guybrushShadowOrangeOid = getLiveLinkRefOid(userAfter, RESOURCE_DUMMY_ORANGE_OID);
PrismObject<ShadowType> shadowOrange = getShadowModel(guybrushShadowOrangeOid);
display("Orange shadow", shadowOrange);
}
use of com.evolveum.icf.dummy.resource.DummyAccount in project midpoint by Evolveum.
the class TestInbounds method test250UnlinkAccountDefaultDummy.
/**
* Not much happens here. We just need to remove the dummy account to avoid
* inbound expression interferences. We wanted to have the dummy account in
* text20x because these were relative. But now it will ruin the setup.
*/
@Test
public void test250UnlinkAccountDefaultDummy() throws Exception {
// GIVEN
Task task = getTestTask();
OperationResult result = task.getResult();
PrismObject<UserType> userBefore = getUser(USER_GUYBRUSH_OID);
display("User before", userBefore);
ObjectDelta<UserType> unlinkDelta = createModifyUserUnlinkAccount(USER_GUYBRUSH_OID, getDummyResourceObject());
// WHEN
modelService.executeChanges(MiscSchemaUtil.createCollection(unlinkDelta), null, task, result);
// THEN
assertSuccess(result);
PrismObject<UserType> userAfter = getUser(USER_GUYBRUSH_OID);
display("User after", userAfter);
assertUser(userAfter, USER_GUYBRUSH_OID, USER_GUYBRUSH_USERNAME, USER_GUYBRUSH_FULL_NAME, USER_GUYBRUSH_GIVEN_NAME, USER_GUYBRUSH_FAMILY_NAME);
assertAssignedAccount(userAfter, RESOURCE_DUMMY_ORANGE_OID);
assertAssignedNoRole(userAfter);
assertAssignments(userAfter, 1);
assertUser(userAfter, "after").assertLinks(1, 0);
DummyAccount dummyAccount = assertDummyAccount(RESOURCE_DUMMY_ORANGE_NAME, USER_GUYBRUSH_USERNAME, USER_GUYBRUSH_FULL_NAME, true);
displayDumpable("Orange account", dummyAccount);
guybrushShadowOrangeOid = getLiveLinkRefOid(userAfter, RESOURCE_DUMMY_ORANGE_OID);
PrismObject<ShadowType> shadowOrange = getShadowModel(guybrushShadowOrangeOid);
display("Orange shadow", shadowOrange);
}
Aggregations