Search in sources :

Example 1 with DummyAccount

use of com.evolveum.icf.dummy.resource.DummyAccount in project midpoint by Evolveum.

the class DummyConnector method removeAttributeValues.

/**
     * {@inheritDoc}
     */
public Uid removeAttributeValues(ObjectClass objectClass, Uid uid, Set<Attribute> valuesToRemove, OperationOptions options) {
    validate(objectClass);
    validate(uid);
    try {
        if (ObjectClass.ACCOUNT.is(objectClass.getObjectClassValue())) {
            DummyAccount account;
            if (configuration.getUidMode().equals(DummyConfiguration.UID_MODE_NAME)) {
                account = resource.getAccountByUsername(uid.getUidValue());
            } else if (configuration.getUidMode().equals(DummyConfiguration.UID_MODE_UUID)) {
                account = resource.getAccountById(uid.getUidValue());
            } else {
                throw new IllegalStateException("Unknown UID mode " + configuration.getUidMode());
            }
            if (account == null) {
                throw new UnknownUidException("Account with UID " + uid + " does not exist on resource");
            }
            for (Attribute attr : valuesToRemove) {
                if (attr.is(OperationalAttributeInfos.PASSWORD.getName())) {
                    throw new UnsupportedOperationException("Removing password value is not supported");
                } else if (attr.is(OperationalAttributes.ENABLE_NAME)) {
                    throw new IllegalArgumentException("Attempt to remove value from enable attribute");
                } else if (PredefinedAttributes.AUXILIARY_OBJECT_CLASS_NAME.equalsIgnoreCase(attr.getName())) {
                    account.deleteAuxiliaryObjectClassNames(attr.getValue());
                } else {
                    String name = attr.getName();
                    try {
                        account.removeAttributeValues(name, attr.getValue());
                        log.ok("Removed attribute {0} values {1} from {2}, resulting values: {3}", name, attr.getValue(), account, account.getAttributeValues(name, Object.class));
                    } catch (SchemaViolationException e) {
                        // The framework should deal with it ... somehow
                        throw new IllegalArgumentException(e.getMessage(), e);
                    }
                }
            }
        } else if (ObjectClass.GROUP.is(objectClass.getObjectClassValue())) {
            DummyGroup group;
            if (configuration.getUidMode().equals(DummyConfiguration.UID_MODE_NAME)) {
                group = resource.getGroupByName(uid.getUidValue());
            } else if (configuration.getUidMode().equals(DummyConfiguration.UID_MODE_UUID)) {
                group = resource.getGroupById(uid.getUidValue());
            } else {
                throw new IllegalStateException("Unknown UID mode " + configuration.getUidMode());
            }
            if (group == null) {
                throw new UnknownUidException("Group with UID " + uid + " does not exist on resource");
            }
            for (Attribute attr : valuesToRemove) {
                if (attr.is(OperationalAttributeInfos.PASSWORD.getName())) {
                    throw new IllegalArgumentException("Attempt to change password on group");
                } else if (attr.is(OperationalAttributes.ENABLE_NAME)) {
                    throw new IllegalArgumentException("Attempt to remove value from enable attribute");
                } else {
                    String name = attr.getName();
                    List<Object> values = attr.getValue();
                    if (attr.is(DummyGroup.ATTR_MEMBERS_NAME) && values != null && configuration.getUpCaseName()) {
                        List<Object> newValues = new ArrayList<Object>(values.size());
                        for (Object val : values) {
                            newValues.add(StringUtils.upperCase((String) val));
                        }
                        values = newValues;
                    }
                    try {
                        group.removeAttributeValues(name, values);
                        log.ok("Removed attribute {0} values {1} from {2}, resulting values: {3}", name, attr.getValue(), group, group.getAttributeValues(name, Object.class));
                    } catch (SchemaViolationException e) {
                        // The framework should deal with it ... somehow
                        throw new IllegalArgumentException(e.getMessage(), e);
                    }
                }
            }
        } else if (objectClass.is(OBJECTCLASS_PRIVILEGE_NAME)) {
            DummyPrivilege priv;
            if (configuration.getUidMode().equals(DummyConfiguration.UID_MODE_NAME)) {
                priv = resource.getPrivilegeByName(uid.getUidValue());
            } else if (configuration.getUidMode().equals(DummyConfiguration.UID_MODE_UUID)) {
                priv = resource.getPrivilegeById(uid.getUidValue());
            } else {
                throw new IllegalStateException("Unknown UID mode " + configuration.getUidMode());
            }
            if (priv == null) {
                throw new UnknownUidException("Privilege with UID " + uid + " does not exist on resource");
            }
            for (Attribute attr : valuesToRemove) {
                if (attr.is(OperationalAttributeInfos.PASSWORD.getName())) {
                    throw new IllegalArgumentException("Attempt to change password on privilege");
                } else if (attr.is(OperationalAttributes.ENABLE_NAME)) {
                    throw new IllegalArgumentException("Attempt to remove value from enable attribute");
                } else {
                    String name = attr.getName();
                    try {
                        priv.removeAttributeValues(name, attr.getValue());
                        log.ok("Removed attribute {0} values {1} from {2}, resulting values: {3}", name, attr.getValue(), priv, priv.getAttributeValues(name, Object.class));
                    } catch (SchemaViolationException e) {
                        // The framework should deal with it ... somehow
                        throw new IllegalArgumentException(e.getMessage(), e);
                    }
                }
            }
        } else if (objectClass.is(OBJECTCLASS_ORG_NAME)) {
            DummyOrg org;
            if (configuration.getUidMode().equals(DummyConfiguration.UID_MODE_NAME)) {
                org = resource.getOrgByName(uid.getUidValue());
            } else if (configuration.getUidMode().equals(DummyConfiguration.UID_MODE_UUID)) {
                org = resource.getOrgById(uid.getUidValue());
            } else {
                throw new IllegalStateException("Unknown UID mode " + configuration.getUidMode());
            }
            if (org == null) {
                throw new UnknownUidException("Org with UID " + uid + " does not exist on resource");
            }
            for (Attribute attr : valuesToRemove) {
                if (attr.is(OperationalAttributeInfos.PASSWORD.getName())) {
                    throw new IllegalArgumentException("Attempt to change password on org");
                } else if (attr.is(OperationalAttributes.ENABLE_NAME)) {
                    throw new IllegalArgumentException("Attempt to remove value from enable org");
                } else {
                    String name = attr.getName();
                    try {
                        org.removeAttributeValues(name, attr.getValue());
                        log.ok("Removed attribute {0} values {1} from {2}, resulting values: {3}", name, attr.getValue(), org, org.getAttributeValues(name, Object.class));
                    } catch (SchemaViolationException e) {
                        // The framework should deal with it ... somehow
                        throw new IllegalArgumentException(e.getMessage(), e);
                    }
                }
            }
        } else {
            throw new ConnectorException("Unknown object class " + objectClass);
        }
    } catch (ConnectException e) {
        log.info("removeAttributeValues::exception " + e);
        throw new ConnectionFailedException(e.getMessage(), e);
    } catch (FileNotFoundException e) {
        log.info("removeAttributeValues::exception " + e);
        throw new ConnectorIOException(e.getMessage(), e);
    } catch (SchemaViolationException e) {
        log.info("removeAttributeValues::exception " + e);
        throw new InvalidAttributeValueException(e.getMessage(), e);
    } catch (ConflictException e) {
        log.info("removeAttributeValues::exception " + e);
        throw new AlreadyExistsException(e);
    }
    return uid;
}
Also used : ConnectorIOException(org.identityconnectors.framework.common.exceptions.ConnectorIOException) AlreadyExistsException(org.identityconnectors.framework.common.exceptions.AlreadyExistsException) ObjectAlreadyExistsException(com.evolveum.icf.dummy.resource.ObjectAlreadyExistsException) ConflictException(com.evolveum.icf.dummy.resource.ConflictException) ArrayList(java.util.ArrayList) FileNotFoundException(java.io.FileNotFoundException) GuardedString(org.identityconnectors.common.security.GuardedString) InvalidAttributeValueException(org.identityconnectors.framework.common.exceptions.InvalidAttributeValueException) ConnectorException(org.identityconnectors.framework.common.exceptions.ConnectorException) DummyObject(com.evolveum.icf.dummy.resource.DummyObject) UnknownUidException(org.identityconnectors.framework.common.exceptions.UnknownUidException) SchemaViolationException(com.evolveum.icf.dummy.resource.SchemaViolationException) DummyPrivilege(com.evolveum.icf.dummy.resource.DummyPrivilege) DummyAccount(com.evolveum.icf.dummy.resource.DummyAccount) DummyOrg(com.evolveum.icf.dummy.resource.DummyOrg) ConnectionFailedException(org.identityconnectors.framework.common.exceptions.ConnectionFailedException) DummyGroup(com.evolveum.icf.dummy.resource.DummyGroup) ConnectException(java.net.ConnectException)

