diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestMapping.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestMapping.java index 1453fa2530f..7b40b8e6cbd 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestMapping.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestMapping.java @@ -34,6 +34,7 @@ import com.evolveum.icf.dummy.resource.BreakMode; import com.evolveum.icf.dummy.resource.DummyAccount; import com.evolveum.icf.dummy.resource.DummyResource; +import com.evolveum.midpoint.model.api.ModelExecuteOptions; import com.evolveum.midpoint.model.api.PolicyViolationException; import com.evolveum.midpoint.model.impl.trigger.RecomputeTriggerHandler; import com.evolveum.midpoint.prism.PrismObject; @@ -47,6 +48,7 @@ import com.evolveum.midpoint.schema.constants.MidPointConstants; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.result.OperationResultStatus; +import com.evolveum.midpoint.schema.util.MiscSchemaUtil; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.test.DummyResourceContoller; import com.evolveum.midpoint.test.util.TestUtil; @@ -1392,7 +1394,7 @@ public void test204DummyCrimsonReconcile() throws Exception { * and nothing should be destroyed. * MID-3661 */ - @Test(enabled=false) // MID-3661, legacy + @Test public void test206DummyCrimsonReconcileIOError() throws Exception { final String TEST_NAME = "test206DummyCrimsonReconcileIOError"; TestUtil.displayTestTile(this, TEST_NAME); @@ -1455,7 +1457,11 @@ public void test210ModifyUserLocality() throws Exception { // WHEN TestUtil.displayWhen(TEST_NAME); - modifyUserReplace(USER_GUYBRUSH_OID, UserType.F_LOCALITY, task, result, PrismTestUtil.createPolyString("Scabb Island")); + ObjectDelta objectDelta = createModifyUserReplaceDelta(USER_GUYBRUSH_OID, new ItemPath(UserType.F_LOCALITY), + PrismTestUtil.createPolyString("Scabb Island")); + Collection> deltas = MiscSchemaUtil.createCollection(objectDelta); + ModelExecuteOptions options = ModelExecuteOptions.createReconcile(); + modelService.executeChanges(deltas, options, task, result); // THEN TestUtil.displayThen(TEST_NAME); @@ -1473,7 +1479,9 @@ public void test210ModifyUserLocality() throws Exception { display("Dummy account after", dummyAccountAfter); assertDummyAccountAttribute(RESOURCE_DUMMY_CRIMSON_NAME, ACCOUNT_GUYBRUSH_DUMMY_USERNAME, DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_LOCATION_NAME, "Scabb Island"); - // TODO: assert drink + assertDummyAccountAttribute(RESOURCE_DUMMY_CRIMSON_NAME, ACCOUNT_GUYBRUSH_DUMMY_USERNAME, + DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_DRINK_NAME, + "vodka", "whisky", "rum from Scabb Island"); } diff --git a/model/model-test/src/main/java/com/evolveum/midpoint/model/test/AbstractModelIntegrationTest.java b/model/model-test/src/main/java/com/evolveum/midpoint/model/test/AbstractModelIntegrationTest.java index f2dfa950b04..e0b051b531b 100644 --- a/model/model-test/src/main/java/com/evolveum/midpoint/model/test/AbstractModelIntegrationTest.java +++ b/model/model-test/src/main/java/com/evolveum/midpoint/model/test/AbstractModelIntegrationTest.java @@ -2988,15 +2988,11 @@ protected void assertPasswordMetadata(PrismObject user, boolean create protected void reconcileUser(String oid, Task task, OperationResult result) throws CommunicationException, ObjectAlreadyExistsException, ExpressionEvaluationException, PolicyViolationException, SchemaException, SecurityViolationException, ConfigurationException, ObjectNotFoundException { ObjectDelta emptyDelta = ObjectDelta.createEmptyModifyDelta(UserType.class, oid, prismContext); modelService.executeChanges(MiscSchemaUtil.createCollection(emptyDelta), ModelExecuteOptions.createReconcile(), task, result); - result.computeStatus(); - TestUtil.assertSuccess(result); } protected void reconcileOrg(String oid, Task task, OperationResult result) throws CommunicationException, ObjectAlreadyExistsException, ExpressionEvaluationException, PolicyViolationException, SchemaException, SecurityViolationException, ConfigurationException, ObjectNotFoundException { ObjectDelta emptyDelta = ObjectDelta.createEmptyModifyDelta(OrgType.class, oid, prismContext); modelService.executeChanges(MiscSchemaUtil.createCollection(emptyDelta), ModelExecuteOptions.createReconcile(), task, result); - result.computeStatus(); - TestUtil.assertSuccess(result); } protected void assertRefEquals(String message, ObjectReferenceType expected, ObjectReferenceType actual) {