use of com.evolveum.icf.dummy.resource.DummyAccount in project midpoint by Evolveum.
the class AbstractModelIntegrationTest method assertDummyAccountAttributeGenerated.
protected void assertDummyAccountAttributeGenerated(String dummyInstanceName, String username) throws SchemaViolationException, ConflictException {
DummyAccount account = getDummyAccount(dummyInstanceName, username);
assertNotNull("No dummy account for username " + username, account);
Integer generated = account.getAttributeValue(DummyAccount.ATTR_INTERNAL_ID, Integer.class);
if (generated == null) {
AssertJUnit.fail("No value in generated attribute dir of " + dummyInstanceName + " dummy account " + username);
}
}
use of com.evolveum.icf.dummy.resource.DummyAccount in project midpoint by Evolveum.
the class AbstractModelIntegrationTest method assertDummyPassword.
protected void assertDummyPassword(String instance, String userId, String expectedClearPassword) throws SchemaViolationException, ConflictException {
DummyAccount account = getDummyAccount(instance, userId);
assertNotNull("No dummy account " + userId, account);
assertEquals("Wrong password in dummy '" + instance + "' account " + userId, expectedClearPassword, account.getPassword());
}
use of com.evolveum.icf.dummy.resource.DummyAccount in project midpoint by Evolveum.
the class AbstractModelIntegrationTest method assertDummyAccount.
protected DummyAccount assertDummyAccount(String dummyInstanceName, String username, String fullname, Boolean active) throws SchemaViolationException, ConflictException {
DummyAccount account = getDummyAccount(dummyInstanceName, username);
assertNotNull("No dummy(" + dummyInstanceName + ") account for username " + username, account);
assertEquals("Wrong fullname for dummy(" + dummyInstanceName + ") account " + username, fullname, account.getAttributeValue("fullname"));
assertEquals("Wrong activation for dummy(" + dummyInstanceName + ") account " + username, active, account.isEnabled());
return account;
}
use of com.evolveum.icf.dummy.resource.DummyAccount in project midpoint by Evolveum.
the class AbstractModelIntegrationTest method assertDummyAccountActivation.
protected void assertDummyAccountActivation(String dummyInstanceName, String username, Boolean active) throws SchemaViolationException, ConflictException {
DummyAccount account = getDummyAccount(dummyInstanceName, username);
assertNotNull("No dummy(" + dummyInstanceName + ") account for username " + username, account);
assertEquals("Wrong activation for dummy(" + dummyInstanceName + ") account " + username, active, account.isEnabled());
}
use of com.evolveum.icf.dummy.resource.DummyAccount in project midpoint by Evolveum.
the class TestDummy method test232DetitleAccountWillPillage.
@Test
public void test232DetitleAccountWillPillage() throws Exception {
final String TEST_NAME = "test232DetitleAccountWillPillage";
TestUtil.displayTestTile(TEST_NAME);
Task task = createTask(TEST_NAME);
OperationResult result = task.getResult();
syncServiceMock.reset();
ObjectDelta<ShadowType> delta = IntegrationTestTools.createDetitleDelta(ACCOUNT_WILL_OID, ASSOCIATION_PRIV_NAME, PRIVILEGE_PILLAGE_OID, prismContext);
display("ObjectDelta", delta);
delta.checkConsistence();
// WHEN
provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result);
// THEN
result.computeStatus();
display("modifyObject result", result);
TestUtil.assertSuccess(result);
delta.checkConsistence();
DummyGroup group = getDummyGroupAssert(GROUP_PIRATES_NAME, piratesIcfUid);
assertNoMember(group, getWillRepoIcfName());
// Make sure that account is still there and it has the privilege
DummyAccount dummyAccount = getDummyAccountAssert(transformNameFromResource(ACCOUNT_WILL_USERNAME), willIcfUid);
assertNotNull("Account will is gone!", dummyAccount);
Set<String> accountProvileges = dummyAccount.getAttributeValues(DummyAccount.ATTR_PRIVILEGES_NAME, String.class);
PrismAsserts.assertSets("Wrong account privileges", accountProvileges, PRIVILEGE_BARGAIN_NAME, PRIVILEGE_NONSENSE_NAME);
// Make sure that privilege object is still there
DummyPrivilege priv = getDummyPrivilegeAssert(PRIVILEGE_PILLAGE_NAME, pillageIcfUid);
assertNotNull("Privilege object is gone!", priv);
syncServiceMock.assertNotifySuccessOnly();
PrismObject<ShadowType> shadow = provisioningService.getObject(ShadowType.class, ACCOUNT_WILL_OID, null, task, result);
display("Shadow after", shadow);
assertEntitlementPriv(shadow, PRIVILEGE_BARGAIN_OID);
assertSteadyResource();
}
Aggregations