Example 2 with DummyAccount

use of com.evolveum.icf.dummy.resource.DummyAccount in project midpoint by Evolveum.

the class DummyConnector method sync.

/**
     * {@inheritDoc}
     */
public void sync(ObjectClass objectClass, SyncToken token, SyncResultsHandler handler, final OperationOptions options) {
    log.info("sync::begin");
    validate(objectClass);
    Collection<String> attributesToGet = getAttrsToGet(options);
    try {
        int syncToken = (Integer) token.getValue();
        List<DummyDelta> deltas = resource.getDeltasSince(syncToken);
        for (DummyDelta delta : deltas) {
            Class<? extends DummyObject> deltaObjectClass = delta.getObjectClass();
            if (objectClass.is(ObjectClass.ALL_NAME)) {
            // take all changes
            } else if (objectClass.is(ObjectClass.ACCOUNT_NAME)) {
                if (deltaObjectClass != DummyAccount.class) {
                    log.ok("Skipping delta {0} because of objectclass mismatch", delta);
                    continue;
                }
            } else if (objectClass.is(ObjectClass.GROUP_NAME)) {
                if (deltaObjectClass != DummyGroup.class) {
                    log.ok("Skipping delta {0} because of objectclass mismatch", delta);
                    continue;
                }
            }
            SyncDeltaBuilder deltaBuilder = new SyncDeltaBuilder();
            if (deltaObjectClass == DummyAccount.class) {
                deltaBuilder.setObjectClass(ObjectClass.ACCOUNT);
            } else if (deltaObjectClass == DummyGroup.class) {
                deltaBuilder.setObjectClass(ObjectClass.GROUP);
            } else if (deltaObjectClass == DummyPrivilege.class) {
                deltaBuilder.setObjectClass(new ObjectClass(OBJECTCLASS_PRIVILEGE_NAME));
            } else if (deltaObjectClass == DummyOrg.class) {
                deltaBuilder.setObjectClass(new ObjectClass(OBJECTCLASS_ORG_NAME));
            } else {
                throw new IllegalArgumentException("Unknown delta objectClass " + deltaObjectClass);
            }
            SyncDeltaType deltaType;
            if (delta.getType() == DummyDeltaType.ADD || delta.getType() == DummyDeltaType.MODIFY) {
                if (resource.getSyncStyle() == DummySyncStyle.DUMB) {
                    deltaType = SyncDeltaType.CREATE_OR_UPDATE;
                } else {
                    if (delta.getType() == DummyDeltaType.ADD) {
                        deltaType = SyncDeltaType.CREATE;
                    } else {
                        deltaType = SyncDeltaType.UPDATE;
                    }
                }
                if (deltaObjectClass == DummyAccount.class) {
                    DummyAccount account = resource.getAccountById(delta.getObjectId());
                    if (account == null) {
                        throw new IllegalStateException("We have delta for account '" + delta.getObjectId() + "' but such account does not exist");
                    }
                    ConnectorObject cobject = convertToConnectorObject(account, attributesToGet);
                    deltaBuilder.setObject(cobject);
                } else if (deltaObjectClass == DummyGroup.class) {
                    DummyGroup group = resource.getGroupById(delta.getObjectId());
                    if (group == null) {
                        throw new IllegalStateException("We have delta for group '" + delta.getObjectId() + "' but such group does not exist");
                    }
                    ConnectorObject cobject = convertToConnectorObject(group, attributesToGet);
                    deltaBuilder.setObject(cobject);
                } else if (deltaObjectClass == DummyPrivilege.class) {
                    DummyPrivilege privilege = resource.getPrivilegeById(delta.getObjectId());
                    if (privilege == null) {
                        throw new IllegalStateException("We have privilege for group '" + delta.getObjectId() + "' but such privilege does not exist");
                    }
                    ConnectorObject cobject = convertToConnectorObject(privilege, attributesToGet);
                    deltaBuilder.setObject(cobject);
                } else {
                    throw new IllegalArgumentException("Unknown delta objectClass " + deltaObjectClass);
                }
            } else if (delta.getType() == DummyDeltaType.DELETE) {
                deltaType = SyncDeltaType.DELETE;
            } else {
                throw new IllegalStateException("Unknown delta type " + delta.getType());
            }
            deltaBuilder.setDeltaType(deltaType);
            deltaBuilder.setToken(new SyncToken(delta.getSyncToken()));
            Uid uid;
            if (configuration.getUidMode().equals(DummyConfiguration.UID_MODE_NAME)) {
                uid = new Uid(delta.getObjectName());
            } else if (configuration.getUidMode().equals(DummyConfiguration.UID_MODE_UUID)) {
                if (nameHintChecksEnabled()) {
                    uid = new Uid(delta.getObjectId(), new Name(delta.getObjectName()));
                } else {
                    uid = new Uid(delta.getObjectId());
                }
            } else {
                throw new IllegalStateException("Unknown UID mode " + configuration.getUidMode());
            }
            deltaBuilder.setUid(uid);
            SyncDelta syncDelta = deltaBuilder.build();
            log.info("sync::handle {0}", syncDelta);
            handler.handle(syncDelta);
        }
    } catch (ConnectException e) {
        log.info("sync::exception " + e);
        throw new ConnectionFailedException(e.getMessage(), e);
    } catch (FileNotFoundException e) {
        log.info("sync::exception " + e);
        throw new ConnectorIOException(e.getMessage(), e);
    } catch (SchemaViolationException e) {
        log.info("sync::exception " + e);
        throw new InvalidAttributeValueException(e.getMessage(), e);
    } catch (ConflictException e) {
        log.info("sync::exception " + e);
        throw new AlreadyExistsException(e);
    }
    log.info("sync::end");
}
Also used : ConflictException(com.evolveum.icf.dummy.resource.ConflictException) DummyDelta(com.evolveum.icf.dummy.resource.DummyDelta) FileNotFoundException(java.io.FileNotFoundException) GuardedString(org.identityconnectors.common.security.GuardedString) SchemaViolationException(com.evolveum.icf.dummy.resource.SchemaViolationException) DummyAccount(com.evolveum.icf.dummy.resource.DummyAccount) DummyGroup(com.evolveum.icf.dummy.resource.DummyGroup) ConnectException(java.net.ConnectException) ConnectorIOException(org.identityconnectors.framework.common.exceptions.ConnectorIOException) DummyObjectClass(com.evolveum.icf.dummy.resource.DummyObjectClass) AlreadyExistsException(org.identityconnectors.framework.common.exceptions.AlreadyExistsException) ObjectAlreadyExistsException(com.evolveum.icf.dummy.resource.ObjectAlreadyExistsException) InvalidAttributeValueException(org.identityconnectors.framework.common.exceptions.InvalidAttributeValueException) DummyPrivilege(com.evolveum.icf.dummy.resource.DummyPrivilege) DummyOrg(com.evolveum.icf.dummy.resource.DummyOrg) ConnectionFailedException(org.identityconnectors.framework.common.exceptions.ConnectionFailedException)

