diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/ObjectWrapper.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/ObjectWrapper.java index d97cee24f8e..22641cff6e0 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/ObjectWrapper.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/prism/ObjectWrapper.java @@ -667,7 +667,7 @@ private ObjectDelta createAddingObjectDelta() throws SchemaException { Collections.sort(containers, new ItemWrapperComparator()); if (InternalsConfig.consistencyChecks) { - delta.checkConsistence(true, true, true); + delta.checkConsistence(true, true, true, ConsistencyCheckScope.THOROUGH); } return delta; diff --git a/infra/common/src/test/java/com/evolveum/midpoint/common/refinery/TestRefinedSchema.java b/infra/common/src/test/java/com/evolveum/midpoint/common/refinery/TestRefinedSchema.java index 12b4723ae4f..c979d5e9d84 100644 --- a/infra/common/src/test/java/com/evolveum/midpoint/common/refinery/TestRefinedSchema.java +++ b/infra/common/src/test/java/com/evolveum/midpoint/common/refinery/TestRefinedSchema.java @@ -31,6 +31,7 @@ import javax.xml.bind.JAXBException; import javax.xml.namespace.QName; +import com.evolveum.midpoint.prism.ConsistencyCheckScope; import com.evolveum.midpoint.prism.util.PrismTestUtil; import org.testng.Assert; @@ -356,7 +357,7 @@ private void assertAccountShadow(PrismObject accObject, PrismObject< String accString = PrismTestUtil.serializeObjectToString(accObjectType.asPrismObject()); System.out.println("Result of JAXB marshalling:\n"+accString); - accObject.checkConsistence(true, true); + accObject.checkConsistence(true, true, ConsistencyCheckScope.THOROUGH); } private QName getAttrQName(PrismObject resource, String localPart) { diff --git a/infra/prism/src/main/java/com/evolveum/midpoint/prism/ConsistencyCheckScope.java b/infra/prism/src/main/java/com/evolveum/midpoint/prism/ConsistencyCheckScope.java index 07b57f4a4b3..be5a232e98f 100644 --- a/infra/prism/src/main/java/com/evolveum/midpoint/prism/ConsistencyCheckScope.java +++ b/infra/prism/src/main/java/com/evolveum/midpoint/prism/ConsistencyCheckScope.java @@ -1,16 +1,40 @@ package com.evolveum.midpoint.prism; +import com.evolveum.midpoint.prism.delta.ObjectDelta; + +import java.util.Collection; + /** * Determines the scope of consistency checks. - * (Originally this was a boolean, but there are many methods with N boolean arguments, so it was - * too easy to mix them up.) + * + * (Originally this was a boolean, but there are many 'checkConsistence'-style methods with a set of boolean arguments, + * so it was too easy to mix them up with this new one.) * * @author mederly */ public enum ConsistencyCheckScope { - THOROUGH, MANDATORY_CHECKS_ONLY; + /** + * Full-scale checks. + */ + THOROUGH, + /** + * Mandatory checks, e.g. checks for duplicate container IDs (see MID-1951). + * Should be rather quick. + * + * TODO Current solution is not that optimal. We should distinguish between checks that deal with midPoint internal workings + * (throwing IllegalArgumentException/IllegalStateException on failure), which can be turned off, as it is today. Another set + * of checks should be applied only on users' inputs (when importing data, when accepting inputs via SOAP/REST/whathever interfaces, ...) + * - and these should throw perhaps SchemaException that can be caught and handled appropriately. + * + * However, for the time being we consider this approach (i.e. that both kinds of checks are implemented the same way) to be an acceptable one. + */ + MANDATORY_CHECKS_ONLY; public boolean isThorough() { return this == THOROUGH; } + + public static ConsistencyCheckScope fromBoolean(boolean consistencyChecksSwitchValue) { + return consistencyChecksSwitchValue ? THOROUGH : MANDATORY_CHECKS_ONLY; + } } diff --git a/infra/prism/src/main/java/com/evolveum/midpoint/prism/Item.java b/infra/prism/src/main/java/com/evolveum/midpoint/prism/Item.java index aefdeb463a5..80b37100906 100644 --- a/infra/prism/src/main/java/com/evolveum/midpoint/prism/Item.java +++ b/infra/prism/src/main/java/com/evolveum/midpoint/prism/Item.java @@ -620,7 +620,11 @@ public static T createNewDefinitionlessItem(QName name, Class deltas, ConsistencyCheckScope scope) { + public static void checkConsistence(Collection deltas) { + checkConsistence(deltas, ConsistencyCheckScope.THOROUGH); + } + + public static void checkConsistence(Collection deltas, ConsistencyCheckScope scope) { checkConsistence(deltas, false, false, scope); } diff --git a/infra/prism/src/main/java/com/evolveum/midpoint/prism/delta/ObjectDelta.java b/infra/prism/src/main/java/com/evolveum/midpoint/prism/delta/ObjectDelta.java index c50f3f5373b..78157963ea0 100644 --- a/infra/prism/src/main/java/com/evolveum/midpoint/prism/delta/ObjectDelta.java +++ b/infra/prism/src/main/java/com/evolveum/midpoint/prism/delta/ObjectDelta.java @@ -1145,7 +1145,15 @@ public static ObjectDelta createDeleteDelta(Class t } public void checkConsistence() { - checkConsistence(true, false, false, ConsistencyCheckScope.THOROUGH); + checkConsistence(ConsistencyCheckScope.THOROUGH); + } + + public void checkConsistence(ConsistencyCheckScope scope) { + checkConsistence(true, false, false, scope); + } + + public void checkConsistence(boolean requireOid, boolean requireDefinition, boolean prohibitRaw) { + checkConsistence(requireOid, requireDefinition, prohibitRaw, ConsistencyCheckScope.THOROUGH); } public void checkConsistence(boolean requireOid, boolean requireDefinition, boolean prohibitRaw, ConsistencyCheckScope scope) { diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ModelCrudService.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ModelCrudService.java index f53b009be45..d15d1c2f352 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ModelCrudService.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/ModelCrudService.java @@ -21,6 +21,7 @@ import javax.xml.namespace.QName; +import com.evolveum.midpoint.prism.ConsistencyCheckScope; import com.evolveum.midpoint.prism.crypto.Protector; import org.apache.commons.lang.StringUtils; @@ -452,7 +453,7 @@ public void modifyObject(Class type, String oid, return; } - ItemDelta.checkConsistence(modifications); + ItemDelta.checkConsistence(modifications, ConsistencyCheckScope.THOROUGH); // TODO: check definitions, but tolerate missing definitions in OperationResult result = parentResult.createSubresult(MODIFY_OBJECT); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelController.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelController.java index 74f4b5c74a0..7ec2ffa5dc9 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelController.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/controller/ModelController.java @@ -35,6 +35,7 @@ import com.evolveum.midpoint.model.api.hooks.ReadHook; import com.evolveum.midpoint.model.impl.scripting.ExecutionContext; import com.evolveum.midpoint.model.impl.scripting.ScriptingExpressionEvaluator; +import com.evolveum.midpoint.prism.ConsistencyCheckScope; import com.evolveum.midpoint.prism.parser.XNodeSerializer; import com.evolveum.midpoint.prism.polystring.PolyString; import com.evolveum.midpoint.wf.api.WorkflowManager; @@ -1622,7 +1623,7 @@ private void validateObject(PrismObject object, GetOpe tolerateRaw = true; } } - object.checkConsistence(true, !tolerateRaw); + object.checkConsistence(true, !tolerateRaw, ConsistencyCheckScope.THOROUGH); } catch (RuntimeException e) { result.recordFatalError(e); throw e; diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/importer/ObjectImporter.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/importer/ObjectImporter.java index e082e070cb1..3fcb6c5856f 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/importer/ObjectImporter.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/importer/ObjectImporter.java @@ -444,7 +444,7 @@ protected void validateWithDynamicSchemas(PrismObject // now we check for raw data - their presence means e.g. that there is a connector property that is unknown in connector schema (applyDefinition does not scream in such a case!) try { - configurationContainer.checkConsistence(true, true); // require definitions and prohibit raw + configurationContainer.checkConsistence(true, true, ConsistencyCheckScope.THOROUGH); // require definitions and prohibit raw } catch (IllegalStateException e) { // TODO do this error checking and reporting in a cleaner and more user-friendly way result.recordFatalError("Configuration error in " + resource + " (probably incorrect connector property, see the following error): " + e.getMessage(), e); diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/ChangeExecutor.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/ChangeExecutor.java index f4fe52cf74d..4e5d188c8b5 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/ChangeExecutor.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/ChangeExecutor.java @@ -31,6 +31,7 @@ import com.evolveum.midpoint.model.common.expression.ExpressionFactory; import com.evolveum.midpoint.model.common.expression.ExpressionVariables; import com.evolveum.midpoint.model.impl.util.Utils; +import com.evolveum.midpoint.prism.ConsistencyCheckScope; import com.evolveum.midpoint.prism.PrismContext; import com.evolveum.midpoint.prism.PrismObject; import com.evolveum.midpoint.prism.PrismObjectDefinition; @@ -588,7 +589,7 @@ void executeDelta(ObjectDelta objectDelta, LensElementContext objectContex return; } - if (consistencyChecks) objectDelta.checkConsistence(); + objectDelta.checkConsistence(ConsistencyCheckScope.fromBoolean(consistencyChecks)); // Other types than focus types may not be definition-complete (e.g. accounts and resources are completed in provisioning) if (FocusType.class.isAssignableFrom(objectDelta.getObjectTypeClass())) { diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/ContextFactory.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/ContextFactory.java index 6a06a365c0b..70f7e24d59a 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/ContextFactory.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/ContextFactory.java @@ -18,6 +18,7 @@ import java.util.ArrayList; import java.util.Collection; +import com.evolveum.midpoint.prism.ConsistencyCheckScope; import org.apache.commons.lang.Validate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -86,8 +87,10 @@ public LensContext createContext( } if (InternalsConfig.consistencyChecks) { // Focus delta has to be complete now with all the definition already in place - delta.checkConsistence(false, true, true); - } + delta.checkConsistence(false, true, true, ConsistencyCheckScope.THOROUGH); + } else { + delta.checkConsistence(ConsistencyCheckScope.MANDATORY_CHECKS_ONLY); // TODO is this necessary? Perhaps it would be sufficient to check on model/repo entry + } if (focusDelta != null) { throw new IllegalStateException("More than one focus delta used in model operation"); } diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/LensElementContext.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/LensElementContext.java index f0af08036c3..0cdd707f3df 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/LensElementContext.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/LensElementContext.java @@ -18,6 +18,7 @@ import java.util.ArrayList; import java.util.List; +import com.evolveum.midpoint.prism.ConsistencyCheckScope; import com.evolveum.midpoint.prism.Objectable; import com.evolveum.midpoint.schema.DeltaConvertor; import com.evolveum.midpoint.schema.result.OperationResult; @@ -414,7 +415,7 @@ public void checkConsistence(String contextDesc) { private void checkConsistence(ObjectDelta delta, boolean requireOid, String contextDesc) { try { - delta.checkConsistence(requireOid, true, true); + delta.checkConsistence(requireOid, true, true, ConsistencyCheckScope.THOROUGH); } catch (IllegalArgumentException e) { throw new IllegalArgumentException(e.getMessage()+"; in "+contextDesc, e); } catch (IllegalStateException e) { @@ -432,7 +433,7 @@ protected boolean isRequireSecondardyDeltaOid() { protected void checkConsistence(PrismObject object, String elementDesc, String contextDesc) { String desc = elementDesc+" in "+this + (contextDesc == null ? "" : " in " +contextDesc); try { - object.checkConsistence(true); + object.checkConsistence(true, ConsistencyCheckScope.THOROUGH); } catch (IllegalArgumentException e) { throw new IllegalArgumentException(e.getMessage()+"; in "+desc, e); } catch (IllegalStateException e) { diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/LensProjectionContext.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/LensProjectionContext.java index c7f53d5dd3c..1786c736265 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/LensProjectionContext.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/LensProjectionContext.java @@ -751,7 +751,7 @@ public void checkConsistence(String contextDesc, boolean fresh, boolean force) { } if (syncDelta != null) { try { - syncDelta.checkConsistence(true, true, true); + syncDelta.checkConsistence(true, true, true, ConsistencyCheckScope.THOROUGH); } catch (IllegalArgumentException e) { throw new IllegalArgumentException(e.getMessage()+"; in "+getElementDesc()+" sync delta in "+this + (contextDesc == null ? "" : " in " +contextDesc), e); } catch (IllegalStateException e) { diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/ObjectDeltaWaves.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/ObjectDeltaWaves.java index 9a3eab965f2..ed917b2a202 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/ObjectDeltaWaves.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/lens/ObjectDeltaWaves.java @@ -16,6 +16,7 @@ package com.evolveum.midpoint.model.impl.lens; import com.evolveum.midpoint.common.crypto.CryptoUtil; +import com.evolveum.midpoint.prism.ConsistencyCheckScope; import com.evolveum.midpoint.prism.PrismContext; import com.evolveum.midpoint.prism.delta.ObjectDelta; import com.evolveum.midpoint.schema.DeltaConvertor; @@ -86,7 +87,7 @@ public void checkConsistence(boolean requireOid, String shortDesc) { continue; } try { - delta.checkConsistence(requireOid, true, true); + delta.checkConsistence(requireOid, true, true, ConsistencyCheckScope.THOROUGH); } catch (IllegalArgumentException e) { throw new IllegalArgumentException(e.getMessage()+"; in "+shortDesc+", wave "+wave, e); } catch (IllegalStateException e) { diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestModelServiceContract.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestModelServiceContract.java index 00982aa9367..477c49a4161 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestModelServiceContract.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestModelServiceContract.java @@ -35,6 +35,7 @@ import com.evolveum.icf.dummy.resource.BreakMode; import com.evolveum.midpoint.notifications.api.transports.Message; +import com.evolveum.midpoint.prism.ConsistencyCheckScope; import com.evolveum.midpoint.prism.delta.PropertyDelta; import com.evolveum.midpoint.prism.match.PolyStringOrigMatchingRule; import com.evolveum.midpoint.prism.query.EqualFilter; @@ -175,7 +176,7 @@ public void test051GetUserBarbossa() throws Exception { result.computeStatus(); TestUtil.assertSuccess("getObject result", result); - userBarbossa.checkConsistence(true, true); + userBarbossa.checkConsistence(true, true, ConsistencyCheckScope.THOROUGH); assertSteadyResources(); } @@ -361,7 +362,7 @@ public void test101GetAccount() throws Exception { result.computeStatus(); TestUtil.assertSuccess("getObject result", result); - account.checkConsistence(true, true); + account.checkConsistence(true, true, ConsistencyCheckScope.THOROUGH); IntegrationTestTools.assertAttribute(account, getAttributeQName(resourceDummy, DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_TITLE_NAME), "The best pirate captain ever"); diff --git a/repo/repo-sql-impl-test/src/test/java/com/evolveum/midpoint/repo/sql/AddGetObjectTest.java b/repo/repo-sql-impl-test/src/test/java/com/evolveum/midpoint/repo/sql/AddGetObjectTest.java index 2b7527eda83..2cdd2b1d814 100644 --- a/repo/repo-sql-impl-test/src/test/java/com/evolveum/midpoint/repo/sql/AddGetObjectTest.java +++ b/repo/repo-sql-impl-test/src/test/java/com/evolveum/midpoint/repo/sql/AddGetObjectTest.java @@ -575,19 +575,19 @@ public void test100AddUserWithoutAssignmentIds() throws Exception { @Test public void test110AddUserWithDuplicateAssignmentIds() throws Exception { OperationResult result = new OperationResult("test110AddUserWithDuplicateAssignmentIds"); - PrismObject user = PrismTestUtil.parseObject(new File(FOLDER_BASIC, "user-big.xml")); + PrismObject user = PrismTestUtil.parseObject(new File(FOLDER_BASIC, "user-same-ids.xml")); //create duplicate ids in assignment values PrismContainer container = user.findContainer(UserType.F_ASSIGNMENT); List values = (List) container.getValues(); - values.get(0).setId(999L); - values.get(0).setId(999L); + values.get(0).setId(999L); // setting it manually because object with duplicate IDs could not be parsed at all + values.get(1).setId(999L); try { String OID = repositoryService.addObject(user, null, result); throw new AssertionError("Two container values with the same ID were accepted even they shouldn't be"); - } catch (SchemaException e) { + } catch (RuntimeException e) { // this was expected - } catch (Throwable e) { + } catch (Exception e) { throw new AssertionError("Two container values with the same ID resulted in unexpected exception", e); } } diff --git a/repo/repo-sql-impl-test/src/test/resources/basic/user-same-ids.xml b/repo/repo-sql-impl-test/src/test/resources/basic/user-same-ids.xml new file mode 100644 index 00000000000..a166e39b19c --- /dev/null +++ b/repo/repo-sql-impl-test/src/test/resources/basic/user-same-ids.xml @@ -0,0 +1,75 @@ + + + + + + testuserX123aaa + testuserx123aaa + + Some description for userx123aaa + + + 2013-09-03T14:07:56.385+02:00 + + http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#user + + + + 2013-09-03T14:07:56.385+02:00 + + http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#user + + + assignment ship name extension + + + + + + + + 2013-09-03T14:07:56.385+02:00 + + http://midpoint.evolveum.com/xml/ns/public/gui/channels-3#user + + + + + + + enabled + enabled + 2013-05-21T14:57:50.759+02:00 + 2015-12-31T22:59:00.000+01:00 + + + Test UserX123aaa + test userx123aaa + + + TestX + testx + + + UserX123 + userx123 + + diff --git a/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/SqlRepositoryServiceImpl.java b/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/SqlRepositoryServiceImpl.java index 48559e4b31b..7a8d633b278 100644 --- a/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/SqlRepositoryServiceImpl.java +++ b/repo/repo-sql-impl/src/main/java/com/evolveum/midpoint/repo/sql/SqlRepositoryServiceImpl.java @@ -422,9 +422,9 @@ public String addObject(PrismObject object, RepoAddOpt } if (InternalsConfig.consistencyChecks) { - object.checkConsistence(); + object.checkConsistence(ConsistencyCheckScope.THOROUGH); } else { - object.checkConsistenceMandatory(); + object.checkConsistence(ConsistencyCheckScope.MANDATORY_CHECKS_ONLY); } if (LOGGER.isTraceEnabled()) { @@ -1117,9 +1117,9 @@ public void modifyObject(Class type, String oid, } if (InternalsConfig.consistencyChecks) { - for (ItemDelta modification : modifications) { - modification.checkConsistence(); - } + ItemDelta.checkConsistence(modifications, ConsistencyCheckScope.THOROUGH); + } else { + ItemDelta.checkConsistence(modifications, ConsistencyCheckScope.MANDATORY_CHECKS_ONLY); } if (LOGGER.isTraceEnabled()) { diff --git a/repo/repo-test-util/src/main/java/com/evolveum/midpoint/test/AbstractIntegrationTest.java b/repo/repo-test-util/src/main/java/com/evolveum/midpoint/test/AbstractIntegrationTest.java index cbd93c0838f..ce06b7851ac 100644 --- a/repo/repo-test-util/src/main/java/com/evolveum/midpoint/test/AbstractIntegrationTest.java +++ b/repo/repo-test-util/src/main/java/com/evolveum/midpoint/test/AbstractIntegrationTest.java @@ -27,6 +27,7 @@ import com.evolveum.midpoint.common.refinery.RefinedAttributeDefinition; import com.evolveum.midpoint.common.refinery.RefinedObjectClassDefinition; import com.evolveum.midpoint.common.refinery.RefinedResourceSchema; +import com.evolveum.midpoint.prism.ConsistencyCheckScope; import com.evolveum.midpoint.prism.Containerable; import com.evolveum.midpoint.prism.Item; import com.evolveum.midpoint.prism.PrismContainer; @@ -482,7 +483,7 @@ protected void assertShadow(PrismObject shadow) { } protected void assertObject(PrismObject object) { - object.checkConsistence(true, true); + object.checkConsistence(true, true, ConsistencyCheckScope.THOROUGH); assertTrue("Incomplete definition in "+object, object.hasCompleteDefinition()); assertFalse("No OID", StringUtils.isEmpty(object.getOid())); assertNotNull("Null name in "+object, object.asObjectable().getName()); diff --git a/repo/repo-test-util/src/main/java/com/evolveum/midpoint/test/IntegrationTestTools.java b/repo/repo-test-util/src/main/java/com/evolveum/midpoint/test/IntegrationTestTools.java index 4dff182f372..64e8e293e55 100644 --- a/repo/repo-test-util/src/main/java/com/evolveum/midpoint/test/IntegrationTestTools.java +++ b/repo/repo-test-util/src/main/java/com/evolveum/midpoint/test/IntegrationTestTools.java @@ -18,6 +18,7 @@ import com.evolveum.icf.dummy.resource.DummyGroup; import com.evolveum.icf.dummy.resource.ScriptHistoryEntry; import com.evolveum.midpoint.common.refinery.RefinedResourceSchema; +import com.evolveum.midpoint.prism.ConsistencyCheckScope; import com.evolveum.midpoint.prism.PrismContainer; import com.evolveum.midpoint.prism.PrismContainerDefinition; import com.evolveum.midpoint.prism.PrismContext; @@ -543,7 +544,7 @@ public static void checkShadow(ShadowType shadowType, ResourceType resourceType, public static void checkShadow(ShadowType shadowType, ResourceType resourceType, RepositoryService repositoryService, ObjectChecker checker, MatchingRule uidMatchingRule, PrismContext prismContext, OperationResult parentResult) { LOGGER.trace("Checking shadow:\n{}",shadowType.asPrismObject().debugDump()); - shadowType.asPrismObject().checkConsistence(true, true); + shadowType.asPrismObject().checkConsistence(true, true, ConsistencyCheckScope.THOROUGH); assertNotNull("no OID",shadowType.getOid()); assertNotNull("no name",shadowType.getName()); assertEquals(resourceType.getOid(), shadowType.getResourceRef().getOid());