Search in sources :

Example 1 with RepoModifyOptions

use of com.evolveum.midpoint.repo.api.RepoModifyOptions in project midpoint by Evolveum.

the class LookupTableTest method executeAndCheckModification.

protected void executeAndCheckModification(List<ItemDelta<?, ?>> modifications, OperationResult result, int versionDelta, List<String> keysWithGeneratedTimestamps, List<String> replacedKeys) throws ObjectNotFoundException, SchemaException, ObjectAlreadyExistsException, IOException {
    RepoModifyOptions modifyOptions = getModifyOptions();
    if (RepoModifyOptions.isExecuteIfNoChanges(modifyOptions) && versionDelta == 0) {
        versionDelta = 1;
    }
    PrismObject<LookupTableType> before = getFullTable(tableOid, result);
    repositoryService.modifyObject(LookupTableType.class, tableOid, modifications, modifyOptions, result);
    checkTable(tableOid, result, before, modifications, Integer.parseInt(before.getVersion()) + versionDelta, keysWithGeneratedTimestamps, replacedKeys);
}
Also used : RepoModifyOptions(com.evolveum.midpoint.repo.api.RepoModifyOptions) LookupTableType(com.evolveum.midpoint.xml.ns._public.common.common_3.LookupTableType)

Example 2 with RepoModifyOptions

use of com.evolveum.midpoint.repo.api.RepoModifyOptions in project midpoint by Evolveum.

the class CertificationTest method executeAndCheckModification.

protected void executeAndCheckModification(List<ItemDelta<?, ?>> modifications, OperationResult result, int versionDelta) throws ObjectNotFoundException, SchemaException, ObjectAlreadyExistsException, IOException {
    RepoModifyOptions modifyOptions = getModifyOptions();
    if (RepoModifyOptions.isExecuteIfNoChanges(modifyOptions) && versionDelta == 0) {
        versionDelta = 1;
    }
    PrismObject<AccessCertificationCampaignType> before = getFullCampaign(campaign1Oid, result);
    int expectedVersion = Integer.parseInt(before.getVersion()) + versionDelta;
    List<ItemDelta> savedModifications = (List) CloneUtil.cloneCollectionMembers(modifications);
    repositoryService.modifyObject(AccessCertificationCampaignType.class, campaign1Oid, modifications, modifyOptions, result);
    checkCampaign(campaign1Oid, result, before, savedModifications, expectedVersion);
}
Also used : RepoModifyOptions(com.evolveum.midpoint.repo.api.RepoModifyOptions) List(java.util.List) ArrayList(java.util.ArrayList) ItemDelta(com.evolveum.midpoint.prism.delta.ItemDelta)

Aggregations

RepoModifyOptions (com.evolveum.midpoint.repo.api.RepoModifyOptions)2 ItemDelta (com.evolveum.midpoint.prism.delta.ItemDelta)1 LookupTableType (com.evolveum.midpoint.xml.ns._public.common.common_3.LookupTableType)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1