Example 3 with DummyAccount

use of com.evolveum.icf.dummy.resource.DummyAccount in project midpoint by Evolveum.

the class TestMapping method test214ModifyUserLocalityIOError.

/**
	 * MID-3661
	 */
@Test
public void test214ModifyUserLocalityIOError() throws Exception {
    final String TEST_NAME = "test214ModifyUserLocalityIOError";
    TestUtil.displayTestTile(this, TEST_NAME);
    // GIVEN
    Task task = taskManager.createTaskInstance(TestMapping.class.getName() + "." + TEST_NAME);
    OperationResult result = task.getResult();
    getDummyResource(RESOURCE_DUMMY_CRIMSON_NAME).resetBreakMode();
    DummyAccount dummyAccountBefore = getDummyAccount(RESOURCE_DUMMY_CRIMSON_NAME, ACCOUNT_GUYBRUSH_DUMMY_USERNAME);
    display("Dummy account before", dummyAccountBefore);
    // Make sure that only get is broken and not modify. We want to give the test
    // a chance to destroy data.
    getDummyResource(RESOURCE_DUMMY_CRIMSON_NAME).setGetBreakMode(BreakMode.IO);
    // WHEN
    TestUtil.displayWhen(TEST_NAME);
    modifyUserReplace(USER_GUYBRUSH_OID, UserType.F_LOCALITY, task, result, createPolyString("Booty Island"));
    // THEN
    TestUtil.displayThen(TEST_NAME);
    result.computeStatus();
    TestUtil.assertSuccess("executeChanges result", result);
    getDummyResource(RESOURCE_DUMMY_CRIMSON_NAME).resetBreakMode();
    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);
    String accountOid = getSingleLinkOid(userAfter);
    PrismObject<ShadowType> repoShadow = repositoryService.getObject(ShadowType.class, accountOid, null, result);
    display("Repo shadow after", repoShadow);
    assertNoPostponedOperation(repoShadow);
    // Check account in dummy resource
    DummyAccount dummyAccountAfter = assertDummyAccount(RESOURCE_DUMMY_CRIMSON_NAME, ACCOUNT_GUYBRUSH_DUMMY_USERNAME, ACCOUNT_GUYBRUSH_DUMMY_FULLNAME, true);
    display("Dummy account after", dummyAccountAfter);
    // TODO: How? Why?
    assertDummyAccountAttribute(RESOURCE_DUMMY_CRIMSON_NAME, ACCOUNT_GUYBRUSH_DUMMY_USERNAME, DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_LOCATION_NAME, "Booty Island");
    assertDummyAccountAttribute(RESOURCE_DUMMY_CRIMSON_NAME, ACCOUNT_GUYBRUSH_DUMMY_USERNAME, DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_DRINK_NAME, "vodka", "whisky", "rum from Scabb Island");
}
Also used : Task(com.evolveum.midpoint.task.api.Task) ShadowType(com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) DummyAccount(com.evolveum.icf.dummy.resource.DummyAccount) UserType(com.evolveum.midpoint.xml.ns._public.common.common_3.UserType) Test(org.testng.annotations.Test)

Example 4 with DummyAccount

use of com.evolveum.icf.dummy.resource.DummyAccount in project midpoint by Evolveum.

the class TestMapping method test212ModifyUserLocalityRecon.

/**
	 * MID-3661
	 */
@Test
public void test212ModifyUserLocalityRecon() throws Exception {
    final String TEST_NAME = "test212ModifyUserLocalityRecon";
    TestUtil.displayTestTile(this, TEST_NAME);
    // GIVEN
    Task task = taskManager.createTaskInstance(TestMapping.class.getName() + "." + TEST_NAME);
    OperationResult result = task.getResult();
    getDummyResource(RESOURCE_DUMMY_CRIMSON_NAME).resetBreakMode();
    DummyAccount dummyAccountBefore = getDummyAccount(RESOURCE_DUMMY_CRIMSON_NAME, ACCOUNT_GUYBRUSH_DUMMY_USERNAME);
    display("Dummy account before", dummyAccountBefore);
    // WHEN
    TestUtil.displayWhen(TEST_NAME);
    ObjectDelta<UserType> objectDelta = createModifyUserReplaceDelta(USER_GUYBRUSH_OID, new ItemPath(UserType.F_LOCALITY), PrismTestUtil.createPolyString("Scabb Island"));
    Collection<ObjectDelta<? extends ObjectType>> deltas = MiscSchemaUtil.createCollection(objectDelta);
    ModelExecuteOptions options = ModelExecuteOptions.createReconcile();
    modelService.executeChanges(deltas, options, task, result);
    // THEN
    TestUtil.displayThen(TEST_NAME);
    result.computeStatus();
    TestUtil.assertSuccess("executeChanges result", 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);
    String accountOid = getSingleLinkOid(userAfter);
    PrismObject<ShadowType> repoShadow = repositoryService.getObject(ShadowType.class, accountOid, null, result);
    display("Repo shadow after", repoShadow);
    assertNoPostponedOperation(repoShadow);
    // Check account in dummy resource
    DummyAccount dummyAccountAfter = assertDummyAccount(RESOURCE_DUMMY_CRIMSON_NAME, ACCOUNT_GUYBRUSH_DUMMY_USERNAME, ACCOUNT_GUYBRUSH_DUMMY_FULLNAME, true);
    display("Dummy account after", dummyAccountAfter);
    assertDummyAccountAttribute(RESOURCE_DUMMY_CRIMSON_NAME, ACCOUNT_GUYBRUSH_DUMMY_USERNAME, DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_LOCATION_NAME, "Scabb Island");
    assertDummyAccountAttribute(RESOURCE_DUMMY_CRIMSON_NAME, ACCOUNT_GUYBRUSH_DUMMY_USERNAME, DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_DRINK_NAME, "vodka", "whisky", "rum from Scabb Island");
}
Also used : Task(com.evolveum.midpoint.task.api.Task) ShadowType(com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType) ModelExecuteOptions(com.evolveum.midpoint.model.api.ModelExecuteOptions) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) ObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType) ObjectDelta(com.evolveum.midpoint.prism.delta.ObjectDelta) DummyAccount(com.evolveum.icf.dummy.resource.DummyAccount) UserType(com.evolveum.midpoint.xml.ns._public.common.common_3.UserType) ItemPath(com.evolveum.midpoint.prism.path.ItemPath) Test(org.testng.annotations.Test)

Example 5 with DummyAccount

use of com.evolveum.icf.dummy.resource.DummyAccount in project midpoint by Evolveum.

the class TestMapping method test204DummyCrimsonReconcile.

/**
	 * Just make sure that plain recon does not destroy anything.
	 * MID-3661
	 */
@Test
public void test204DummyCrimsonReconcile() throws Exception {
    final String TEST_NAME = "test204DummyCrimsonReconcile";
    TestUtil.displayTestTile(this, TEST_NAME);
    // GIVEN
    Task task = taskManager.createTaskInstance(TestMapping.class.getName() + "." + TEST_NAME);
    OperationResult result = task.getResult();
    DummyAccount dummyAccountBefore = getDummyAccount(RESOURCE_DUMMY_CRIMSON_NAME, ACCOUNT_GUYBRUSH_DUMMY_USERNAME);
    display("Dummy account before", dummyAccountBefore);
    // WHEN
    TestUtil.displayWhen(TEST_NAME);
    reconcileUser(USER_GUYBRUSH_OID, task, result);
    // THEN
    TestUtil.displayThen(TEST_NAME);
    result.computeStatus();
    TestUtil.assertSuccess("executeChanges result", 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);
    String accountOid = getSingleLinkOid(userAfter);
    PrismObject<ShadowType> repoShadow = repositoryService.getObject(ShadowType.class, accountOid, null, result);
    display("Repo shadow after", repoShadow);
    assertNoPostponedOperation(repoShadow);
    // Check account in dummy resource
    DummyAccount dummyAccountAfter = assertDummyAccount(RESOURCE_DUMMY_CRIMSON_NAME, ACCOUNT_GUYBRUSH_DUMMY_USERNAME, ACCOUNT_GUYBRUSH_DUMMY_FULLNAME, true);
    display("Dummy account after", dummyAccountAfter);
    assertDummyAccountAttribute(RESOURCE_DUMMY_CRIMSON_NAME, ACCOUNT_GUYBRUSH_DUMMY_USERNAME, DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_LOCATION_NAME, ACCOUNT_GUYBRUSH_DUMMY_LOCATION);
    assertDummyAccountAttribute(RESOURCE_DUMMY_CRIMSON_NAME, ACCOUNT_GUYBRUSH_DUMMY_USERNAME, DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_DRINK_NAME, "vodka", "whisky", "rum from Melee Island");
}
Also used : Task(com.evolveum.midpoint.task.api.Task) ShadowType(com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) DummyAccount(com.evolveum.icf.dummy.resource.DummyAccount) UserType(com.evolveum.midpoint.xml.ns._public.common.common_3.UserType) Test(org.testng.annotations.Test)

Aggregations

DummyAccount (com.evolveum.icf.dummy.resource.DummyAccount)261 Test (org.testng.annotations.Test)211 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)158 Task (com.evolveum.midpoint.task.api.Task)152 AbstractInitializedModelIntegrationTest (com.evolveum.midpoint.model.intest.AbstractInitializedModelIntegrationTest)40 ShadowType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)40 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)24 DummyGroup (com.evolveum.icf.dummy.resource.DummyGroup)20 PrismObject (com.evolveum.midpoint.prism.PrismObject)19 ArrayList (java.util.ArrayList)19 OperationProvisioningScriptsType (com.evolveum.midpoint.xml.ns._public.common.common_3.OperationProvisioningScriptsType)18 PolyString (com.evolveum.midpoint.prism.polystring.PolyString)16 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)14 XMLGregorianCalendar (javax.xml.datatype.XMLGregorianCalendar)14 DummyPrivilege (com.evolveum.icf.dummy.resource.DummyPrivilege)12 AbstractInternalModelIntegrationTest (com.evolveum.midpoint.model.impl.AbstractInternalModelIntegrationTest)12 SchemaViolationException (com.evolveum.icf.dummy.resource.SchemaViolationException)10 QName (javax.xml.namespace.QName)10 ConflictException (com.evolveum.icf.dummy.resource.ConflictException)9 DummyOrg (com.evolveum.icf.dummy.resource.DummyOrg)9