diff --git a/gui/admin-gui/src/test/java/com/evolveum/midpoint/gui/TestIntegrationObjectWrapperFactory.java b/gui/admin-gui/src/test/java/com/evolveum/midpoint/gui/TestIntegrationObjectWrapperFactory.java index 04ae8a6ea5e..06178e18898 100644 --- a/gui/admin-gui/src/test/java/com/evolveum/midpoint/gui/TestIntegrationObjectWrapperFactory.java +++ b/gui/admin-gui/src/test/java/com/evolveum/midpoint/gui/TestIntegrationObjectWrapperFactory.java @@ -28,7 +28,6 @@ import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.test.IntegrationTestTools; -import com.evolveum.midpoint.test.util.TestUtil; import com.evolveum.midpoint.util.exception.*; import com.evolveum.midpoint.web.AbstractInitializedGuiIntegrationTest; import com.evolveum.midpoint.web.AdminGuiTestConstants; @@ -123,7 +122,6 @@ public void initSystem(Task initTask, OperationResult initResult) throws Excepti PrismObject systemConfig = parseObject(SYSTEM_CONFIGURATION_FILE); -// LOGGER.info("adding system config page"); addObject(systemConfig, ModelExecuteOptions.createOverwrite(), initTask, initResult); } @@ -136,7 +134,7 @@ public void test100CreateWrapperUserJack() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assertLoggedInUserOid(USER_ADMINISTRATOR_OID); PrismObject user = getUser(USER_JACK_OID); @@ -147,7 +145,7 @@ public void test100CreateWrapperUserJack() throws Exception { PrismObjectWrapper objectWrapper = factory.createObjectWrapper(user, ItemStatus.NOT_CHANGED, context); // THEN - then(TEST_NAME); + then(); IntegrationTestTools.display("Wrapper after", objectWrapper); @@ -220,7 +218,7 @@ public void test110CreateWrapperUserNewEmpty() throws Exception { PrismObject user = getUserDefinition().instantiate(); // WHEN - when(TEST_NAME); + when(); Task task = taskManager.createTaskInstance(TEST_NAME); OperationResult result = task.getResult(); @@ -233,7 +231,7 @@ public void test110CreateWrapperUserNewEmpty() throws Exception { PrismObjectWrapper objectWrapper = factory.createObjectWrapper(user, ItemStatus.ADDED, context); // THEN - then(TEST_NAME); + then(); IntegrationTestTools.display("Wrapper after", objectWrapper); @@ -290,7 +288,7 @@ public void test112CreateWrapperUserNewman() throws Exception { PrismObject user = getUserDefinition().instantiate(); // WHEN - when(TEST_NAME); + when(); Task task = taskManager.createTaskInstance(TEST_NAME); OperationResult result = task.getResult(); @@ -310,7 +308,7 @@ public void test112CreateWrapperUserNewman() throws Exception { WrapperTestUtil.fillInPropertyWrapper(modelServiceLocator, mainContainerValueWrapper, extensionPath(PIRACY_SHIP), USER_NEWMAN_SHIP); // THEN - then(TEST_NAME); + then(); IntegrationTestTools.display("Wrapper after", objectWrapper); @@ -368,7 +366,7 @@ public void test102CreateWrapperUserEmpty() throws Exception { PrismObject userOld = user.clone(); // WHEN - when(TEST_NAME); + when(); Task task = taskManager.createTaskInstance(TEST_NAME); OperationResult result = task.getResult(); @@ -380,7 +378,7 @@ public void test102CreateWrapperUserEmpty() throws Exception { PrismObjectWrapper objectWrapper = factory.createObjectWrapper(user, ItemStatus.NOT_CHANGED, context); // THEN - then(TEST_NAME); + then(); IntegrationTestTools.display("Wrapper after", objectWrapper); @@ -430,7 +428,7 @@ public void test150CreateWrapperShadow() throws Exception { PrismObject shadowOld = shadow.clone(); // WHEN - when(TEST_NAME); + when(); Task task = taskManager.createTaskInstance(TEST_NAME); OperationResult result = task.getResult(); @@ -445,7 +443,7 @@ public void test150CreateWrapperShadow() throws Exception { // THEN - then(TEST_NAME); + then(); display("Wrapper after", objectWrapper); WrapperTestUtil.assertWrapper(objectWrapper, getString("prismContainer.mainPanelDisplayName"), "shadow description", shadow, shadowOld, ItemStatus.NOT_CHANGED); @@ -596,14 +594,14 @@ public void test220AssignRoleLandluberToWally() throws Exception { assertGroupMember(dummyGroup, USER_WALLY_NAME); // WHEN - when(TEST_NAME); + when(); PrismObjectWrapper objectWrapper = createObjectWrapper(task, shadow, ItemStatus.NOT_CHANGED); assertTrue("Wrong wrapper created. Expected ShadowWrapper but was " + objectWrapper.getClass().getSimpleName(), objectWrapper instanceof ShadowWrapper); ShadowWrapper shadowWrapper = (ShadowWrapper) objectWrapper; // THEN - then(TEST_NAME); + then(); display("Wrapper after", shadowWrapper); @@ -705,11 +703,11 @@ public void test241OrgScummBarModifyTransformProperties() throws Exception { IntegrationTestTools.display("Wrapper after", objectWrapper); // WHEN - when(TEST_NAME); + when(); ObjectDelta objectDelta = objectWrapper.getObjectDelta(); // THEN - then(TEST_NAME); + then(); display("Delta", objectDelta); ItemPath ahoyPath = ItemPath.create(ObjectType.F_EXTENSION, PIRACY_TRANSFORM, valueWrapperA.getNewValue().getId(), PIRACY_REPLACEMENT); PrismAsserts.assertPropertyReplace(objectDelta, ahoyPath, "Ahoy"); @@ -752,11 +750,11 @@ public void test242OrgScummBarAddTransform() throws Exception { IntegrationTestTools.display("Wrapper after", objectWrapper); // WHEN - when(TEST_NAME); + when(); ObjectDelta objectDelta = objectWrapper.getObjectDelta(); // THEN - then(TEST_NAME); + then(); display("Delta", objectDelta); ItemPath transformPath = ItemPath.create(ObjectType.F_EXTENSION, PIRACY_TRANSFORM); PrismAsserts.assertModifications(objectDelta, 1); @@ -804,11 +802,11 @@ public void test250OrgMinistryOrRumModifyTransformDescription() throws Exception IntegrationTestTools.display("Wrapper after", objectWrapper); // WHEN - when(TEST_NAME); + when(); ObjectDelta objectDelta = objectWrapper.getObjectDelta(); // THEN - then(TEST_NAME); + then(); display("Delta", objectDelta); PrismAsserts.assertModifications(objectDelta, 1); @@ -882,12 +880,12 @@ public void test800EditSchemaJackPropReadAllModifySomeUser() throws Exception { display("user before", user); // WHEN - when(TEST_NAME); + when(); PrismObjectWrapper objectWrapper = createObjectWrapper(getTestTask(), user, ItemStatus.NOT_CHANGED); // THEN - then(TEST_NAME); + then(); IntegrationTestTools.display("Wrapper after", objectWrapper); assertEquals("Wrong object wrapper readOnly", Boolean.FALSE, (Boolean)objectWrapper.isReadOnly()); @@ -954,12 +952,12 @@ public void test802EditSchemaJackPropReadSomeModifySomeUser() throws Exception { display("user before", user); // WHEN - when(TEST_NAME); + when(); PrismObjectWrapper objectWrapper = createObjectWrapper(task, user, ItemStatus.NOT_CHANGED); // THEN - then(TEST_NAME); + then(); IntegrationTestTools.display("Wrapper after", objectWrapper); assertEquals("Wrong object wrapper readOnly", Boolean.FALSE, (Boolean)objectWrapper.isReadOnly()); diff --git a/gui/admin-gui/src/test/java/com/evolveum/midpoint/web/TestIntegrationSecurity.java b/gui/admin-gui/src/test/java/com/evolveum/midpoint/web/TestIntegrationSecurity.java index 7dffcbdf538..98999722901 100644 --- a/gui/admin-gui/src/test/java/com/evolveum/midpoint/web/TestIntegrationSecurity.java +++ b/gui/admin-gui/src/test/java/com/evolveum/midpoint/web/TestIntegrationSecurity.java @@ -101,7 +101,7 @@ public void test100DecideNoRole() throws Exception { Authentication authentication = createPasswordAuthentication(USER_JACK_USERNAME, UserType.class); // WHEN - when(TEST_NAME); + when(); assertAllow(authentication, "/login"); assertAllow(authentication, "/"); @@ -112,7 +112,7 @@ public void test100DecideNoRole() throws Exception { assertDeny(authentication, "/admin/config/debugs"); // THEN - then(TEST_NAME); + then(); } @Test @@ -128,7 +128,7 @@ public void test110DecideRoleUiAllowAll() throws Exception { Authentication authentication = createPasswordAuthentication(USER_JACK_USERNAME, UserType.class); // WHEN - when(TEST_NAME); + when(); assertAllow(authentication, "/login"); assertAllow(authentication, "/"); @@ -139,7 +139,7 @@ public void test110DecideRoleUiAllowAll() throws Exception { assertAllow(authentication, "/admin/config/debugs"); // THEN - then(TEST_NAME); + then(); } @Test @@ -155,7 +155,7 @@ public void test120DecideRoleUiDenyAll() throws Exception { Authentication authentication = createPasswordAuthentication(USER_JACK_USERNAME, UserType.class); // WHEN - when(TEST_NAME); + when(); assertAllow(authentication, "/login"); assertAllow(authentication, "/"); @@ -166,7 +166,7 @@ public void test120DecideRoleUiDenyAll() throws Exception { assertDeny(authentication, "/admin/config/debugs"); // THEN - then(TEST_NAME); + then(); } @@ -186,7 +186,7 @@ public void test200DecideRoleUiDenyAllow() throws Exception { Authentication authentication = createPasswordAuthentication(USER_JACK_USERNAME, UserType.class); // WHEN - when(TEST_NAME); + when(); assertAllow(authentication, "/login"); assertAllow(authentication, "/"); @@ -197,7 +197,7 @@ public void test200DecideRoleUiDenyAllow() throws Exception { assertDeny(authentication, "/admin/config/debugs"); // THEN - then(TEST_NAME); + then(); } @@ -220,7 +220,7 @@ public void test300ConflictingAuthorizationIds() throws Exception { login(USER_JACK_USERNAME); // THEN - then(TEST_NAME); + then(); assertLoggedInUsername(USER_JACK_USERNAME); } diff --git a/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/TestDiff.java b/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/TestDiff.java index 33525d65dfc..96fd23d3838 100644 --- a/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/TestDiff.java +++ b/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/TestDiff.java @@ -6,7 +6,6 @@ */ package com.evolveum.midpoint.prism; -import static com.evolveum.midpoint.prism.util.PrismTestUtil.getPrismContext; import static org.testng.AssertJUnit.assertNull; import static com.evolveum.midpoint.prism.PrismInternalTestUtil.*; import static org.testng.AssertJUnit.assertEquals; @@ -26,15 +25,15 @@ import com.evolveum.midpoint.prism.polystring.PolyString; import com.evolveum.midpoint.prism.util.PrismAsserts; import com.evolveum.midpoint.prism.util.PrismTestUtil; +import com.evolveum.midpoint.tools.testng.AbstractUnitTest; import com.evolveum.midpoint.util.DebugUtil; import com.evolveum.midpoint.util.PrettyPrinter; import com.evolveum.midpoint.util.exception.SchemaException; /** * @author semancik - * */ -public class TestDiff { +public class TestDiff extends AbstractUnitTest { @BeforeSuite public void setupDebug() throws SchemaException, SAXException, IOException { @@ -44,7 +43,6 @@ public void setupDebug() throws SchemaException, SAXException, IOException { @Test public void testUserSimplePropertyDiffNoChange() throws Exception { - System.out.println("\n\n===[ testUserSimplePropertyDiffNoChange ]===\n"); // GIVEN PrismObjectDefinition userDef = getUserTypeDefinition(); @@ -68,7 +66,6 @@ public void testUserSimplePropertyDiffNoChange() throws Exception { @Test public void testPropertySimplePropertyDiffNoChange() throws Exception { - System.out.println("\n\n===[ testPropertySimplePropertyDiffNoChange ]===\n"); // GIVEN PrismObjectDefinition userDef = getUserTypeDefinition(); @@ -91,7 +88,6 @@ public void testPropertySimplePropertyDiffNoChange() throws Exception { @Test public void testPropertySimplePropertyDiffNoChangeStatic() throws Exception { - System.out.println("\n\n===[ testPropertySimplePropertyDiffNoChangeStatic ]===\n"); // GIVEN PrismObjectDefinition userDef = getUserTypeDefinition(); @@ -114,7 +110,6 @@ public void testPropertySimplePropertyDiffNoChangeStatic() throws Exception { @Test public void testUserSimplePropertyDiffReplace() throws Exception { - System.out.println("\n\n===[ testUserSimplePropertyDiffReplace ]===\n"); // GIVEN PrismObjectDefinition userDef = getUserTypeDefinition(); @@ -140,7 +135,6 @@ public void testUserSimplePropertyDiffReplace() throws Exception { @Test public void testPropertyUserSimplePropertyDiffReplace() throws Exception { - System.out.println("\n\n===[ testPropertyUserSimplePropertyDiffReplace ]===\n"); // GIVEN PrismObjectDefinition userDef = getUserTypeDefinition(); @@ -166,7 +160,6 @@ public void testPropertyUserSimplePropertyDiffReplace() throws Exception { @Test public void testPropertyUserSimplePropertyDiffReplaceStatic() throws Exception { - System.out.println("\n\n===[ testPropertyUserSimplePropertyDiffReplaceStatic ]===\n"); // GIVEN PrismObjectDefinition userDef = getUserTypeDefinition(); @@ -192,8 +185,6 @@ public void testPropertyUserSimplePropertyDiffReplaceStatic() throws Exception { @Test public void testUserSimpleDiffMultiNoChange() throws Exception { - System.out.println("\n\n===[ testUserSimpleDiffMultiNoChange ]===\n"); - // GIVEN PrismObjectDefinition userDef = getUserTypeDefinition(); @@ -221,8 +212,6 @@ public void testUserSimpleDiffMultiNoChange() throws Exception { @Test public void testPropertyUserSimpleDiffMultiNoChange() throws Exception { - System.out.println("\n\n===[ testPropertyUserSimpleDiffMultiNoChange ]===\n"); - // GIVEN PrismObjectDefinition userDef = getUserTypeDefinition(); @@ -247,8 +236,6 @@ public void testPropertyUserSimpleDiffMultiNoChange() throws Exception { @Test public void testPropertyUserSimpleDiffMultiNoChangeStatic() throws Exception { - System.out.println("\n\n===[ testPropertyUserSimpleDiffMultiNoChangeStatic ]===\n"); - // GIVEN PrismObjectDefinition userDef = getUserTypeDefinition(); @@ -273,8 +260,6 @@ public void testPropertyUserSimpleDiffMultiNoChangeStatic() throws Exception { @Test public void testUserSimpleDiffMultiAdd() throws Exception { - System.out.println("\n\n===[ testUserSimpleDiffMulti ]===\n"); - // GIVEN PrismObjectDefinition userDef = getUserTypeDefinition(); @@ -305,8 +290,6 @@ public void testUserSimpleDiffMultiAdd() throws Exception { @Test public void testPropertyUserSimpleDiffMultiAdd() throws Exception { - System.out.println("\n\n===[ testPropertyUserSimpleDiffMultiAdd ]===\n"); - // GIVEN PrismObjectDefinition userDef = getUserTypeDefinition(); @@ -335,8 +318,6 @@ public void testPropertyUserSimpleDiffMultiAdd() throws Exception { @Test public void testPropertyUserSimpleDiffMultiAddStatic() throws Exception { - System.out.println("\n\n===[ testPropertyUserSimpleDiffMultiAddStatic ]===\n"); - // GIVEN PrismObjectDefinition userDef = getUserTypeDefinition(); @@ -365,8 +346,6 @@ public void testPropertyUserSimpleDiffMultiAddStatic() throws Exception { @Test public void testPropertyUserSimpleDiffMultiAddStaticNull1() throws Exception { - System.out.println("\n\n===[ testPropertyUserSimpleDiffMultiAddStaticNull1 ]===\n"); - // GIVEN PrismObjectDefinition userDef = getUserTypeDefinition(); @@ -388,8 +367,6 @@ public void testPropertyUserSimpleDiffMultiAddStaticNull1() throws Exception { @Test public void testPropertyUserSimpleDiffMultiAddStaticNull2() throws Exception { - System.out.println("\n\n===[ testPropertyUserSimpleDiffMultiAddStaticNull2 ]===\n"); - // GIVEN PrismObjectDefinition userDef = getUserTypeDefinition(); @@ -411,8 +388,6 @@ public void testPropertyUserSimpleDiffMultiAddStaticNull2() throws Exception { @Test public void testContainerSimpleDiffModificationsNoChange() throws Exception { - System.out.println("\n\n===[ testContainerSimpleDiffModificationsNoChange ]===\n"); - // GIVEN PrismObjectDefinition userDef = getUserTypeDefinition(); PrismContainerDefinition assignmentContDef = userDef.findContainerDefinition(UserType.F_ASSIGNMENT); @@ -437,8 +412,6 @@ public void testContainerSimpleDiffModificationsNoChange() throws Exception { @Test public void testContainerDiffModificationsDesciption() throws Exception { - System.out.println("\n\n===[ testContainerDiffModificationsDesciption ]===\n"); - // GIVEN PrismObjectDefinition userDef = getUserTypeDefinition(); PrismContainerDefinition assignmentContDef = userDef.findContainerDefinition(UserType.F_ASSIGNMENT); @@ -469,8 +442,6 @@ public void testContainerDiffModificationsDesciption() throws Exception { @Test public void testContainerValueDiffDesciptionNoPath() throws Exception { - System.out.println("\n\n===[ testContainerValueDiffDesciptionNoPath ]===\n"); - // GIVEN PrismObjectDefinition userDef = getUserTypeDefinition(); PrismContainerDefinition assignmentContDef = userDef.findContainerDefinition(UserType.F_ASSIGNMENT); @@ -496,42 +467,4 @@ public void testContainerValueDiffDesciptionNoPath() throws Exception { "chamalalia patlama paprtala"); ItemDeltaCollectionsUtil.checkConsistence(modifications); } - -// @Test -// public void testContainerValueDiffDesciptionPath() throws Exception { -// System.out.println("\n\n===[ testContainerValueDiffDesciptionPath ]===\n"); -// -// // GIVEN -// PrismObjectDefinition userDef = getUserTypeDefinition(); -// PrismContainerDefinition assignmentContDef = userDef.findContainerDefinition(UserType.F_ASSIGNMENT); -// -// PrismContainer ass1 = assignmentContDef.instantiate(); -// PrismContainerValue ass1cval = ass1.createNewValue(); -// ass1cval.setPropertyRealValue(AssignmentType.F_DESCRIPTION, "blah blah"); -// -// PrismContainer ass2 = assignmentContDef.instantiate(); -// PrismContainerValue ass2cval = ass2.createNewValue(); -// ass2cval.setPropertyRealValue(AssignmentType.F_DESCRIPTION, "chamalalia patlama paprtala"); -// -// ItemPath pathPrefix = ItemPath.create( -// new NameItemPathSegment(UserType.F_ASSIGNMENT), -// new IdItemPathSegment("1")); -// -// // WHEN -// Collection modifications = ass1cval.diff(ass2cval, pathPrefix, true, false); -// -// // THEN -// assertNotNull(modifications); -// System.out.println(DebugUtil.debugDump(modifications)); -// assertEquals("Unexpected number of midifications", 1, modifications.size()); -// PrismAsserts.assertPropertyReplace( -// modifications, -// ItemPath.create( -// new NameItemPathSegment(UserType.F_ASSIGNMENT), -// new IdItemPathSegment("1"), -// new NameItemPathSegment(AssignmentType.F_DESCRIPTION)), -// "chamalalia patlama paprtala"); -// ItemDelta.checkConsistence(modifications); -// } - } diff --git a/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/TestExtraSchema.java b/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/TestExtraSchema.java index b70ae0367d4..4162831196c 100644 --- a/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/TestExtraSchema.java +++ b/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/TestExtraSchema.java @@ -34,11 +34,12 @@ import com.evolveum.midpoint.prism.foo.UserType; import com.evolveum.midpoint.prism.schema.PrismSchema; import com.evolveum.midpoint.prism.util.PrismAsserts; +import com.evolveum.midpoint.tools.testng.AbstractUnitTest; import com.evolveum.midpoint.util.DOMUtil; import com.evolveum.midpoint.util.PrettyPrinter; import com.evolveum.midpoint.util.exception.SchemaException; -public class TestExtraSchema { +public class TestExtraSchema extends AbstractUnitTest { public static final String NS_USER_2_EXT = "http://example.com/xml/ns/user-2-extension"; @@ -53,8 +54,6 @@ public class TestExtraSchema { */ @Test public void testExtraSchema() throws SAXException, IOException, SchemaException { - System.out.println("===[ testExtraSchema ]==="); - Document dataDoc = DOMUtil.parseFile(new File(COMMON_DIR_PATH, "root-foo.xml")); PrismContext context = constructPrismContext(); @@ -68,8 +67,6 @@ public void testExtraSchema() throws SAXException, IOException, SchemaException Validator validator = javaxSchema.newValidator(); DOMResult validationResult = new DOMResult(); validator.validate(new DOMSource(dataDoc),validationResult); -// System.out.println("Validation result:"); -// System.out.println(DOMUtil.serializeDOMToString(validationResult.getNode())); } /** @@ -78,8 +75,6 @@ public void testExtraSchema() throws SAXException, IOException, SchemaException */ @Test public void testUserExtensionSchemaLoad() throws SAXException, IOException, SchemaException { - System.out.println("===[ testUserExtensionSchemaLoad ]==="); - PrismContext context = constructPrismContext(); SchemaRegistryImpl reg = (SchemaRegistryImpl) context.getSchemaRegistry(); reg.registerPrismSchemasFromDirectory(EXTRA_SCHEMA_DIR); @@ -105,7 +100,6 @@ public void testUserExtensionSchemaLoad() throws SAXException, IOException, Sche @Test public void testUserExtensionSchemaParseUser() throws SAXException, IOException, SchemaException { - System.out.println("===[ testUserExtensionSchemaParseUser ]==="); Document dataDoc = DOMUtil.parseFile(USER_JACK_FILE_XML); PrismContext context = constructPrismContext(); @@ -128,15 +122,10 @@ public void testUserExtensionSchemaParseUser() throws SAXException, IOException, Validator validator = javaxSchema.newValidator(); DOMResult validationResult = new DOMResult(); validator.validate(new DOMSource(dataDoc),validationResult); -// System.out.println("Validation result:"); -// System.out.println(DOMUtil.serializeDOMToString(validationResult.getNode())); - } @Test public void testUserExtensionSchemaSchemaRegistry() throws SAXException, IOException, SchemaException { - System.out.println("===[ testUserExtensionSchemaAsObjectSchema ]==="); - PrismContext context = constructPrismContext(); SchemaRegistryImpl reg = (SchemaRegistryImpl) context.getSchemaRegistry(); reg.registerPrismSchemasFromDirectory(EXTRA_SCHEMA_DIR); @@ -207,8 +196,6 @@ private void assertDefinitionOrder(List definitions, Q */ @Test public void testTypeOverride() throws SAXException, IOException, SchemaException { - System.out.println("===[ testTypeOverride ]==="); - PrismContext context = constructPrismContext(); SchemaRegistryImpl reg = (SchemaRegistryImpl) context.getSchemaRegistry(); reg.registerPrismSchemasFromDirectory(EXTRA_SCHEMA_DIR); diff --git a/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/TestFind.java b/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/TestFind.java index 3b6466a5e45..40e4d330273 100644 --- a/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/TestFind.java +++ b/infra/prism-impl/src/test/java/com/evolveum/midpoint/prism/TestFind.java @@ -6,14 +6,13 @@ */ package com.evolveum.midpoint.prism; -import static com.evolveum.midpoint.prism.util.PrismTestUtil.getPrismContext; +import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertTrue; + import static com.evolveum.midpoint.prism.PrismInternalTestUtil.*; -import static org.testng.AssertJUnit.assertEquals; import java.io.IOException; -import com.evolveum.midpoint.prism.path.ItemPath; import org.testng.annotations.BeforeSuite; import org.testng.annotations.Test; import org.xml.sax.SAXException; @@ -21,16 +20,17 @@ import com.evolveum.midpoint.prism.foo.AccountConstructionType; import com.evolveum.midpoint.prism.foo.AssignmentType; import com.evolveum.midpoint.prism.foo.UserType; +import com.evolveum.midpoint.prism.path.ItemPath; import com.evolveum.midpoint.prism.polystring.PolyString; import com.evolveum.midpoint.prism.util.PrismTestUtil; +import com.evolveum.midpoint.tools.testng.AbstractUnitTest; import com.evolveum.midpoint.util.PrettyPrinter; import com.evolveum.midpoint.util.exception.SchemaException; /** * @author semancik - * */ -public class TestFind { +public class TestFind extends AbstractUnitTest { @BeforeSuite public void setupDebug() throws SchemaException, SAXException, IOException { @@ -40,9 +40,6 @@ public void setupDebug() throws SchemaException, SAXException, IOException { @Test public void testFindString() throws SchemaException, SAXException, IOException { - final String TEST_NAME = "testFindString"; - System.out.println("===[ "+TEST_NAME+" ]==="); - // GIVEN PrismObject user = createUser(); ItemPath path = UserType.F_DESCRIPTION; @@ -51,15 +48,12 @@ public void testFindString() throws SchemaException, SAXException, IOException { PrismProperty nameProperty = findProperty(user, path); // THEN - assertEquals("Wrong property value (path="+path+")", USER_JACK_DESCRIPTION, nameProperty.getRealValue()); + assertEquals("Wrong property value (path=" + path + ")", USER_JACK_DESCRIPTION, nameProperty.getRealValue()); assertTrue("QName found something other", nameProperty == (PrismProperty) user.findProperty(UserType.F_DESCRIPTION)); } @Test public void testFindPolyString() throws SchemaException, SAXException, IOException { - final String TEST_NAME = "testFindPolyString"; - System.out.println("===[ "+TEST_NAME+" ]==="); - // GIVEN PrismObject user = createUser(); ItemPath path = UserType.F_POLY_NAME; @@ -74,9 +68,6 @@ public void testFindPolyString() throws SchemaException, SAXException, IOExcepti @Test public void testFindPolyStringOrig() throws SchemaException, SAXException, IOException { - final String TEST_NAME = "testFindPolyStringOrig"; - System.out.println("===[ "+TEST_NAME+" ]==="); - // GIVEN ItemPath path = ItemPath.create(UserType.F_POLY_NAME, PolyString.F_ORIG); @@ -84,14 +75,11 @@ public void testFindPolyStringOrig() throws SchemaException, SAXException, IOExc Object found = findUser(path); // THEN - assertEquals("Wrong property value (path="+path+")", USER_JACK_POLYNAME_ORIG, found); + assertEquals("Wrong property value (path=" + path + ")", USER_JACK_POLYNAME_ORIG, found); } @Test public void testFindPolyStringNorm() throws SchemaException, SAXException, IOException { - final String TEST_NAME = "testFindPolyStringNorm"; - System.out.println("===[ "+TEST_NAME+" ]==="); - // GIVEN ItemPath path = ItemPath.create(UserType.F_POLY_NAME, PolyString.F_NORM); @@ -99,14 +87,11 @@ public void testFindPolyStringNorm() throws SchemaException, SAXException, IOExc Object found = findUser(path); // THEN - assertEquals("Wrong property value (path="+path+")", USER_JACK_POLYNAME_NORM, found); + assertEquals("Wrong property value (path=" + path + ")", USER_JACK_POLYNAME_NORM, found); } @Test public void testFindExtensionBar() throws SchemaException, SAXException, IOException { - final String TEST_NAME = "testFindExtensionBar"; - System.out.println("===[ "+TEST_NAME+" ]==="); - // GIVEN ItemPath path = ItemPath.create(UserType.F_EXTENSION, EXTENSION_BAR_ELEMENT); @@ -114,14 +99,11 @@ public void testFindExtensionBar() throws SchemaException, SAXException, IOExcep PrismProperty property = findUserProperty(path); // THEN - assertEquals("Wrong property value (path="+path+")", "BAR", property.getAnyRealValue()); + assertEquals("Wrong property value (path=" + path + ")", "BAR", property.getAnyRealValue()); } @Test public void testFindAssignment1Description() throws SchemaException, SAXException, IOException { - final String TEST_NAME = "testFindAssignment1Description"; - System.out.println("===[ "+TEST_NAME+" ]==="); - // GIVEN ItemPath path = ItemPath.create(UserType.F_ASSIGNMENT, USER_ASSIGNMENT_1_ID, AssignmentType.F_DESCRIPTION); @@ -129,14 +111,11 @@ public void testFindAssignment1Description() throws SchemaException, SAXExceptio PrismProperty property = findUserProperty(path); // THEN - assertEquals("Wrong property value (path="+path+")", "Assignment 1", property.getRealValue()); + assertEquals("Wrong property value (path=" + path + ")", "Assignment 1", property.getRealValue()); } @Test public void testFindAssignment2Construction() throws SchemaException, SAXException, IOException { - final String TEST_NAME = "testFindAssignment2ConstructionHowto"; - System.out.println("===[ "+TEST_NAME+" ]==="); - // GIVEN ItemPath path = ItemPath.create(UserType.F_ASSIGNMENT, USER_ASSIGNMENT_2_ID, AssignmentType.F_ACCOUNT_CONSTRUCTION); @@ -144,14 +123,11 @@ public void testFindAssignment2Construction() throws SchemaException, SAXExcepti PrismProperty property = findUserProperty(path); // THEN - assertEquals("Wrong property value (path="+path+")", "Just do it", property.getRealValue().getHowto()); + assertEquals("Wrong property value (path=" + path + ")", "Just do it", property.getRealValue().getHowto()); } @Test public void testFindAssignment() throws SchemaException, SAXException, IOException { - final String TEST_NAME = "testFindAssignment"; - System.out.println("===[ "+TEST_NAME+" ]==="); - // GIVEN ItemPath path = UserType.F_ASSIGNMENT; @@ -160,7 +136,7 @@ public void testFindAssignment() throws SchemaException, SAXException, IOExcepti // THEN PrismContainerValue value2 = container.getValue(USER_ASSIGNMENT_2_ID); - assertEquals("Wrong value2 description (path="+path+")", "Assignment 2", value2.findProperty(AssignmentType.F_DESCRIPTION).getRealValue()); + assertEquals("Wrong value2 description (path=" + path + ")", "Assignment 2", value2.findProperty(AssignmentType.F_DESCRIPTION).getRealValue()); } private T findUser(ItemPath path) throws SchemaException, SAXException, IOException { @@ -217,10 +193,8 @@ private PrismContainer findContainer(PrismObject createUser() throws SchemaException, SAXException, IOException { return PrismTestUtil.parseObject(USER_JACK_FILE_XML); } - } diff --git a/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestAbstractAssignmentEvaluator.java b/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestAbstractAssignmentEvaluator.java index 9d62fc40462..8414436d4a8 100644 --- a/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestAbstractAssignmentEvaluator.java +++ b/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestAbstractAssignmentEvaluator.java @@ -124,12 +124,12 @@ public void test100Direct() throws Exception { ItemDeltaItem,PrismContainerDefinition> assignmentIdi = createAssignmentIdi(assignmentType); // WHEN - when(TEST_NAME); + when(); EvaluatedAssignmentImpl evaluatedAssignment = assignmentEvaluator.evaluate(assignmentIdi, PlusMinusZero.ZERO, false, userTypeJack, "testDirect", false, task, result); evaluatedAssignment.evaluateConstructions(userOdo, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -163,12 +163,12 @@ public void test110DirectExpression() throws Exception { ItemDeltaItem,PrismContainerDefinition> assignmentIdi = createAssignmentIdi(assignmentType); // WHEN - when(TEST_NAME); + when(); EvaluatedAssignmentImpl evaluatedAssignment = assignmentEvaluator.evaluate(assignmentIdi, PlusMinusZero.ZERO, false, userTypeJack, "testDirect", false, task, result); evaluatedAssignment.evaluateConstructions(userOdo, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -210,12 +210,12 @@ public void test120DirectExpressionReplaceDescription() throws Exception { display("Assignment IDI", assignmentIdi); // WHEN - when(TEST_NAME); + when(); EvaluatedAssignmentImpl evaluatedAssignment = assignmentEvaluator.evaluate(assignmentIdi, PlusMinusZero.ZERO, false, userTypeJack, "testDirect", false, task, result); evaluatedAssignment.evaluateConstructions(userOdo, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertNotNull(evaluatedAssignment); @@ -271,12 +271,12 @@ public void test130DirectExpressionReplaceDescriptionFromNull() throws Exception assignmentIdi.recompute(); // WHEN - when(TEST_NAME); + when(); EvaluatedAssignmentImpl evaluatedAssignment = assignmentEvaluator.evaluate(assignmentIdi, PlusMinusZero.ZERO, false, userTypeJack, "testDirect", false, task, result); evaluatedAssignment.evaluateConstructions(userOdo, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertNotNull(evaluatedAssignment); @@ -344,12 +344,12 @@ public void test140RoleVisitor() throws Exception { ItemDeltaItem,PrismContainerDefinition> assignmentIdi = createAssignmentIdi(assignmentType); // WHEN - when(TEST_NAME); + when(); EvaluatedAssignmentImpl evaluatedAssignment = assignmentEvaluator.evaluate(assignmentIdi, PlusMinusZero.ZERO, false, userTypeJack, TEST_NAME, false, task, result); evaluatedAssignment.evaluateConstructions(userOdo, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertNotNull(evaluatedAssignment); @@ -389,12 +389,12 @@ public void test142RoleVisitorDisabledAssignment() throws Exception { ItemDeltaItem,PrismContainerDefinition> assignmentIdi = createAssignmentIdi(assignmentType); // WHEN - when(TEST_NAME); + when(); EvaluatedAssignmentImpl evaluatedAssignment = assignmentEvaluator.evaluate(assignmentIdi, PlusMinusZero.ZERO, false, userTypeJack, TEST_NAME, false, task, result); evaluatedAssignment.evaluateConstructions(userOdo, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -434,12 +434,12 @@ public void test150RoleEngineer() throws Exception { ItemDeltaItem,PrismContainerDefinition> assignmentIdi = createAssignmentIdi(assignmentType); // WHEN - when(TEST_NAME); + when(); EvaluatedAssignmentImpl evaluatedAssignment = assignmentEvaluator.evaluate(assignmentIdi, PlusMinusZero.ZERO, false, userTypeJack, "testRoleEngineer", false, task, result); evaluatedAssignment.evaluateConstructions(userOdo, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertNotNull(evaluatedAssignment); @@ -485,12 +485,12 @@ public void test160AddRoleEngineer() throws Exception { ItemDeltaItem,PrismContainerDefinition> assignmentIdi = createAssignmentIdi(assignmentType); // WHEN - when(TEST_NAME); + when(); EvaluatedAssignmentImpl evaluatedAssignment = assignmentEvaluator.evaluate(assignmentIdi, PlusMinusZero.ZERO, false, userTypeJack, TEST_NAME, false, task, result); evaluatedAssignment.evaluateConstructions(userOdo, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertNotNull(evaluatedAssignment); @@ -557,12 +557,12 @@ public void test170RoleManagerChangeCostCenter() throws Exception { ItemDeltaItem,PrismContainerDefinition> assignmentIdi = createAssignmentIdi(assignmentType); // WHEN - when(TEST_NAME); + when(); EvaluatedAssignmentImpl evaluatedAssignment = assignmentEvaluator.evaluate(assignmentIdi, PlusMinusZero.ZERO, false, userTypeJack, TEST_NAME, false, task, result); evaluatedAssignment.evaluateConstructions(userOdo, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -620,12 +620,12 @@ public void test180RoleManagerRemoveCostCenter() throws Exception { ItemDeltaItem,PrismContainerDefinition> assignmentIdi = createAssignmentIdi(assignmentType); // WHEN - when(TEST_NAME); + when(); EvaluatedAssignmentImpl evaluatedAssignment = assignmentEvaluator.evaluate(assignmentIdi, PlusMinusZero.ZERO, false, userTypeJack, TEST_NAME, false, task, result); evaluatedAssignment.evaluateConstructions(userOdo, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -678,12 +678,12 @@ public void test200DisableEngineerEmployeeInducement() throws Exception { ItemDeltaItem,PrismContainerDefinition> assignmentIdi = createAssignmentIdi(assignmentType); // WHEN - when(TEST_NAME); + when(); EvaluatedAssignmentImpl evaluatedAssignment = assignmentEvaluator.evaluate(assignmentIdi, PlusMinusZero.ZERO, false, userTypeJack, "testRoleEngineer", false, task, result); evaluatedAssignment.evaluateConstructions(userOdo, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -738,12 +738,12 @@ public void test300DisableRoleEmployee() throws Exception { ItemDeltaItem,PrismContainerDefinition> assignmentIdi = createAssignmentIdi(assignmentType); // WHEN - when(TEST_NAME); + when(); EvaluatedAssignmentImpl evaluatedAssignment = assignmentEvaluator.evaluate(assignmentIdi, PlusMinusZero.ZERO, false, userTypeJack, "testRoleEngineer", false, task, result); evaluatedAssignment.evaluateConstructions(userOdo, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -792,12 +792,12 @@ public void test310DisableRoleEngineer() throws Exception { ItemDeltaItem,PrismContainerDefinition> assignmentIdi = createAssignmentIdi(assignmentType); // WHEN - when(TEST_NAME); + when(); EvaluatedAssignmentImpl evaluatedAssignment = assignmentEvaluator.evaluate(assignmentIdi, PlusMinusZero.ZERO, false, userTypeJack, "testRoleEngineer", false, task, result); evaluatedAssignment.evaluateConstructions(userOdo, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -853,11 +853,11 @@ public void test400UserFred() throws Exception { addFocusDeltaToContext(lensContext, descriptionDelta); // WHEN - when(TEST_NAME); + when(); projector.project(lensContext, "test", task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); DeltaSetTriple> triple = lensContext.getEvaluatedAssignmentTriple(); diff --git a/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestAssignmentProcessor.java b/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestAssignmentProcessor.java index 2f95b98a7a4..8796cdf2065 100644 --- a/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestAssignmentProcessor.java +++ b/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestAssignmentProcessor.java @@ -380,11 +380,11 @@ public void test031DeleteAssignmentModifyAccount() throws Exception { assertFocusModificationSanity(context); // WHEN - when(TEST_NAME); + when(); assignmentProcessor.processAssignments(context, getNow(), task, result); // THEN - then(TEST_NAME); + then(); display("Output context", context.dump(true)); display("result", result); assertSuccess(result); diff --git a/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestClockwork.java b/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestClockwork.java index a4b349e7b25..07aae4b0647 100644 --- a/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestClockwork.java +++ b/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestClockwork.java @@ -100,7 +100,7 @@ public void test010SerializeAddUserBarbossa() throws Exception { fillContextWithAddUserDelta(context, bill); // WHEN - when(TEST_NAME); + when(); clockwork.click(context, task, result); // one round - compute projections display("Context before serialization", context); @@ -116,7 +116,7 @@ public void test010SerializeAddUserBarbossa() throws Exception { display("Context after deserialization", context); // THEN - then(TEST_NAME); + then(); assertEquals("Secondary deltas are not preserved - their number differs", context.getFocusContext().getSecondaryDeltas().size(), context2.getFocusContext().getSecondaryDeltas().size()); for (int i = 0; i < context.getFocusContext().getSecondaryDeltas().size(); i++) { assertTrue("Secondary delta #" + i + " is not preserved correctly, " @@ -146,11 +146,11 @@ public void test020AssignAccountToJackSync() throws Exception { rememberCounter(InternalCounters.SHADOW_FETCH_OPERATION_COUNT); // WHEN - when(TEST_NAME); + when(); clockwork.run(context, task, result); // THEN - then(TEST_NAME); + then(); mockClockworkHook.setRecord(false); display("Output context", context); display("Hook contexts", mockClockworkHook); @@ -223,11 +223,11 @@ public void test053ModifyUserBarbossaDisable() throws Exception { assertFocusModificationSanity(context); // WHEN - when(TEST_NAME); + when(); clockwork.run(context, task, result); // THEN - then(TEST_NAME); + then(); display("Output context", context); assertTrue(context.getFocusContext().getPrimaryDelta().getChangeType() == ChangeType.MODIFY); diff --git a/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestPolicyRules2.java b/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestPolicyRules2.java index 32459a7fc3f..233aa8d0b47 100644 --- a/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestPolicyRules2.java +++ b/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestPolicyRules2.java @@ -145,11 +145,11 @@ public void test100JackAttemptAssignRoleStudent() throws Exception { assertFocusModificationSanity(context); // WHEN - when(TEST_NAME); + when(); projector.project(context, ACTIVITY_DESCRIPTION, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); dumpPolicyRules(context); @@ -187,11 +187,11 @@ public void test110JoeAttemptAssignRoleStudent() throws Exception { assertFocusModificationSanity(context); // WHEN - when(TEST_NAME); + when(); projector.project(context, ACTIVITY_DESCRIPTION, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -237,11 +237,11 @@ public void test120JackAttemptToMoveTo1900AndAssignRoleStudent() throws Exceptio assertFocusModificationSanity(context); // WHEN - when(TEST_NAME); + when(); projector.project(context, ACTIVITY_DESCRIPTION, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -289,12 +289,12 @@ public void test130JackMoveTo1900AndAssignRoleStudent() throws Exception { assertFocusModificationSanity(context); // WHEN - when(TEST_NAME); + when(); clockwork.run(context, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -343,13 +343,13 @@ public void test135JackChangeValidTo() throws Exception { assertFocusModificationSanity(context); // WHEN - when(TEST_NAME); + when(); // cannot run the clockwork as in the secondary state the deltas are no longer considered (!) projector.project(context, ACTIVITY_DESCRIPTION, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -385,12 +385,12 @@ public void test140JackNoChange() throws Exception { assertFocusModificationSanity(context); // WHEN - when(TEST_NAME); + when(); projector.project(context, ACTIVITY_DESCRIPTION, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -443,12 +443,12 @@ public void test142JackNoChangeButTaskExists() throws Exception { assertFocusModificationSanity(context); // WHEN - when(TEST_NAME); + when(); projector.project(context, ACTIVITY_DESCRIPTION, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -492,11 +492,11 @@ public void test150FrankAttemptToAssignRoleStudentButDisabled() throws Exception assertFocusModificationSanity(context); // WHEN - when(TEST_NAME); + when(); projector.project(context, ACTIVITY_DESCRIPTION, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -532,11 +532,11 @@ public void test160AttemptToAddPeter() throws Exception { assertFocusModificationSanity(context); // WHEN - when(TEST_NAME); + when(); projector.project(context, ACTIVITY_DESCRIPTION, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -571,11 +571,11 @@ public void test170AddPeter() throws Exception { assertFocusModificationSanity(context); // WHEN - when(TEST_NAME); + when(); clockwork.run(context, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -628,12 +628,12 @@ public void test180StudentRecompute() throws Exception { assertFocusModificationSanity(context); // WHEN - when(TEST_NAME); + when(); projector.project(context, ACTIVITY_DESCRIPTION, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -663,13 +663,13 @@ public void test200AddUnresolvable() throws Exception { assertFocusModificationSanity(context); // WHEN - when(TEST_NAME); + when(); try { clockwork.run(context, task, result); - then(TEST_NAME); + then(); fail("unexpected success"); } catch (ObjectNotFoundException e) { - then(TEST_NAME); + then(); System.out.println("Expected exception: " + e); e.printStackTrace(System.out); if (!e.getMessage().contains("No policy constraint named 'unresolvable' could be found")) { @@ -693,13 +693,13 @@ public void test210AddCyclic() throws Exception { assertFocusModificationSanity(context); // WHEN - when(TEST_NAME); + when(); try { clockwork.run(context, task, result); - then(TEST_NAME); + then(); fail("unexpected success"); } catch (SchemaException e) { - then(TEST_NAME); + then(); System.out.println("Expected exception: " + e); e.printStackTrace(System.out); if (!e.getMessage().contains("Trying to resolve cyclic reference to constraint")) { @@ -723,10 +723,10 @@ public void test220AddChained() throws Exception { assertFocusModificationSanity(context); // WHEN - when(TEST_NAME); + when(); clockwork.run(context, task, result); - then(TEST_NAME); + then(); display("Output context", context); Map rules = new HashMap<>(); @@ -782,13 +782,13 @@ public void test230AddAmbiguous() throws Exception { assertFocusModificationSanity(context); // WHEN - when(TEST_NAME); + when(); try { clockwork.run(context, task, result); - then(TEST_NAME); + then(); fail("unexpected success"); } catch (SchemaException e) { - then(TEST_NAME); + then(); System.out.println("Expected exception: " + e); e.printStackTrace(System.out); if (!e.getMessage().contains("Conflicting definitions of 'constraint-B'")) { @@ -816,13 +816,13 @@ public void test300ModifyInducement() throws Exception { assertFocusModificationSanity(context); // WHEN - when(TEST_NAME); + when(); try { clockwork.run(context, task, result); - then(TEST_NAME); + then(); fail("unexpected success"); } catch (PolicyViolationException e) { - then(TEST_NAME); + then(); System.out.println("Expected exception: " + e); e.printStackTrace(System.out); if (!getTranslatedMessage(e).contains("Role \"Immutable inducements\" is to be modified")) { @@ -850,9 +850,9 @@ public void test310ModifyInducementPass() throws Exception { assertFocusModificationSanity(context); // WHEN - when(TEST_NAME); + when(); clockwork.run(context, task, result); - then(TEST_NAME); + then(); result.computeStatus(); assertSuccess("unexpected failure", result); } @@ -876,9 +876,9 @@ public void test320ModifyInducementPass2() throws Exception { assertFocusModificationSanity(context); // WHEN - when(TEST_NAME); + when(); clockwork.run(context, task, result); - then(TEST_NAME); + then(); result.computeStatus(); assertSuccess("unexpected failure", result); } @@ -902,13 +902,13 @@ public void test330AddInducement() throws Exception { assertFocusModificationSanity(context); // WHEN - when(TEST_NAME); + when(); try { clockwork.run(context, task, result); - then(TEST_NAME); + then(); fail("unexpected success"); } catch (PolicyViolationException e) { - then(TEST_NAME); + then(); System.out.println("Expected exception: " + e); e.printStackTrace(System.out); if (!getTranslatedMessage(e).contains("Role \"No inducements add or delete\" is to be modified")) { @@ -936,13 +936,13 @@ public void test340AddInducementViaExpression() throws Exception { assertFocusModificationSanity(context); // WHEN - when(TEST_NAME); + when(); try { clockwork.run(context, task, result); - then(TEST_NAME); + then(); fail("unexpected success"); } catch (PolicyViolationException e) { - then(TEST_NAME); + then(); System.out.println("Expected exception: " + e); e.printStackTrace(System.out); if (!getTranslatedMessage(e).contains("Role \"No inducements add or delete (expression)\" is to be modified")) { diff --git a/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestProjector.java b/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestProjector.java index 00b3ca9ddf7..9e6cbe449a1 100644 --- a/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestProjector.java +++ b/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestProjector.java @@ -574,11 +574,11 @@ public void test260ModifyAccountBarbossaDrinkReplace() throws Exception { assertFocusModificationSanity(context); // WHEN - when(TEST_NAME); + when(); projector.project(context, "test", task, result); // THEN - then(TEST_NAME); + then(); assertPartialError(result); } @@ -848,11 +848,11 @@ public void test301AssignConflictingAccountToJack() throws Exception { assertFocusModificationSanity(context); // WHEN - when(TEST_NAME); + when(); projector.project(context, "test", task, result); // THEN - then(TEST_NAME); + then(); display("Output context", context); assertTrue(context.getFocusContext().getPrimaryDelta().getChangeType() == ChangeType.MODIFY); diff --git a/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestReconScript.java b/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestReconScript.java index 1fbea682b71..dacc10e3118 100644 --- a/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestReconScript.java +++ b/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestReconScript.java @@ -210,7 +210,7 @@ public void test006TestReconDelete() throws Exception{ repositoryService.modifyObject(TaskType.class, TASK_RECON_DUMMY_OID, modifications, parentResult); // WHEN - when(TEST_NAME); + when(); waitForTaskStart(TASK_RECON_DUMMY_OID, false); @@ -219,7 +219,7 @@ public void test006TestReconDelete() throws Exception{ waitForTaskFinish(TASK_RECON_DUMMY_OID, false); // THEN - then(TEST_NAME); + then(); PrismObject shadow = repositoryService.getObject(ShadowType.class, ACCOUNT_BEFORE_SCRIPT_OID, null, parentResult); ShadowAsserter.forShadow(shadow) diff --git a/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/misc/ShadowIntegrityCheckerTest.java b/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/misc/ShadowIntegrityCheckerTest.java index 2cf2e2b294b..1946f65eb3d 100644 --- a/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/misc/ShadowIntegrityCheckerTest.java +++ b/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/misc/ShadowIntegrityCheckerTest.java @@ -80,11 +80,11 @@ public void test100FixDuplicatesWithDifferentObjectClasses() throws Exception { repoAddObjectFromFile(TASK_SHADOW_INTEGRITY_CHECK_FILE, result); // WHEN - when(TEST_NAME); + when(); waitForTaskCloseOrSuspend(TASK_SHADOW_INTEGRITY_CHECK_OID); // THEN - then(TEST_NAME); + then(); PrismObject taskAfter = getTask(TASK_SHADOW_INTEGRITY_CHECK_OID); display("task after", taskAfter); diff --git a/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/sync/TestSynchronizationService.java b/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/sync/TestSynchronizationService.java index 079fcc25b49..c6ba6e0e3a9 100644 --- a/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/sync/TestSynchronizationService.java +++ b/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/sync/TestSynchronizationService.java @@ -160,11 +160,11 @@ public void test020ModifyLootAbsolute() throws Exception { change.setSourceChannel(SchemaConstants.CHANGE_CHANNEL_LIVE_SYNC_URI); // WHEN - when(TEST_NAME); + when(); synchronizationService.notifyChange(change, task, result); // THEN - then(TEST_NAME); + then(); LensContext context = cleanDebugListener(); display("Resulting context (as seen by debug listener)", context); @@ -357,11 +357,11 @@ public void test039DeletedAccountJack() throws Exception { change.setObjectDelta(syncDelta); // WHEN - when(TEST_NAME); + when(); synchronizationService.notifyChange(change, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); LensContext context = cleanDebugListener(); @@ -430,11 +430,11 @@ public void test050AddedAccountCalypso() throws Exception { change.setResource(getDummyResourceObject()); // WHEN - when(TEST_NAME); + when(); synchronizationService.notifyChange(change, task, result); // THEN - then(TEST_NAME); + then(); LensContext context = cleanDebugListener(); display("Resulting context (as seen by debug listener)", context); @@ -477,11 +477,11 @@ public void test051CalypsoRecon() throws Exception { display("Change notification", change); // WHEN - when(TEST_NAME); + when(); synchronizationService.notifyChange(change, task, result); // THEN - then(TEST_NAME); + then(); LensContext context = cleanDebugListener(); display("Resulting context (as seen by debug listener)", context); @@ -527,11 +527,11 @@ public void test100AddedAccountJack() throws Exception { change.setResource(getDummyResourceObject()); // WHEN - when(TEST_NAME); + when(); synchronizationService.notifyChange(change, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); LensContext context = cleanDebugListener(); @@ -590,11 +590,11 @@ public void test199DeletedAccountJackTotal() throws Exception { repositoryService.deleteObject(ShadowType.class, accountShadowJackDummyOid, result); // WHEN - when(TEST_NAME); + when(); synchronizationService.notifyChange(change, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result, 1); LensContext context = cleanDebugListener(); @@ -657,11 +657,11 @@ public void test200AddedAccountJackSchemaViolation() throws Exception { change.setResource(getDummyResourceObject()); // WHEN - when(TEST_NAME); + when(); synchronizationService.notifyChange(change, task, result); // THEN - then(TEST_NAME); + then(); getDummyResource().resetBreakMode(); assertPartialError(result); @@ -720,11 +720,11 @@ public void test202UpdatedAccountJackSchemaViolation() throws Exception { change.setResource(getDummyResourceObject()); // WHEN - when(TEST_NAME); + when(); synchronizationService.notifyChange(change, task, result); // THEN - then(TEST_NAME); + then(); getDummyResource().resetBreakMode(); assertPartialError(result); @@ -772,11 +772,11 @@ public void test210AssignJackDummy() throws Exception { getDummyResource().resetBreakMode(); // WHEN - when(TEST_NAME); + when(); assignAccount(UserType.class, USER_JACK_OID, RESOURCE_DUMMY_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); LensContext context = cleanDebugListener(); @@ -820,11 +820,11 @@ public void test212AssignJackDummyLimited() throws Exception { getDummyResource().resetBreakMode(); // WHEN - when(TEST_NAME); + when(); assignAccount(UserType.class, USER_JACK_OID, RESOURCE_DUMMY_LIMITED_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); LensContext context = cleanDebugListener(); @@ -897,11 +897,11 @@ public void test214UpdatedAccountJackLimited() throws Exception { getDummyResource().setBreakMode(BreakMode.ASSERTION_ERROR); // WHEN - when(TEST_NAME); + when(); synchronizationService.notifyChange(change, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); getDummyResource().resetBreakMode(); @@ -975,11 +975,11 @@ public void test300AddedGroupPirates() throws Exception { change.setResource(getDummyResourceObject()); // WHEN - when(TEST_NAME); + when(); synchronizationService.notifyChange(change, task, result); // THEN - when(TEST_NAME); + when(); result.computeStatus(); TestUtil.assertSuccess(result); diff --git a/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/visualizer/TestVisualizer.java b/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/visualizer/TestVisualizer.java index e0321310816..967ff147547 100644 --- a/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/visualizer/TestVisualizer.java +++ b/model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/visualizer/TestVisualizer.java @@ -75,11 +75,11 @@ public void test100UserBasic() throws Exception { u.asObjectable().setFullName(new PolyStringType("User User123")); /// WHEN - when(TEST_NAME); + when(); final Scene scene = visualizer.visualize(u, task, task.getResult()); // THEN - then(TEST_NAME); + then(); display("scene", scene); // TODO some asserts @@ -113,11 +113,11 @@ public void test110UserWithContainers() throws Exception { ut.getAssignment().add(ass3); /// WHEN - when(TEST_NAME); + when(); final Scene scene = visualizer.visualize(u, task, task.getResult()); // THEN - then(TEST_NAME); + then(); display("scene", scene); // TODO some asserts @@ -133,11 +133,11 @@ public void test200UserDeltaBasic() throws Exception { .asObjectDelta(USER_ADMINISTRATOR_OID); /// WHEN - when(TEST_NAME); + when(); final Scene scene = visualizer.visualizeDelta((ObjectDelta) delta, task, task.getResult()); // THEN - then(TEST_NAME); + then(); display("scene", scene); // TODO some asserts @@ -163,11 +163,11 @@ public void test210UserDeltaContainers() throws Exception { .asObjectDelta(USER_ADMINISTRATOR_OID); /// WHEN - when(TEST_NAME); + when(); final Scene scene = visualizer.visualizeDelta((ObjectDelta) delta, task, task.getResult()); // THEN - then(TEST_NAME); + then(); display("scene", scene); // TODO some asserts @@ -184,11 +184,11 @@ public void test212UserDeltaContainerSimple() throws Exception { .asObjectDelta(USER_ADMINISTRATOR_OID); /// WHEN - when(TEST_NAME); + when(); final List scenes = visualizer.visualizeDeltas((List) Collections.singletonList(delta), task, task.getResult()); // THEN - then(TEST_NAME); + then(); display("scenes", scenes); // TODO some asserts @@ -215,11 +215,11 @@ public void test220UserContainerReplace() throws Exception { .asObjectDelta(USER_ADMINISTRATOR_OID); /// WHEN - when(TEST_NAME); + when(); final Scene scene = visualizer.visualizeDelta((ObjectDelta) delta, task, task.getResult()); // THEN - then(TEST_NAME); + then(); display("scene", scene); // TODO some asserts @@ -242,11 +242,11 @@ public void test230UserContainerDelete() throws Exception { .asObjectDelta(USER_ADMINISTRATOR_OID); /// WHEN - when(TEST_NAME); + when(); final Scene scene = visualizer.visualizeDelta((ObjectDelta) delta, task, task.getResult()); // THEN - then(TEST_NAME); + then(); display("scene", scene); // TODO some asserts @@ -271,7 +271,7 @@ public void test300UserAssignmentPreview() throws Exception { delta.applyDefinitionIfPresent(jack.getDefinition(), false); /// WHEN - when(TEST_NAME); + when(); ModelContext modelContext = modelInteractionService.previewChanges(Collections.>singletonList(delta), null, task, task.getResult()); List> primaryDeltas = new ArrayList<>(); List> secondaryDeltas = new ArrayList<>(); @@ -281,7 +281,7 @@ public void test300UserAssignmentPreview() throws Exception { List secondaryScenes = modelInteractionService.visualizeDeltas(secondaryDeltas, task, task.getResult()); // THEN - then(TEST_NAME); + then(); display("primary scenes", primaryScenes); display("secondary scenes", secondaryScenes); @@ -304,13 +304,13 @@ public void test305UserAssignmentAdd() throws Exception { .asObjectDelta(USER_JACK_OID); /// WHEN - when(TEST_NAME); + when(); final Scene scene = visualizer.visualizeDelta(delta, task, task.getResult()); modelService.executeChanges(Collections.>singletonList(delta), null, task, task.getResult()); // THEN - then(TEST_NAME); + then(); display("scene", scene); display("jack with assignment", getUser(USER_JACK_OID)); @@ -327,7 +327,7 @@ public void test307UserDisablePreview() throws Exception { .asObjectDelta(USER_JACK_OID); /// WHEN - when(TEST_NAME); + when(); ModelContext modelContext = modelInteractionService.previewChanges(Collections.>singletonList(delta), null, task, task.getResult()); List> primaryDeltas = new ArrayList<>(); List> secondaryDeltas = new ArrayList<>(); @@ -337,7 +337,7 @@ public void test307UserDisablePreview() throws Exception { List secondaryScenes = modelInteractionService.visualizeDeltas(secondaryDeltas, task, task.getResult()); // THEN - then(TEST_NAME); + then(); display("primary scenes", primaryScenes); display("secondary scenes", secondaryScenes); @@ -376,11 +376,11 @@ public void test310UserLinkRefDelete() throws Exception { .asObjectDelta(USER_JACK_OID); /// WHEN - when(TEST_NAME); + when(); final Scene scene = visualizer.visualizeDelta(delta, task, task.getResult()); // THEN - then(TEST_NAME); + then(); display("scene", scene); // TODO some asserts @@ -396,11 +396,11 @@ public void test320UserLinkRefAdd() throws Exception { .asObjectDelta(USER_JACK_OID); /// WHEN - when(TEST_NAME); + when(); final Scene scene = visualizer.visualizeDelta(delta, task, task.getResult()); // THEN - then(TEST_NAME); + then(); display("scene", scene); // TODO some asserts @@ -416,11 +416,11 @@ public void test330UserLinkRefReplaceNoOp() throws Exception { .asObjectDelta(USER_JACK_OID); /// WHEN - when(TEST_NAME); + when(); final Scene scene = visualizer.visualizeDelta(delta, task, task.getResult()); // THEN - then(TEST_NAME); + then(); display("scene", scene); // TODO some asserts @@ -436,11 +436,11 @@ public void test340UserLinkRefReplaceOp() throws Exception { .asObjectDelta(USER_JACK_OID); /// WHEN - when(TEST_NAME); + when(); final Scene scene = visualizer.visualizeDelta(delta, task, task.getResult()); // THEN - then(TEST_NAME); + then(); display("scene", scene); // TODO some asserts diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestActivation.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestActivation.java index d3859cedadb..693be663603 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestActivation.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestActivation.java @@ -769,11 +769,11 @@ public void test118ModifyJackActivationUserAndAccount() throws Exception { XMLGregorianCalendar startTime = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess("executeChanges result", result); XMLGregorianCalendar endTime = clock.currentTimeXMLGregorianCalendar(); @@ -809,11 +809,11 @@ public void test120ModifyUserJackAssignAccountDummyRed() throws Exception { XMLGregorianCalendar startTime = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_JACK_OID, RESOURCE_DUMMY_RED_OID, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess("executeChanges result", result); XMLGregorianCalendar endTime = clock.currentTimeXMLGregorianCalendar(); @@ -867,11 +867,11 @@ public void test121ModifyJackUserAndAccountRed() throws Exception { XMLGregorianCalendar startTime = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess("executeChanges result", result); XMLGregorianCalendar endTime = clock.currentTimeXMLGregorianCalendar(); @@ -937,11 +937,11 @@ public void test138ModifyJackEnabled() throws Exception { assumeAssignmentPolicy(AssignmentPolicyEnforcementType.FULL); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, ACTIVATION_ADMINISTRATIVE_STATUS_PATH, task, result, ActivationStatusType.ENABLED); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess("executeChanges result", result); @@ -1006,11 +1006,11 @@ public void test140ModifyUserJackAssignAccountDummyRed() throws Exception { XMLGregorianCalendar startTime = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_JACK_OID, RESOURCE_DUMMY_RED_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTime = clock.currentTimeXMLGregorianCalendar(); @@ -1055,11 +1055,11 @@ public void test147ModifyUserJackUnassignAccountDummyRedRaw() throws Exception { ObjectDelta userDelta = createAccountAssignmentUserDelta(USER_JACK_OID, RESOURCE_DUMMY_RED_OID, null, false); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(MiscSchemaUtil.createCollection(userDelta), ModelExecuteOptions.createRaw(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userJack = getUser(USER_JACK_OID); @@ -1102,11 +1102,11 @@ public void test149RecomputeJack() throws Exception { XMLGregorianCalendar startTime = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTime = clock.currentTimeXMLGregorianCalendar(); @@ -1154,11 +1154,11 @@ public void test150ModifyUserJackAssignYellowAccount() throws Exception { XMLGregorianCalendar start = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, null, task, result); // THEN - then(TEST_NAME); + then(); XMLGregorianCalendar end = clock.currentTimeXMLGregorianCalendar(); assertSuccess(result); @@ -1198,11 +1198,11 @@ public void test151ReconcileJack() throws Exception { assumeAssignmentPolicy(AssignmentPolicyEnforcementType.FULL); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1241,12 +1241,12 @@ public void test152ModifyAccountsJackDisable() throws Exception { ObjectDelta yellowDelta = createModifyAccountShadowReplaceDelta(accountYellowOid, null, ACTIVATION_ADMINISTRATIVE_STATUS_PATH, ActivationStatusType.DISABLED); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(MiscSchemaUtil.createCollection(dummyDelta, yellowDelta), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userJack = getUser(USER_JACK_OID); @@ -1256,13 +1256,13 @@ public void test152ModifyAccountsJackDisable() throws Exception { checkAdminStatusFor15x(userJack, true, false, false); // WHEN (2) - now let's do a reconciliation on both resources - when(TEST_NAME); + when(); ObjectDelta innocentDelta = createModifyUserReplaceDelta(USER_JACK_OID, UserType.F_LOCALITY, userJack.asObjectable().getLocality().toPolyString()); modelService.executeChanges(MiscSchemaUtil.createCollection(innocentDelta), ModelExecuteOptions.createReconcile(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); assertSuccess("executeChanges result (after reconciliation)", result); @@ -1357,11 +1357,11 @@ public void test160ModifyUserJackAssignAccountKhaki() throws Exception { XMLGregorianCalendar start = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_JACK_OID, RESOURCE_DUMMY_KHAKI_OID, null, task, result); // THEN - then(TEST_NAME); + then(); XMLGregorianCalendar end = clock.currentTimeXMLGregorianCalendar(); result.computeStatus(); TestUtil.assertSuccess("executeChanges result", result); @@ -1891,11 +1891,11 @@ public void test230JackUnassignRepoRecompute() throws Exception { assertDummyAccount(RESOURCE_DUMMY_RED_NAME, ACCOUNT_JACK_DUMMY_USERNAME, "Jack Sparrow", true); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertDummyAccount(RESOURCE_DUMMY_RED_NAME, ACCOUNT_JACK_DUMMY_USERNAME, "Jack Sparrow", false); @@ -1913,11 +1913,11 @@ public void test231JackRecomputeReconcile() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, ModelExecuteOptions.createReconcile(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertDummyAccount(RESOURCE_DUMMY_RED_NAME, ACCOUNT_JACK_DUMMY_USERNAME, "Jack Sparrow", false); @@ -1953,11 +1953,11 @@ public void test240AddUserRappDraft() throws Exception { display("User before", userBefore); // WHEN - when(TEST_NAME); + when(); addObject(userBefore, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1994,11 +1994,11 @@ public void test241RecomputeRappDraft() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_RAPP_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2036,11 +2036,11 @@ public void test242RappAssignCaptain() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_RAPP_OID, ROLE_CAPTAIN_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2073,12 +2073,12 @@ public void test245ActivateRapp() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_RAPP_OID, UserType.F_LIFECYCLE_STATE, task, result, SchemaConstants.LIFECYCLE_ACTIVE); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2115,12 +2115,12 @@ public void test248DeactivateRapp() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_RAPP_OID, UserType.F_LIFECYCLE_STATE, task, result, SchemaConstants.LIFECYCLE_ARCHIVED); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2151,11 +2151,11 @@ public void test249DeleteUserRapp() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); deleteObject(UserType.class, USER_RAPP_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2183,12 +2183,12 @@ public void test300AddDummyGreenAccountMancomb() throws Exception { account.addAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_LOCATION_NAME, "Melee Island"); /// WHEN - when(TEST_NAME); + when(); getDummyResource(RESOURCE_DUMMY_GREEN_NAME).addAccount(account); // THEN - then(TEST_NAME); + then(); PrismObject accountMancomb = findAccountByUsername(ACCOUNT_MANCOMB_DUMMY_USERNAME, getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME)); display("Account shadow after", accountMancomb); @@ -2222,17 +2222,17 @@ public void test310ImportAccountsFromDummyGreen() throws Exception { assertNull("Unexpected user mancomb before import", userMancomb); // WHEN - when(TEST_NAME); + when(); modelService.importFromResource(RESOURCE_DUMMY_GREEN_OID, new QName(getDummyResourceController(RESOURCE_DUMMY_GREEN_NAME).getNamespace(), SchemaConstants.ACCOUNT_OBJECT_CLASS_LOCAL_NAME), task, result); // THEN - then(TEST_NAME); + then(); OperationResult subresult = result.getLastSubresult(); TestUtil.assertInProgress("importAccountsFromResource result", subresult); waitForTaskFinish(task, true, 40000); - then(TEST_NAME); + then(); userMancomb = findUserByUsername(ACCOUNT_MANCOMB_DUMMY_USERNAME); assertNotNull("No user mancomb after import", userMancomb); @@ -2611,11 +2611,11 @@ public void test600AddUser1() throws Exception { ObjectDelta addDelta = user1.createAddDelta(); // WHEN - when(TEST_NAME); + when(); Collection> executedChanges = executeChanges(addDelta, null, task, result); // THEN - then(TEST_NAME); + then(); user1 = getUser(ObjectDeltaOperation.findFocusDeltaOidInCollection(executedChanges)); display("User after change execution", user1); @@ -2699,11 +2699,11 @@ public void test700ModifyJackRemoveAdministrativeStatus() throws Exception { PrismAsserts.assertNoItem(userBefore, SchemaConstants.PATH_ACTIVATION_VALID_TO); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, SchemaConstants.PATH_ACTIVATION_ADMINISTRATIVE_STATUS, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2745,11 +2745,11 @@ public void test702ModifyJackFuneralTimestampBeforeNow() throws Exception { XMLGregorianCalendar hourAgo = XmlTypeConverter.createXMLGregorianCalendar(clock.currentTimeMillis() - 60 * 60 * 1000); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, getExtensionPath(PIRACY_FUNERAL_TIMESTAMP), task, result, hourAgo); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2788,11 +2788,11 @@ public void test704ModifyJackFuneralTimestampAfterNow() throws Exception { XMLGregorianCalendar hourAhead = XmlTypeConverter.createXMLGregorianCalendar(clock.currentTimeMillis() + 60 * 60 * 1000); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, getExtensionPath(PIRACY_FUNERAL_TIMESTAMP), task, result, hourAhead); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -2840,11 +2840,11 @@ public void test750AddAndDeleteUserWithPrecreate() throws Exception { assertSuccess(result); // WHEN - when(TEST_NAME); + when(); deleteObject(UserType.class, oid, task, result); // THEN - then(TEST_NAME); + then(); // There's a hidden FATAL_ERROR when unlinking deleted shadow (benign ... but it prevents us from asserting success tree-wide) //assertSuccess(result); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestAudit.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestAudit.java index b1b276cf692..2c542850a86 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestAudit.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestAudit.java @@ -137,12 +137,12 @@ public void test100ModifyUserJackKid() throws Exception { initialTs = getTimeSafely(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_TITLE, task, result, createPolyString("Kid")); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -169,12 +169,12 @@ public void test105CreateUserHerman() throws Exception { hermanInitialTs = getTimeSafely(); // WHEN - when(TEST_NAME); + when(); addObject(userHermanBefore, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -201,12 +201,12 @@ public void test110ModifyUserJackSailor() throws Exception { ActivationStatusType.DISABLED); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(MiscSchemaUtil.createCollection(objectDelta), null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -231,12 +231,12 @@ public void test115ModifyUserHermanMarooned() throws Exception { objectDelta.addModification(createAssignmentModification(RESOURCE_DUMMY_OID, ShadowKindType.ACCOUNT, null, true)); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(MiscSchemaUtil.createCollection(objectDelta), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject user = getUser(USER_HERMAN_OID); @@ -262,12 +262,12 @@ public void test120ModifyUserJackCaptain() throws Exception { ActivationStatusType.ENABLED); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(MiscSchemaUtil.createCollection(objectDelta), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); jackCaptainTs = getTimeSafely(); @@ -297,13 +297,13 @@ public void test125ModifyUserHermanHermit() throws Exception { null, null, null, true)); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(MiscSchemaUtil.createCollection(objectDelta), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject user = getUser(USER_HERMAN_OID); @@ -328,13 +328,13 @@ public void test135ModifyUserHermanCivilisedHermit() throws Exception { null, null, null, false)); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(MiscSchemaUtil.createCollection(objectDelta), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject user = getUser(USER_HERMAN_OID); @@ -358,13 +358,13 @@ public void test200ReconstructJackSailor() throws Exception { PrismAsserts.assertPropertyValue(userBefore, UserType.F_TITLE, createPolyString("Captain")); // WHEN - when(TEST_NAME); + when(); PrismObject jackReconstructed = modelAuditService.reconstructObject(UserType.class, USER_JACK_OID, jackSailorEid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Reconstructed jack", jackReconstructed); @@ -388,13 +388,13 @@ public void test210ReconstructJackKid() throws Exception { PrismAsserts.assertPropertyValue(userBefore, UserType.F_TITLE, createPolyString("Captain")); // WHEN - when(TEST_NAME); + when(); PrismObject jackReconstructed = modelAuditService.reconstructObject(UserType.class, USER_JACK_OID, jackKidEid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Reconstructed jack", jackReconstructed); @@ -423,13 +423,13 @@ public void test250ReconstructHermanCreated() throws Exception { assertAssignments(userBefore, 1); // WHEN - when(TEST_NAME); + when(); PrismObject hermanReconstructed = modelAuditService.reconstructObject(UserType.class, USER_HERMAN_OID, hermanCreatedEid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Reconstructed herman", hermanReconstructed); @@ -454,13 +454,13 @@ public void test252ReconstructHermanMarooned() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); PrismObject hermanReconstructed = modelAuditService.reconstructObject(UserType.class, USER_HERMAN_OID, hermanMaroonedEid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Reconstructed herman", hermanReconstructed); @@ -486,13 +486,13 @@ public void test254ReconstructHermanHermit() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); PrismObject hermanReconstructed = modelAuditService.reconstructObject(UserType.class, USER_HERMAN_OID, hermanHermitEid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Reconstructed herman", hermanReconstructed); @@ -516,7 +516,7 @@ public void test300QueryUnknown() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); AuditEventRecord record = new AuditEventRecord(AuditEventType.SYNCHRONIZATION, AuditEventStage.EXECUTION); record.setOutcome(OperationResultStatus.UNKNOWN); @@ -527,7 +527,7 @@ public void test300QueryUnknown() throws Exception { List records = modelAuditService.listRecords("select * from m_audit_event as aer where aer.outcome = :outcome", params, task, result); // THEN - then(TEST_NAME); + then(); display("records", records); assertEquals("Wrong # of records", 1, records.size()); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestCaseIgnore.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestCaseIgnore.java index b633cd98702..630832a6d11 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestCaseIgnore.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestCaseIgnore.java @@ -118,11 +118,11 @@ public void test131ModifyUserJackAssignAccount() throws Exception { XMLGregorianCalendar startTime = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); executeChanges(accountAssignmentUserDelta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTime = clock.currentTimeXMLGregorianCalendar(); assertCounterIncrement(InternalCounters.CONNECTOR_INSTANCE_INITIALIZATION_COUNT, 0); // MID-4779 @@ -172,7 +172,7 @@ public void test133SeachAccountShadows() throws Exception { rememberCounter(InternalCounters.SHADOW_FETCH_OPERATION_COUNT); // WHEN - when(TEST_NAME); + when(); SearchResultList> foundShadows = modelService.searchObjects(ShadowType.class, query, null, task, result); // THEN @@ -264,7 +264,7 @@ public void test150JackAssignRoleX() throws Exception { assignRole(USER_JACK_OID, ROLE_X_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -307,7 +307,7 @@ public void test152GetJack() throws Exception { PrismObject userJack = modelService.getObject(UserType.class, USER_JACK_OID, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -351,7 +351,7 @@ public void test159JackUnAssignRoleX() throws Exception { unassignRole(USER_JACK_OID, ROLE_X_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -379,11 +379,11 @@ public void test160JackAssignRoleBasic() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_UPCASE_BASIC_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -427,11 +427,11 @@ public void test161JackAssignRoleJoker() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_JOKER_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -479,11 +479,11 @@ public void test165JackUnAssignRoleJoker() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_JOKER_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -527,11 +527,11 @@ public void test169JackUnAssignRoleBasic() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_UPCASE_BASIC_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -561,11 +561,11 @@ public void test170JackAssignRoleJoker() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_JOKER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); // Make sure this is repository so we do not destroy the "evidence" yet. @@ -608,11 +608,11 @@ public void test179JackUnAssignRoleJoker() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_JOKER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); // Make sure this is repository so we do not destroy the "evidence" yet. @@ -662,11 +662,11 @@ public void test200GuybrushAssignRoleFools() throws Exception { assertShadows(4); // WHEN - when(TEST_NAME); + when(); assignRole(USER_GUYBRUSH_OID, ROLE_FOOL_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertShadows(6); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestConsistencySimple.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestConsistencySimple.java index 984a5eb11f7..a328bd9bbec 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestConsistencySimple.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestConsistencySimple.java @@ -198,7 +198,7 @@ private void executeTest(final String TEST_NAME, FocusOperation focusOperation, result = task.getResult(); // WHEN - when(TEST_NAME); + when(); switch (focusOperation) { case RECOMPUTE: recomputeUser(USER_JACK_OID, task, result); @@ -213,7 +213,7 @@ private void executeTest(final String TEST_NAME, FocusOperation focusOperation, } // THEN - then(TEST_NAME); + then(); result.computeStatus(); display("Result", result); if (ASSERT_SUCCESS) { diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestDeputy.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestDeputy.java index 7dfec2c6dcc..08282141cc0 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestDeputy.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestDeputy.java @@ -79,12 +79,12 @@ public void test100AssignDeputyNoBigDeal() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignDeputy(USER_BARBOSSA_OID, USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -115,12 +115,12 @@ public void test109UnassignDeputyNoBigDeal() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignDeputy(USER_BARBOSSA_OID, USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -150,12 +150,12 @@ public void test110AssignJackPirate() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_PIRATE_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -187,12 +187,12 @@ public void test112AssignDeputyPirate() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignDeputy(USER_BARBOSSA_OID, USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -229,12 +229,12 @@ public void test119UnassignDeputyPirate() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignDeputy(USER_BARBOSSA_OID, USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -270,12 +270,12 @@ public void test120AssignbarbossaDeputyOfGuybrush() throws Exception { assertLinks(userGuybrushBefore, 1); // WHEN - when(TEST_NAME); + when(); assignDeputy(USER_BARBOSSA_OID, USER_GUYBRUSH_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -308,12 +308,12 @@ public void test122AssignGuybrushPirate() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_GUYBRUSH_OID, ROLE_PIRATE_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -346,12 +346,12 @@ public void test124RecomputeBarbossa() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_BARBOSSA_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -386,12 +386,12 @@ public void test126UnassignGuybrushPirate() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_GUYBRUSH_OID, ROLE_PIRATE_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -424,12 +424,12 @@ public void test128RecomputeBarbossa() throws Exception { assumeAssignmentPolicy(AssignmentPolicyEnforcementType.FULL); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_BARBOSSA_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -456,12 +456,12 @@ public void test129UnassignBarbossaDeputyOfGuybrush() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignDeputy(USER_BARBOSSA_OID, USER_GUYBRUSH_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -507,12 +507,12 @@ public void test150AssignJackMoreRoles() throws Exception { null, null, (ActivationType) null, true))); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(MiscSchemaUtil.createCollection(userDelta), null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -544,14 +544,14 @@ public void test152AssignbarbossaDeputyLimitedDeputy() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignDeputyLimits(USER_BARBOSSA_OID, USER_JACK_OID, task, result, createRoleReference(ROLE_PIRATE_OID), createOrgReference(ORG_MINISTRY_OF_RUM_OID, SchemaConstants.ORG_MANAGER)); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -580,14 +580,14 @@ public void test154UnassignbarbossaDeputyLimitedDeputy() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignDeputyLimits(USER_BARBOSSA_OID, USER_JACK_OID, task, result, createRoleReference(ROLE_PIRATE_OID), createOrgReference(ORG_MINISTRY_OF_RUM_OID, SchemaConstants.ORG_MANAGER)); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -613,7 +613,7 @@ public void test156AssignbarbossaDeputyLimitedDeputyRed() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignDeputyLimits(USER_BARBOSSA_OID, USER_JACK_OID, task, result, createRoleReference(ROLE_RED_SAILOR_OID), @@ -621,7 +621,7 @@ public void test156AssignbarbossaDeputyLimitedDeputyRed() throws Exception { ); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -653,7 +653,7 @@ public void test159UnassignbarbossaDeputyLimitedDeputyRed() throws Exception { XMLGregorianCalendar startTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); unassignDeputyLimits(USER_BARBOSSA_OID, USER_JACK_OID, task, result, createRoleReference(ROLE_RED_SAILOR_OID), @@ -661,7 +661,7 @@ public void test159UnassignbarbossaDeputyLimitedDeputyRed() throws Exception { ); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -691,14 +691,14 @@ public void test160AssignbarbossaDeputyLimitedDeputyEmpty() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignDeputyLimits(USER_BARBOSSA_OID, USER_JACK_OID, task, result, createRoleReference(ROLE_EMPTY_OID) ); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -730,14 +730,14 @@ public void test162UnassignbarbossaDeputyLimitedDeputyEmpty() throws Exception { XMLGregorianCalendar startTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); unassignDeputyLimits(USER_BARBOSSA_OID, USER_JACK_OID, task, result, createRoleReference(ROLE_EMPTY_OID) ); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTs = clock.currentTimeXMLGregorianCalendar(); @@ -769,11 +769,11 @@ public void test170AddRoleDrinker() throws Exception { display("Adding role", role); // WHEN - when(TEST_NAME); + when(); addObject(role, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject roleAfter = getObject(RoleType.class, ROLE_DRINKER_OID); @@ -790,11 +790,11 @@ public void test172AssignJackRoleDrinker() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_DRINKER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userJackAfter = getUser(USER_JACK_OID); @@ -819,14 +819,14 @@ public void test174AssignBarbossaDeputyLimitedDeputyDrinker() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignDeputyLimits(USER_BARBOSSA_OID, USER_JACK_OID, task, result, createRoleReference(ROLE_DRINKER_OID) ); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userJackAfter = getUser(USER_JACK_OID); @@ -865,7 +865,7 @@ public void test176AssignbarGuybrushLimitedDeputyOfBarbossa() throws Exception { // WHEN - when(TEST_NAME); + when(); assignDeputyLimits(USER_GUYBRUSH_OID, USER_BARBOSSA_OID, assignment -> assignment.beginLimitTargetContent().allowTransitive(true), @@ -874,7 +874,7 @@ public void test176AssignbarGuybrushLimitedDeputyOfBarbossa() throws Exception { ); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userGuybrushAfter = getUser(USER_GUYBRUSH_OID); @@ -897,14 +897,14 @@ public void test178UnassignBarbossaDeputyLimitedDeputyDrinker() throws Exception XMLGregorianCalendar startTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); unassignDeputyLimits(USER_BARBOSSA_OID, USER_JACK_OID, task, result, createRoleReference(ROLE_DRINKER_OID) ); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -940,7 +940,7 @@ public void test179UnassignbarGuybrushLimitedDeputyOfBarbossa() throws Exception OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignDeputyLimits(USER_GUYBRUSH_OID, USER_BARBOSSA_OID, assignment -> assignment.beginLimitTargetContent().allowTransitive(true), @@ -949,7 +949,7 @@ public void test179UnassignbarGuybrushLimitedDeputyOfBarbossa() throws Exception ); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userGuybrushAfter = getUser(USER_GUYBRUSH_OID); @@ -968,12 +968,12 @@ public void test180AssignBarbossaDeputyOfJack() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignDeputy(USER_BARBOSSA_OID, USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userBarbossaAfter = getUser(USER_BARBOSSA_OID); @@ -1004,14 +1004,14 @@ public void test182AssignGuybrushLimitedDeputyOfBarbossa() throws Exception { // WHEN - when(TEST_NAME); + when(); assignDeputyLimits(USER_GUYBRUSH_OID, USER_BARBOSSA_OID, task, result, createRoleReference(ROLE_DRINKER_OID) ); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userGuybrushAfter = getUser(USER_GUYBRUSH_OID); @@ -1031,14 +1031,14 @@ public void test184UnassignGuybrushLimitedDeputyOfBarbossa() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignDeputyLimits(USER_GUYBRUSH_OID, USER_BARBOSSA_OID, task, result, createRoleReference(ROLE_DRINKER_OID) ); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userGuybrushAfter = getUser(USER_GUYBRUSH_OID); @@ -1067,12 +1067,12 @@ public void test186AssignGuybrushDeputyOfBarbossa() throws Exception { // WHEN - when(TEST_NAME); + when(); assignDeputy(USER_GUYBRUSH_OID, USER_BARBOSSA_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userGuybrushAfter = getUser(USER_GUYBRUSH_OID); @@ -1092,12 +1092,12 @@ public void test188UnassignGuybrushDeputyOfBarbossa() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignDeputy(USER_GUYBRUSH_OID, USER_BARBOSSA_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userGuybrushAfter = getUser(USER_GUYBRUSH_OID); @@ -1115,12 +1115,12 @@ public void test189UnassignBarbossaDeputyOfJack() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignDeputy(USER_BARBOSSA_OID, USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userBarbossaAfter = getUser(USER_BARBOSSA_OID); @@ -1138,7 +1138,7 @@ public void test190AssignBarbossaDeputyLimitedDeputyEmptyDrinker() throws Except OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignDeputyLimits(USER_BARBOSSA_OID, USER_JACK_OID, task, result, createRoleReference(ROLE_EMPTY_OID), @@ -1146,7 +1146,7 @@ public void test190AssignBarbossaDeputyLimitedDeputyEmptyDrinker() throws Except ); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1178,7 +1178,7 @@ public void test192UnassignbarbossaDeputyLimitedDeputyEmptyDrinker() throws Exce XMLGregorianCalendar startTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); unassignDeputyLimits(USER_BARBOSSA_OID, USER_JACK_OID, task, result, createRoleReference(ROLE_EMPTY_OID), @@ -1186,7 +1186,7 @@ public void test192UnassignbarbossaDeputyLimitedDeputyEmptyDrinker() throws Exce ); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTs = clock.currentTimeXMLGregorianCalendar(); @@ -1220,14 +1220,14 @@ public void test800ImportValidityScannerTask() throws Exception { XMLGregorianCalendar startCal = clock.currentTimeXMLGregorianCalendar(); /// WHEN - when(TEST_NAME); + when(); importObjectFromFile(TASK_VALIDITY_SCANNER_FILENAME); waitForTaskStart(TASK_VALIDITY_SCANNER_OID, false); waitForTaskFinish(TASK_VALIDITY_SCANNER_OID, true); // THEN - then(TEST_NAME); + then(); XMLGregorianCalendar endCal = clock.currentTimeXMLGregorianCalendar(); assertLastScanTimestamp(TASK_VALIDITY_SCANNER_OID, startCal, endCal); } @@ -1255,13 +1255,13 @@ public void test802AssignBarbossaDeputyOfJack() throws Exception { activationType.setValidTo(XmlTypeConverter.addDuration(startTs, "PT2H")); // WHEN - when(TEST_NAME); + when(); assignDeputy(USER_BARBOSSA_OID, USER_JACK_OID, assignment -> assignment.setActivation(activationType), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTs = clock.currentTimeXMLGregorianCalendar(); @@ -1301,12 +1301,12 @@ public void test804BarbosaThreeHoursLater() throws Exception { XMLGregorianCalendar startTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); waitForTaskNextRunAssertSuccess(TASK_VALIDITY_SCANNER_OID, true); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTs = clock.currentTimeXMLGregorianCalendar(); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestEntitlements.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestEntitlements.java index c2246560801..e55a004f50a 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestEntitlements.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestEntitlements.java @@ -204,11 +204,11 @@ public void test110AssociateGuybrushToSwashbucklers() throws Exception { SHADOW_GROUP_DUMMY_SWASHBUCKLERS_OID, prismContext); // WHEN - when(TEST_NAME); + when(); executeChanges(delta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertDummyGroupByName(null, GROUP_DUMMY_SWASHBUCKLERS_NAME) @@ -224,11 +224,11 @@ public void test200AssignRoleSwashbucklerToJack() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_SWASHBUCKLER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -254,11 +254,11 @@ public void test209UnAssignRoleSwashbucklerFromJack() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_SWASHBUCKLER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -321,11 +321,11 @@ public void test222AssignRoleMapmakerToWally() throws Exception { PrismObject user = findUserByUsername(USER_WALLY_NAME); // WHEN - when(TEST_NAME); + when(); assignRole(user.getOid(), ROLE_MAPMAKER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertGroupMember(GROUP_DUMMY_LANDLUBERS_NAME, USER_WALLY_NAME, getDummyResource()); @@ -360,11 +360,11 @@ public void test224UnassignRoleMapmakerFromWally() throws Exception { PrismObject user = findUserByUsername(USER_WALLY_NAME); // WHEN - when(TEST_NAME); + when(); unassignRole(user.getOid(), ROLE_MAPMAKER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); DummyGroup dummyGroup = getDummyResource().getGroupByName(GROUP_DUMMY_MAPMAKERS_NAME); @@ -382,11 +382,11 @@ public void test300AddRoleWimp() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); addObject(ROLE_WIMP_FILE, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); DummyGroup dummyGroup = getDummyResource().getGroupByName(GROUP_DUMMY_WIMPS_NAME); @@ -414,11 +414,11 @@ public void test302AddRoleBrute() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); addObject(ROLE_BRUTE_FILE, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -441,11 +441,11 @@ public void test304AddRoleThug() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); addObject(ROLE_THUG_FILE, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -470,11 +470,11 @@ public void test310AssignRoleWimpToLargo() throws Exception { addObject(USER_LARGO_FILE); // WHEN - when(TEST_NAME); + when(); assignRole(USER_LARGO_OID, ROLE_WIMP_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -494,11 +494,11 @@ public void test312AssignRoleBruteToLargo() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_LARGO_OID, ROLE_BRUTE_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -518,11 +518,11 @@ public void test313UnAssignRoleBruteFromLargo() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_LARGO_OID, ROLE_BRUTE_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -552,11 +552,11 @@ public void test314AssignRoleThugToLargo() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_LARGO_OID, ROLE_THUG_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -576,11 +576,11 @@ public void test315UnAssignRoleThugFromLargo() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_LARGO_OID, ROLE_THUG_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -613,11 +613,11 @@ public void test317RenameLargo() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_LARGO_OID, UserType.F_NAME, task, result, PrismTestUtil.createPolyString("newLargo")); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -644,11 +644,11 @@ public void test319UnassignRoleWimpFromLargo() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_LARGO_OID, ROLE_WIMP_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -682,11 +682,11 @@ public void test320AssignRoleBruteToRapp() throws Exception { addObject(USER_RAPP_FILE); // WHEN - when(TEST_NAME); + when(); assignRole(USER_RAPP_OID, ROLE_BRUTE_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -706,11 +706,11 @@ public void test322AssignRoleWimpToRapp() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_RAPP_OID, ROLE_WIMP_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -737,11 +737,11 @@ public void test324AssignRoleThugToRapp() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_RAPP_OID, ROLE_THUG_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -775,11 +775,11 @@ public void test327UnassignRoleWimpFromRapp() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_RAPP_OID, ROLE_WIMP_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -816,11 +816,11 @@ public void test328UnassignRoleThugFromRapp() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_RAPP_OID, ROLE_THUG_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -860,11 +860,11 @@ public void test329UnAssignRoleBruteFromRapp() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_RAPP_OID, ROLE_BRUTE_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -898,12 +898,12 @@ public void test350AssignOrangeAccountToGuybrushAndRapp() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_GUYBRUSH_OID, RESOURCE_DUMMY_ORANGE_OID, null, task, result); assignAccountToUser(USER_RAPP_OID, RESOURCE_DUMMY_ORANGE_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); DummyAccount accountGuybrush = assertDummyAccount(RESOURCE_DUMMY_ORANGE_NAME, ACCOUNT_GUYBRUSH_DUMMY_USERNAME); @@ -930,11 +930,11 @@ public void test351AssignRoleCrewOfGuybrushToRapp() throws Exception { assertDummyAccount(RESOURCE_DUMMY_ORANGE_NAME, ACCOUNT_GUYBRUSH_DUMMY_USERNAME); // WHEN - when(TEST_NAME); + when(); assignRole(USER_RAPP_OID, ROLE_CREW_OF_GUYBRUSH_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userGuybrushAfter = getUser(USER_GUYBRUSH_OID); @@ -974,11 +974,11 @@ public void test358UnassignRoleCrewOfGuybrushToRapp() throws Exception { assertDummyAccount(RESOURCE_DUMMY_ORANGE_NAME, ACCOUNT_GUYBRUSH_DUMMY_USERNAME); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_RAPP_OID, ROLE_CREW_OF_GUYBRUSH_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userGuybrushAfter = getUser(USER_GUYBRUSH_OID); @@ -1006,12 +1006,12 @@ public void test359UnassignOrangeAccountFromGuybrushAndRapp() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignAccountFromUser(USER_GUYBRUSH_OID, RESOURCE_DUMMY_ORANGE_OID, null, task, result); unassignAccountFromUser(USER_RAPP_OID, RESOURCE_DUMMY_ORANGE_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertNoDummyAccount(RESOURCE_DUMMY_ORANGE_NAME, ACCOUNT_GUYBRUSH_DUMMY_USERNAME); @@ -1028,11 +1028,11 @@ public void test600AssignRolePirateToJack() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_PIRATE_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject user = getUser(USER_JACK_OID); @@ -1062,11 +1062,11 @@ public void test610AssignRoleSwashbucklerToJack() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_SWASHBUCKLER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject user = getUser(USER_JACK_OID); @@ -1095,11 +1095,11 @@ public void test620UnAssignSwashbucklerFromJack() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_SWASHBUCKLER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject user = getUser(USER_JACK_OID); @@ -1142,11 +1142,11 @@ public void test630AssignRoleSwashbucklerToJackValidity() throws Exception { jackSwashbucklerAssignmentActivation.setValidTo(validTo); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_SWASHBUCKLER_OID, jackSwashbucklerAssignmentActivation, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1276,11 +1276,11 @@ public void test659UnassignRoleSwashbucklerFromJack() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_SWASHBUCKLER_OID, jackSwashbucklerAssignmentActivation.clone(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1315,11 +1315,11 @@ public void test699UnassignRolePirateFromJack() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_PIRATE_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1351,11 +1351,11 @@ public void test700ReconcileGuybrush() throws Exception { assertGroupMember(getDummyGroup(null, GROUP_DUMMY_SWASHBUCKLERS_NAME), USER_GUYBRUSH_USERNAME); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_GUYBRUSH_OID, task, result); // THEN - then(TEST_NAME); + then(); dumpUserAndAccounts(getUser(USER_GUYBRUSH_OID), task, result); assertNoGroupMember(getDummyGroup(null, GROUP_DUMMY_SWASHBUCKLERS_NAME), USER_GUYBRUSH_USERNAME); @@ -1419,11 +1419,11 @@ public void test715AssociateGuybrushToThugs() throws Exception { ObjectDelta delta = ObjectDeltaCollectionsUtil.summarize(delta1, delta2); // WHEN - when(TEST_NAME); + when(); executeChanges(delta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertGroupMember(GROUP_THUG_NAME, ACCOUNT_GUYBRUSH_DUMMY_ORANGE_USERNAME, getDummyResource(RESOURCE_DUMMY_ORANGE_NAME)); @@ -1446,11 +1446,11 @@ public void test720ReconcileGuybrush() throws Exception { assertGroupMember(getDummyGroup(null, GROUP_DUMMY_LANDLUBERS_NAME), USER_GUYBRUSH_USERNAME); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_GUYBRUSH_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); dumpUserAndAccounts(getUser(USER_GUYBRUSH_OID), task, result); assertGroupMember(GROUP_DUMMY_LANDLUBERS_NAME, ACCOUNT_GUYBRUSH_DUMMY_USERNAME, getDummyResource()); @@ -1470,11 +1470,11 @@ public void test729CleanupGuybrush() throws Exception { PrismObject userBefore = dumpUserAndAccounts(USER_GUYBRUSH_OID); // WHEN - when(TEST_NAME); + when(); unassignAll(userBefore, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = dumpUserAndAccounts(USER_GUYBRUSH_OID); assertAssignments(userAfter, 0); @@ -1508,11 +1508,11 @@ public void test750PrepareGuybrushFuturePerfect() throws Exception { assertLinks(userBefore, 0); // WHEN - when(TEST_NAME); + when(); assignRole(USER_GUYBRUSH_OID, ROLE_ORG_GROUPING_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = dumpUserAndAccounts(USER_GUYBRUSH_OID); assertAssignments(userAfter, 1); @@ -1541,11 +1541,11 @@ public void test752GuybrushFuturePerfect() throws Exception { getDummyResourceController().addGroup(orgGroupName(OU_CLUB_SCI_FI)); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_GUYBRUSH_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = dumpUserAndAccounts(USER_GUYBRUSH_OID); assertAssignments(userAfter, 1); @@ -1566,11 +1566,11 @@ public void test759CleanupGuybrush() throws Exception { dumpUserAndAccounts(USER_GUYBRUSH_OID); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_GUYBRUSH_OID, ROLE_ORG_GROUPING_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = dumpUserAndAccounts(USER_GUYBRUSH_OID); assertAssignments(userAfter, 0); @@ -1594,11 +1594,11 @@ public void test760GuybrushOrgGroupsRepo() throws Exception { assertLinks(userBefore, 0); // WHEN - when(TEST_NAME); + when(); assignRole(USER_GUYBRUSH_OID, ROLE_ORG_GROUPING_REPO_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = dumpUserAndAccounts(USER_GUYBRUSH_OID); assertAssignments(userAfter, 1); @@ -1618,11 +1618,11 @@ public void test765ReconcileGuybrush() throws Exception { dummyAuditService.clear(); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_GUYBRUSH_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = dumpUserAndAccounts(USER_GUYBRUSH_OID); assertAssignments(userAfter, 1); @@ -1650,11 +1650,11 @@ public void test769CleanupGuybrush() throws Exception { dumpUserAndAccounts(USER_GUYBRUSH_OID); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_GUYBRUSH_OID, ROLE_ORG_GROUPING_REPO_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = dumpUserAndAccounts(USER_GUYBRUSH_OID); assertAssignments(userAfter, 0); @@ -1674,11 +1674,11 @@ public void test780AssignGuybrushSwashbuckler() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_GUYBRUSH_OID, ROLE_SWASHBUCKLER_OID, task, result); // THEN - then(TEST_NAME); + then(); dumpUserAndAccounts(getUser(USER_GUYBRUSH_OID), task, result); assertGroupMember(getDummyGroup(null, GROUP_DUMMY_SWASHBUCKLERS_NAME), USER_GUYBRUSH_USERNAME); @@ -1702,11 +1702,11 @@ public void test781GuybrushTheLostSwashbuckler() throws Exception { assertNoGroupMember(getDummyGroup(null, GROUP_DUMMY_SWASHBUCKLERS_NAME), USER_GUYBRUSH_USERNAME); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_GUYBRUSH_OID, task, result); // THEN - then(TEST_NAME); + then(); dumpUserAndAccounts(getUser(USER_GUYBRUSH_OID), task, result); assertGroupMember(getDummyGroup(null, GROUP_DUMMY_SWASHBUCKLERS_NAME), USER_GUYBRUSH_USERNAME); @@ -1721,11 +1721,11 @@ public void test784UnassignGuybrushSwashbuckler() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_GUYBRUSH_OID, ROLE_SWASHBUCKLER_OID, task, result); // THEN - then(TEST_NAME); + then(); dumpUserAndAccounts(getUser(USER_GUYBRUSH_OID), task, result); assertNoGroupMember(getDummyGroup(null, GROUP_DUMMY_SWASHBUCKLERS_NAME), USER_GUYBRUSH_USERNAME); @@ -1743,11 +1743,11 @@ public void test785AssignGuybrushBlueSwashbuckler() throws Exception { addObject(group, task, result); // WHEN - when(TEST_NAME); + when(); assignRole(USER_GUYBRUSH_OID, ROLE_SWASHBUCKLER_BLUE_OID, task, result); // THEN - then(TEST_NAME); + then(); dumpUserAndAccounts(getUser(USER_GUYBRUSH_OID), task, result); assertGroupMember(getDummyGroup(RESOURCE_DUMMY_BLUE_NAME, GROUP_DUMMY_SWASHBUCKLERS_NAME), USER_GUYBRUSH_USERNAME); @@ -1771,11 +1771,11 @@ public void test786GuybrushTheLostBlueSwashbuckler() throws Exception { assertNoGroupMember(getDummyGroup(RESOURCE_DUMMY_BLUE_NAME, GROUP_DUMMY_SWASHBUCKLERS_NAME), USER_GUYBRUSH_USERNAME); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_GUYBRUSH_OID, task, result); // THEN - then(TEST_NAME); + then(); dumpUserAndAccounts(getUser(USER_GUYBRUSH_OID), task, result); assertGroupMember(getDummyGroup(RESOURCE_DUMMY_BLUE_NAME, GROUP_DUMMY_SWASHBUCKLERS_NAME), USER_GUYBRUSH_USERNAME); @@ -1790,11 +1790,11 @@ public void test789UnassignGuybrushBlueSwashbuckler() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_GUYBRUSH_OID, ROLE_SWASHBUCKLER_BLUE_OID, task, result); // THEN - then(TEST_NAME); + then(); dumpUserAndAccounts(getUser(USER_GUYBRUSH_OID), task, result); assertNoGroupMember(getDummyGroup(RESOURCE_DUMMY_BLUE_NAME, GROUP_DUMMY_SWASHBUCKLERS_NAME), USER_GUYBRUSH_USERNAME); @@ -1817,11 +1817,11 @@ public void test800AssignRoleSwashbucklerToJackNone() throws Exception { assertJackClean(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_SWASHBUCKLER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1847,11 +1847,11 @@ public void test805ReconcileJackNone() throws Exception { assumeAssignmentPolicy(AssignmentPolicyEnforcementType.NONE); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1875,11 +1875,11 @@ public void test809UnAssignRoleSwashbucklerFromJackNone() throws Exception { assumeAssignmentPolicy(AssignmentPolicyEnforcementType.NONE); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_SWASHBUCKLER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1905,11 +1905,11 @@ public void test810AssignRoleSwashbucklerToJackPositive() throws Exception { assertJackClean(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_SWASHBUCKLER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1933,11 +1933,11 @@ public void test815ReconcileJackPositive() throws Exception { assumeAssignmentPolicy(AssignmentPolicyEnforcementType.POSITIVE); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1961,11 +1961,11 @@ public void test817UnAssignRoleSwashbucklerFromJackPositive() throws Exception { assumeAssignmentPolicy(AssignmentPolicyEnforcementType.POSITIVE); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_SWASHBUCKLER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1988,11 +1988,11 @@ public void test819ReconcileJackPositive() throws Exception { assumeAssignmentPolicy(AssignmentPolicyEnforcementType.POSITIVE); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -2023,11 +2023,11 @@ public void test820RecomputeJackFull() throws Exception { assertDefaultDummyAccount(ACCOUNT_JACK_DUMMY_USERNAME, ACCOUNT_JACK_DUMMY_FULLNAME, true); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -2053,11 +2053,11 @@ public void test822AssignRoleSwashbucklerToJackFull() throws Exception { assertJackClean(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_SWASHBUCKLER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -2081,11 +2081,11 @@ public void test825ReconcileJackFull() throws Exception { assumeAssignmentPolicy(AssignmentPolicyEnforcementType.FULL); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -2109,11 +2109,11 @@ public void test827UnAssignRoleSwashbucklerFromJackFull() throws Exception { assumeAssignmentPolicy(AssignmentPolicyEnforcementType.FULL); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_SWASHBUCKLER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -2136,11 +2136,11 @@ public void test829ReconcileJackFull() throws Exception { assumeAssignmentPolicy(AssignmentPolicyEnforcementType.FULL); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -2167,11 +2167,11 @@ public void test830AssignJackAccountDummy() throws Exception { assertJackClean(); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_JACK_OID, RESOURCE_DUMMY_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -2197,11 +2197,11 @@ public void test840AssignRoleSwashbucklerToJackNone() throws Exception { assertJackJustAccount(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_SWASHBUCKLER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -2225,11 +2225,11 @@ public void test849UnassignRoleSwashbucklerFromJackNone() throws Exception { assumeAssignmentPolicy(AssignmentPolicyEnforcementType.NONE); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_SWASHBUCKLER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -2255,11 +2255,11 @@ public void test850AssignRoleSwashbucklerToJackPositive() throws Exception { assertJackJustAccount(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_SWASHBUCKLER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -2283,11 +2283,11 @@ public void test859UnassignRoleSwashbucklerToJackPositive() throws Exception { assumeAssignmentPolicy(AssignmentPolicyEnforcementType.POSITIVE); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_SWASHBUCKLER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -2312,11 +2312,11 @@ public void test860RecomputeJackFull() throws Exception { assumeAssignmentPolicy(AssignmentPolicyEnforcementType.FULL); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -2342,11 +2342,11 @@ public void test862AssignRoleSwashbucklerToJackFull() throws Exception { assertJackJustAccount(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_SWASHBUCKLER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -2370,11 +2370,11 @@ public void test869UnassignRoleSwashbucklerToJackFull() throws Exception { assumeAssignmentPolicy(AssignmentPolicyEnforcementType.FULL); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_SWASHBUCKLER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -2397,11 +2397,11 @@ public void test899UnAssignAccountJackDummy() throws Exception { assumeAssignmentPolicy(AssignmentPolicyEnforcementType.FULL); // WHEN - when(TEST_NAME); + when(); unassignAccountFromUser(USER_JACK_OID, RESOURCE_DUMMY_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestInbounds.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestInbounds.java index dbb61ea263b..0ac1594591b 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestInbounds.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestInbounds.java @@ -62,11 +62,11 @@ public void test000Sanity() throws Exception { Task task = getTestTask(); // WHEN - when(TEST_NAME); + when(); OperationResult testResult = modelService.testResource(RESOURCE_DUMMY_ORANGE_OID, task); // THEN - then(TEST_NAME); + then(); TestUtil.assertSuccess("Test orange resource", testResult); DummyResource dummyResourceOrange = getDummyResource(RESOURCE_DUMMY_ORANGE_NAME); @@ -89,11 +89,11 @@ public void test101ModifyUserSubtypePirate() throws Exception { .createXMLGregorianCalendar(System.currentTimeMillis())); // WHEN - when(TEST_NAME); + when(); executeChanges(userDelta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); jackEmployeeNumber = assertUserAfter(USER_JACK_OID) @@ -128,11 +128,11 @@ public void test102ModifyUserSubtypeBuccaneer() throws Exception { USER_JACK_OID, UserType.F_SUBTYPE, "BUCCANEER"); // WHEN - when(TEST_NAME); + when(); executeChanges(userDelta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) @@ -202,11 +202,11 @@ public void test200AssignAccountOrange() throws Exception { display("User before", userBefore); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_GUYBRUSH_OID, RESOURCE_DUMMY_ORANGE_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -765,11 +765,11 @@ public void test264ModifyAccountOrangeQuoteWoodchuckRecon() throws Exception { display("Account orange before", dummyAccountBefore); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_GUYBRUSH_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -811,11 +811,11 @@ public void test297ModifyAccountOrangeGossipRecon() throws Exception { display("Account orange before", dummyAccountBefore); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_GUYBRUSH_OID, ROLE_THIEF_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -849,11 +849,11 @@ public void test299UnassignAccountOrange() throws Exception { assertAssignments(userBefore, 1); // WHEN - when(TEST_NAME); + when(); unassignAccountFromUser(USER_GUYBRUSH_OID, RESOURCE_DUMMY_ORANGE_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestIntent.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestIntent.java index 2d8521ef034..e6dc0fc48a9 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestIntent.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestIntent.java @@ -69,11 +69,11 @@ public void test131ModifyUserJackAssignAccountDefault() throws Exception { XMLGregorianCalendar startTime = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTime = clock.currentTimeXMLGregorianCalendar(); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 0); @@ -128,11 +128,11 @@ public void test132ModifyUserJackAssignAccountTest() throws Exception { XMLGregorianCalendar startTime = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTime = clock.currentTimeXMLGregorianCalendar(); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 1); @@ -193,11 +193,11 @@ public void test135ModifyUserJackFullName() throws Exception { preTestCleanup(AssignmentPolicyEnforcementType.RELATIVE); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_FULL_NAME, task, result, PrismTestUtil.createPolyString("cpt. Jack Sparrow")); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 2); @@ -261,11 +261,11 @@ public void test147ModifyUserJackUnAssignAccountDefault() throws Exception { XMLGregorianCalendar startTime = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTime = clock.currentTimeXMLGregorianCalendar(); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 1); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestIteration.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestIteration.java index ce2f1ccd008..06195eb4c2a 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestIteration.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestIteration.java @@ -244,11 +244,11 @@ public void test100JackAssignAccountDummyConflicting() throws Exception { ObjectDelta accountAssignmentUserDelta = createAccountAssignmentUserDelta(USER_JACK_OID, RESOURCE_DUMMY_OID, null, true); // WHEN - when(TEST_NAME); + when(); executeChanges(accountAssignmentUserDelta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userJack = getUser(USER_JACK_OID); @@ -313,11 +313,11 @@ public void test200JackAssignAccountDummyPinkConflicting() throws Exception { .createModifyDelta(USER_JACK_OID, modifications, UserType.class); // WHEN - when(TEST_NAME); + when(); executeChanges(accountAssignmentUserDelta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userJack = getUser(USER_JACK_OID); @@ -373,11 +373,11 @@ public void test210GuybrushAssignAccountDummyPink() throws Exception { ObjectDelta accountAssignmentUserDelta = createAccountAssignmentUserDelta(USER_GUYBRUSH_OID, RESOURCE_DUMMY_PINK_OID, null, true); // WHEN - when(TEST_NAME); + when(); executeChanges(accountAssignmentUserDelta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userGuybrush = getUser(USER_GUYBRUSH_OID); @@ -439,11 +439,11 @@ public void test220DeWattAssignAccountDummyPinkCaseIgnore() throws Exception { dummyAuditService.clear(); // WHEN - when(TEST_NAME); + when(); executeChanges(accountAssignmentUserDelta, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -501,11 +501,11 @@ public void test230ScroogeAddAccountDummyConflictingNoShadow() throws Exception userScrooge.asObjectable().getLinkRef().add(linkRef); // WHEN - when(TEST_NAME); + when(); executeChanges(DeltaFactory.Object.createAddDelta(userScrooge), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result, 2); PrismObject userScroogeAfter = findUserByUsername("scrooge"); @@ -549,14 +549,14 @@ public void test235HackerAddAccountDummyEternalConflict() throws Exception { deltas.add(DeltaFactory.Object.createAddDelta(userJoeHacker)); // WHEN - when(TEST_NAME); + when(); // wrong behavior is throwing "java.lang.IllegalStateException: Model operation took too many clicks (limit is 30). Is there a cycle?" // good behavior is reporting ObjectAlreadyExistsException here modelService.executeChanges(deltas, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); display("Result", result); TestUtil.assertPartialError(result); @@ -594,11 +594,11 @@ public void test240LargoAssignAccountDummyConflictingNoShadow() throws Exception ObjectDelta accountAssignmentUserDelta = createAccountAssignmentUserDelta(USER_LARGO_OID, RESOURCE_DUMMY_PINK_OID, null, true); // WHEN - when(TEST_NAME); + when(); executeChanges(accountAssignmentUserDelta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result, 2); PrismObject userLargo = getUser(USER_LARGO_OID); @@ -661,11 +661,11 @@ public void test260JupiterConflictNoShadowSyncBack() throws Exception { PrismObject userJupiter = PrismTestUtil.parseObject(USER_JUPITER_FILE); // WHEN - when(TEST_NAME); + when(); executeChanges(DeltaFactory.Object.createAddDelta(userJupiter), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result, 2); PrismObject userJupiterAfter = findUserByUsername(USER_JUPITER_NAME); // jupiter @@ -714,11 +714,11 @@ protected void cleanUpJupiter(String TEST_NAME) throws SchemaException, ObjectAl ObjectDelta delta = createAccountAssignmentUserDelta(jupiterUserOid, RESOURCE_DUMMY_FUCHSIA_OID, "default", false); // WHEN - when(TEST_NAME); + when(); executeChanges(delta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userJupiterAfter = findUserByUsername(USER_JUPITER_NAME); // jupiter @@ -760,11 +760,11 @@ public void test264JupiterConflictNoShadowSyncBackSeparate() throws Exception { ObjectDelta delta = createAccountAssignmentUserDelta(jupiterUserOid, RESOURCE_DUMMY_FUCHSIA_OID, "default", true); // WHEN - when(TEST_NAME); + when(); executeChanges(delta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result, 2); PrismObject userJupiterAfter = findUserByUsername(USER_JUPITER_NAME); // jupiter @@ -825,11 +825,11 @@ public void test270JupiterConflictOtherNoShadowSyncBack() throws Exception { ObjectDelta delta = createAccountAssignmentUserDelta(jupiterUserOid, RESOURCE_DUMMY_FUCHSIA_OID, "default", true); // WHEN - when(TEST_NAME); + when(); executeChanges(delta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result, 2); PrismObject userJupiterAfter = findUserByUsername(USER_JUPITER_NAME); // jupiter @@ -920,11 +920,11 @@ public void test280RenameBobNoShadow() throws Exception { deltas.add(objectDelta); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, null, task, result); // THEN - then(TEST_NAME); + then(); PrismObject userBobAfter = getUser(userBobOid); display("User after change execution", userBobAfter); assertUser(userBobAfter, userBobOid, "bobby", "Bobby Andrews", null, null, null); @@ -980,11 +980,11 @@ public void test282RenamePeterNoShadowSync() throws Exception { deltas.add(objectDelta); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, null, task, result); // THEN - then(TEST_NAME); + then(); PrismObject userPeteAfter = getUser(userPeterOid); display("User after change execution", userPeteAfter); assertUser(userPeteAfter, userPeterOid, "pete", "Pete Crenshaw", null, null, null); @@ -1048,11 +1048,11 @@ public void test290AlfredConflictNoShadowSyncBackAdd() throws Exception { ObjectDelta delta = DeltaFactory.Object.createAddDelta(userAlfred); // WHEN - when(TEST_NAME); + when(); executeChanges(delta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result, 2); PrismObject userAlfredAfter = findUserByUsername(USER_ALFRED_NAME); // alfred @@ -1097,11 +1097,11 @@ public void test300JackAssignAccountDummyVioletConflicting() throws Exception { deltas.add(accountAssignmentUserDelta); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1155,11 +1155,11 @@ public void test350GuybrushAssignAccountDummyViolet() throws Exception { deltas.add(accountAssignmentUserDelta); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1214,11 +1214,11 @@ public void test360HermanAssignAccountDummyViolet() throws Exception { deltas.add(accountAssignmentUserDelta); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1303,11 +1303,11 @@ public void test500JackAssignAccountDummyMagenta() throws Exception { deltas.add(accountAssignmentUserDelta); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1383,11 +1383,11 @@ public void test510DrakeAssignAccountDummyMagenta() throws Exception { deltas.add(accountAssignmentUserDelta); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1446,11 +1446,11 @@ public void test520DrakeModifyLocality() throws Exception { dummyAuditService.clear(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_DRAKE_OID, UserType.F_LOCALITY, task, result, PrismTestUtil.createPolyString("London")); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1514,11 +1514,11 @@ public void test530GuybrushAssignAccountDummyMagenta() throws Exception { deltas.add(accountAssignmentUserDelta); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1576,11 +1576,11 @@ public void test532GuybrushModifyDescription() throws Exception { dummyAuditService.clear(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_GUYBRUSH_OID, UserType.F_DESCRIPTION, task, result, DESCRIPTION_RUM); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1639,12 +1639,12 @@ public void test600JackRename() throws Exception { dummyAuditService.clear(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_NAME, task, result, PrismTestUtil.createPolyString(USER_JACK_RENAMED_NAME)); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1716,7 +1716,7 @@ public void test710DarkVioletAddLeChuck() throws Exception { account.addAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_FULLNAME_NAME, LECHUCK_FULLNAME); // WHEN - when(TEST_NAME); + when(); display("Adding dummy account", account.debugDump()); getDummyResource(RESOURCE_DUMMY_DARK_VIOLET_NAME).addAccount(account); @@ -1724,7 +1724,7 @@ public void test710DarkVioletAddLeChuck() throws Exception { waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_DARK_VIOLET_OID, true); // THEN - then(TEST_NAME); + then(); assertUserNick(ACCOUNT_LECHUCK_USERNAME, LECHUCK_FULLNAME, LECHUCK_FULLNAME); } @@ -1743,7 +1743,7 @@ public void test712DarkVioletAddCharles() throws Exception { account.addAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_FULLNAME_NAME, LECHUCK_FULLNAME); // WHEN - when(TEST_NAME); + when(); display("Adding dummy account", account.debugDump()); getDummyResource(RESOURCE_DUMMY_DARK_VIOLET_NAME).addAccount(account); @@ -1751,7 +1751,7 @@ public void test712DarkVioletAddCharles() throws Exception { waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_DARK_VIOLET_OID, true); // THEN - then(TEST_NAME); + then(); assertUserNick(ACCOUNT_LECHUCK_USERNAME, LECHUCK_FULLNAME, LECHUCK_FULLNAME); assertUserNick(ACCOUNT_CHARLES_USERNAME, LECHUCK_FULLNAME, LECHUCK_FULLNAME+".1"); } @@ -1772,7 +1772,7 @@ public void test714DarkVioletAddShinetop() throws Exception { account.addAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_LOCATION_NAME, "Melee Island"); // WHEN - when(TEST_NAME); + when(); display("Adding dummy account", account.debugDump()); getDummyResource(RESOURCE_DUMMY_DARK_VIOLET_NAME).addAccount(account); @@ -1780,7 +1780,7 @@ public void test714DarkVioletAddShinetop() throws Exception { waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_DARK_VIOLET_OID, true); // THEN - then(TEST_NAME); + then(); assertUserNick(ACCOUNT_LECHUCK_USERNAME, LECHUCK_FULLNAME, LECHUCK_FULLNAME); assertUserNick(ACCOUNT_CHARLES_USERNAME, LECHUCK_FULLNAME, LECHUCK_FULLNAME+".1"); assertUserNick(ACCOUNT_SHINETOP_USERNAME, LECHUCK_FULLNAME, LECHUCK_FULLNAME+".2", "Melee Island"); @@ -1794,14 +1794,14 @@ public void test716DarkVioletDeleteCharles() throws Exception { dummyAuditService.clear(); // WHEN - when(TEST_NAME); + when(); getDummyResource(RESOURCE_DUMMY_DARK_VIOLET_NAME).deleteAccountByName(ACCOUNT_CHARLES_USERNAME); waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_DARK_VIOLET_OID, true); // THEN - then(TEST_NAME); + then(); assertUserNick(ACCOUNT_LECHUCK_USERNAME, LECHUCK_FULLNAME, LECHUCK_FULLNAME); assertNoUserNick(ACCOUNT_CHARLES_USERNAME, LECHUCK_FULLNAME, LECHUCK_FULLNAME+".1"); assertUserNick(ACCOUNT_SHINETOP_USERNAME, LECHUCK_FULLNAME, LECHUCK_FULLNAME+".2", "Melee Island"); @@ -1817,14 +1817,14 @@ public void test720DarkVioletModifyShinetopLocation() throws Exception { DummyAccount account = getDummyResource(RESOURCE_DUMMY_DARK_VIOLET_NAME).getAccountByUsername(ACCOUNT_SHINETOP_USERNAME); // WHEN - when(TEST_NAME); + when(); account.replaceAttributeValue(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_LOCATION_NAME, "Monkey Island"); waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_DARK_VIOLET_OID, true); // THEN - then(TEST_NAME); + then(); displayAllUsers(); assertUserNick(ACCOUNT_LECHUCK_USERNAME, LECHUCK_FULLNAME, LECHUCK_FULLNAME); assertNoUserNick(ACCOUNT_CHARLES_USERNAME, LECHUCK_FULLNAME, LECHUCK_FULLNAME+".1"); @@ -1841,14 +1841,14 @@ public void test722DarkVioletModifyShinetopFullName() throws Exception { DummyAccount account = getDummyResource(RESOURCE_DUMMY_DARK_VIOLET_NAME).getAccountByUsername(ACCOUNT_SHINETOP_USERNAME); // WHEN - when(TEST_NAME); + when(); account.replaceAttributeValue(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_FULLNAME_NAME, CHUCKIE_FULLNAME); waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_DARK_VIOLET_OID, true); // THEN - then(TEST_NAME); + then(); displayAllUsers(); assertUserNick(ACCOUNT_LECHUCK_USERNAME, LECHUCK_FULLNAME, LECHUCK_FULLNAME); assertNoUserNick(ACCOUNT_CHARLES_USERNAME, LECHUCK_FULLNAME, LECHUCK_FULLNAME+".1"); @@ -1876,7 +1876,7 @@ public void test724DarkVioletAddLe_Chuck() throws Exception { account.addAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_LOCATION_NAME, "Melee Island"); // WHEN - when(TEST_NAME); + when(); display("Adding dummy account", account.debugDump()); getDummyResource(RESOURCE_DUMMY_DARK_VIOLET_NAME).addAccount(account); @@ -1884,7 +1884,7 @@ public void test724DarkVioletAddLe_Chuck() throws Exception { waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_DARK_VIOLET_OID, true); // THEN - then(TEST_NAME); + then(); displayAllUsers(); assertUserNick(ACCOUNT_LECHUCK_USERNAME, LECHUCK_FULLNAME, LECHUCK_FULLNAME); assertUserNick(ACCOUNT_LE_CHUCK_USERNAME, LE_CHUCK_FULLNAME, LE_CHUCK_FULLNAME+".1", "Melee Island"); @@ -1910,7 +1910,7 @@ public void test730DarkVioletAddBarbossa() throws Exception { account.addAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_FULLNAME_NAME, USER_BARBOSSA_USERNAME); // WHEN - when(TEST_NAME); + when(); display("Adding dummy account", account.debugDump()); getDummyResource(RESOURCE_DUMMY_DARK_VIOLET_NAME).addAccount(account); @@ -1918,7 +1918,7 @@ public void test730DarkVioletAddBarbossa() throws Exception { waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_DARK_VIOLET_OID, true); // THEN - then(TEST_NAME); + then(); assertUserNick(USER_BARBOSSA_USERNAME, USER_BARBOSSA_USERNAME, USER_BARBOSSA_USERNAME+".1"); } @@ -1942,7 +1942,7 @@ public void test732DarkVioletAddBarbossa() throws Exception { account.addAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_FULLNAME_NAME, USER_BARBOSSA_USERNAME); // WHEN - when(TEST_NAME); + when(); display("Adding dummy account", account.debugDump()); getDummyResource(RESOURCE_DUMMY_DARK_VIOLET_NAME).addAccount(account); @@ -1950,7 +1950,7 @@ public void test732DarkVioletAddBarbossa() throws Exception { waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_DARK_VIOLET_OID, true); // THEN - then(TEST_NAME); + then(); assertUserNick(USER_BARBOSSA_USERNAME, USER_BARBOSSA_USERNAME, USER_BARBOSSA_USERNAME+".1"); assertUserNick("YA" + USER_BARBOSSA_USERNAME, USER_BARBOSSA_USERNAME, USER_BARBOSSA_USERNAME+".4"); } @@ -1973,7 +1973,7 @@ public void test750DarkVioletAddMatusalem() throws Exception { account.addAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_FULLNAME_NAME, RUM_FULLNAME); // WHEN - when(TEST_NAME); + when(); display("Adding dummy account", account.debugDump()); getDummyResource(RESOURCE_DUMMY_DARK_VIOLET_NAME).addAccount(account); @@ -1981,7 +1981,7 @@ public void test750DarkVioletAddMatusalem() throws Exception { waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_DARK_VIOLET_OID, true); // THEN - then(TEST_NAME); + then(); assertUserNick(ACCOUNT_MATUSALEM_USERNAME, RUM_FULLNAME, RUM_FULLNAME); } @@ -2002,7 +2002,7 @@ public void test752DarkVioletAddDiplomatico() throws Exception { account.addAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_FULLNAME_NAME, RUM_FULLNAME); // WHEN - when(TEST_NAME); + when(); display("Adding dummy account", account.debugDump()); getDummyResource(RESOURCE_DUMMY_DARK_VIOLET_NAME).addAccount(account); @@ -2010,7 +2010,7 @@ public void test752DarkVioletAddDiplomatico() throws Exception { waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_DARK_VIOLET_OID, true); // THEN - then(TEST_NAME); + then(); displayAllUsers(); assertUserNick(ACCOUNT_MATUSALEM_USERNAME, RUM_FULLNAME, RUM_FULLNAME); @@ -2037,7 +2037,7 @@ public void test754DarkVioletAddMilionario() throws Exception { account.addAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_LOCATION_NAME, "Peru"); // WHEN - when(TEST_NAME); + when(); display("Adding dummy account", account.debugDump()); getDummyResource(RESOURCE_DUMMY_DARK_VIOLET_NAME).addAccount(account); @@ -2045,7 +2045,7 @@ public void test754DarkVioletAddMilionario() throws Exception { waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_DARK_VIOLET_OID, true); // THEN - then(TEST_NAME); + then(); assertUserNick(ACCOUNT_MATUSALEM_USERNAME, RUM_FULLNAME, RUM_FULLNAME); assertUserNick(ACCOUNT_DIPLOMATICO_USERNAME, RUM_FULLNAME, RUM_FULLNAME+iterationTokenDiplomatico); @@ -2063,14 +2063,14 @@ public void test756DarkVioletDeleteDiplomatico() throws Exception { dummyAuditService.clear(); // WHEN - when(TEST_NAME); + when(); getDummyResource(RESOURCE_DUMMY_DARK_VIOLET_NAME).deleteAccountByName(ACCOUNT_DIPLOMATICO_USERNAME); waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_DARK_VIOLET_OID, true); // THEN - then(TEST_NAME); + then(); assertUserNick(ACCOUNT_MATUSALEM_USERNAME, RUM_FULLNAME, RUM_FULLNAME); assertNoUserNick(ACCOUNT_DIPLOMATICO_USERNAME, RUM_FULLNAME, RUM_FULLNAME+iterationTokenDiplomatico); assertUserNick(ACCOUNT_MILLONARIO_USERNAME, RUM_FULLNAME, RUM_FULLNAME+iterationTokenMillonario, "Peru"); @@ -2088,14 +2088,14 @@ public void test760DarkVioletModifyMillonarioLocation() throws Exception { DummyAccount account = getDummyResource(RESOURCE_DUMMY_DARK_VIOLET_NAME).getAccountByUsername(ACCOUNT_MILLONARIO_USERNAME); // WHEN - when(TEST_NAME); + when(); account.replaceAttributeValue(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_LOCATION_NAME, "Northern Peru"); waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_DARK_VIOLET_OID, true); // THEN - then(TEST_NAME); + then(); displayAllUsers(); assertUserNick(ACCOUNT_MATUSALEM_USERNAME, RUM_FULLNAME, RUM_FULLNAME); assertNoUserNick(ACCOUNT_DIPLOMATICO_USERNAME, RUM_FULLNAME, RUM_FULLNAME+iterationTokenDiplomatico); @@ -2117,14 +2117,14 @@ public void test762DarkVioletModifyMillonarioFullName() throws Exception { DummyAccount account = getDummyResource(RESOURCE_DUMMY_DARK_VIOLET_NAME).getAccountByUsername(ACCOUNT_MILLONARIO_USERNAME); // WHEN - when(TEST_NAME); + when(); account.replaceAttributeValue(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_FULLNAME_NAME, RON_FULLNAME); waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_DARK_VIOLET_OID, true); // THEN - then(TEST_NAME); + then(); displayAllUsers(); assertUserNick(ACCOUNT_MATUSALEM_USERNAME, RUM_FULLNAME, RUM_FULLNAME); assertNoUserNick(ACCOUNT_DIPLOMATICO_USERNAME, RUM_FULLNAME, RUM_FULLNAME+iterationTokenDiplomatico); @@ -2147,14 +2147,14 @@ public void test764DarkVioletModifyMatusalemFullName() throws Exception { DummyAccount account = getDummyResource(RESOURCE_DUMMY_DARK_VIOLET_NAME).getAccountByUsername(ACCOUNT_MATUSALEM_USERNAME); // WHEN - when(TEST_NAME); + when(); account.replaceAttributeValue(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_FULLNAME_NAME, RON_FULLNAME); waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_DARK_VIOLET_OID, true); // THEN - then(TEST_NAME); + then(); displayAllUsers(); assertNoUserNick(ACCOUNT_MATUSALEM_USERNAME, RUM_FULLNAME, RUM_FULLNAME); String iterationTokenMatusalem = lookupIterationTokenByAdditionalName(ACCOUNT_MATUSALEM_USERNAME); @@ -2183,11 +2183,11 @@ public void test800UniqeEmailAddUserAlfredoFettucini() throws Exception { USER_FETTUCINI_NICKNAME, true); // WHEN - when(TEST_NAME); + when(); addObject(user, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2220,11 +2220,11 @@ public void test802UniqeEmailAddUserBillFettucini() throws Exception { USER_BILL_FETTUCINI_FAMILY_NAME, USER_FETTUCINI_NICKNAME, true); // WHEN - when(TEST_NAME); + when(); addObject(user, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(user.getOid()); @@ -2267,12 +2267,12 @@ public void test820SubtypeSetByInbound() throws Exception { assertEquals("Wrong # of shadows", 2, shadows.size()); // WHEN - when(TEST_NAME); + when(); importAccountsFromResourceTaskHandler.importSingleShadow(shadows.get(0).getOid(), task, result); importAccountsFromResourceTaskHandler.importSingleShadow(shadows.get(1).getOid(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); ObjectQuery userQuery = prismContext.queryFor(UserType.class) diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestIterativeTasks.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestIterativeTasks.java index 0627035f7d0..a795680593f 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestIterativeTasks.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestIterativeTasks.java @@ -75,11 +75,11 @@ public void test100RunBucketsMultithreaded() throws Exception { // GIVEN // WHEN - when(TEST_NAME); + when(); addTask(TASK_BUCKETS_MULTITHREADED_FILE); // THEN - then(TEST_NAME); + then(); waitForTaskFinish(TASK_BUCKETS_MULTITHREADED_OID, false); } diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestLifecycle.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestLifecycle.java index 0c31c4ca91c..b08bf160ffe 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestLifecycle.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestLifecycle.java @@ -93,7 +93,7 @@ public void test050SetupJack() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_HEADMASTER_OID, task, result); assignRole(USER_JACK_OID, ROLE_GAMBLER_OID, task, result); @@ -103,7 +103,7 @@ public void test050SetupJack() throws Exception { modifyUserReplace(USER_JACK_OID, UserType.F_TELEPHONE_NUMBER, task, result, USER_JACK_TELEPHONE_NUMBER); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -122,11 +122,11 @@ public void test052PrincipalJackDraft() throws Exception { // GIVEN // WHEN - when(TEST_NAME); + when(); MidPointPrincipal principal = focusProfileService.getPrincipal(USER_JACK_USERNAME, UserType.class); // THEN - then(TEST_NAME); + then(); assertNotAuthorized(principal, AUTZ_COMMAND_URL); assertNotAuthorized(principal, AUTZ_GAMBLE_URL); assertNotAuthorized(principal, AUTZ_APPARATE_URL); @@ -146,11 +146,11 @@ public void test060TransitionJackToProposed() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_LIFECYCLE_STATE, task, result, SchemaConstants.LIFECYCLE_PROPOSED); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -171,11 +171,11 @@ public void test062PrincipalJackProposed() throws Exception { // GIVEN // WHEN - when(TEST_NAME); + when(); MidPointPrincipal principal = focusProfileService.getPrincipal(USER_JACK_USERNAME, UserType.class); // THEN - then(TEST_NAME); + then(); assertNotAuthorized(principal, AUTZ_COMMAND_URL); // Although we are in the proposed lifecycle and assignments would not be active by default // the proposed lifecycle is forcing activation to enabled. Therefore also assignments are @@ -200,11 +200,11 @@ public void test090TransitionJackToDefaultActive() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_LIFECYCLE_STATE, task, result /* no value */); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -223,11 +223,11 @@ public void test092PrincipalJackDefaultActive() throws Exception { // GIVEN // WHEN - when(TEST_NAME); + when(); MidPointPrincipal principal = focusProfileService.getPrincipal(USER_JACK_USERNAME, UserType.class); // THEN - then(TEST_NAME); + then(); assertNotAuthorized(principal, AUTZ_COMMAND_URL); assertAuthorized(principal, AUTZ_GAMBLE_URL); assertAuthorized(principal, AUTZ_APPARATE_URL); @@ -252,12 +252,12 @@ public void test100AssignJackCaretaker() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_CARETAKER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -276,12 +276,12 @@ public void test102UnassignJackHeadmaster() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_HEADMASTER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -304,12 +304,12 @@ public void test110UnassignJackCaretaker() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_CARETAKER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -331,12 +331,12 @@ public void test112UnassignJackCaretaker() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_HEADMASTER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); 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 716a1b09af2..bd8c306af06 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 @@ -184,14 +184,14 @@ public void test099ModifyUserAddAccountFailing() throws Exception { try { // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, null, task, result); assertNotReached(); } catch (UnsupportedOperationException e) { // THEN - then(TEST_NAME); + then(); display("Expected exception", e); } @@ -246,11 +246,11 @@ public void test100ModifyUserAddAccount() throws Exception { XMLGregorianCalendar startTime = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); modifyUserAddAccount(USER_JACK_OID, ACCOUNT_JACK_DUMMY_FILE, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTime = clock.currentTimeXMLGregorianCalendar(); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 0); @@ -732,11 +732,11 @@ public void test119ModifyUserDeleteAccount() throws Exception { Collection> deltas = MiscSchemaUtil.createCollection(userDelta); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess("executeChanges result", result, 2); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 0); @@ -800,11 +800,11 @@ public void test120AddAccount() throws Exception { XMLGregorianCalendar startTime = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); Collection> executeChanges = executeChanges(accountDelta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTime = clock.currentTimeXMLGregorianCalendar(); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 0); @@ -1112,11 +1112,11 @@ public void test131ModifyUserJackAssignAccount() throws Exception { XMLGregorianCalendar startTime = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_JACK_OID, RESOURCE_DUMMY_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTime = clock.currentTimeXMLGregorianCalendar(); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 0); @@ -1280,11 +1280,11 @@ public void test135ModifyUserJackAssignAccountAgain() throws Exception { preTestCleanup(AssignmentPolicyEnforcementType.FULL); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_JACK_OID, RESOURCE_DUMMY_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess("executeChanges result", result); PrismObject userJack = getUser(USER_JACK_OID); @@ -1345,11 +1345,11 @@ public void test136JackRecomputeNoChange() throws Exception { XMLGregorianCalendar startTime = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1568,11 +1568,11 @@ public void test148ModifyUserJackUnassignAccountPositiveEnforcement() throws Exc assertSteadyResources(); // WHEN - when(TEST_NAME); + when(); executeChanges(deltas, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); // There is strong mapping. Complete account is fetched. assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 1); @@ -2341,11 +2341,11 @@ public void test190ModifyUserJackAssignAccountAndModify() throws Exception { XMLGregorianCalendar startTime = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); executeChanges(deltas, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTime = clock.currentTimeXMLGregorianCalendar(); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 0); @@ -2467,11 +2467,11 @@ public void test191ModifyUserJackModifyAssignment() throws Exception { display("Deltas to execute execution", deltas); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess("executeChanges result", result); @@ -2528,12 +2528,12 @@ public void test192ModifyUserJack() throws Exception { preTestCleanup(AssignmentPolicyEnforcementType.FULL); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_FULL_NAME, task, result, PrismTestUtil.createPolyString("Magnificent Captain Jack Sparrow")); // THEN - then(TEST_NAME); + then(); assertSuccess(result); // Strong mappings assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 1); @@ -2699,11 +2699,11 @@ public void test195ModifyUserJackLocationSea() throws Exception { preTestCleanup(AssignmentPolicyEnforcementType.FULL); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_LOCALITY, task, result, createPolyString("sea")); // THEN - then(TEST_NAME); + then(); assertSuccess(result); // Strong mappings assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 1); @@ -2971,11 +2971,11 @@ public void test210AddUserMorganWithAssignment() throws Exception { XMLGregorianCalendar startTime = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); executeChanges(userDelta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTime = clock.currentTimeXMLGregorianCalendar(); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 0); @@ -3047,11 +3047,11 @@ public void test212RenameUserMorgan() throws Exception { preTestCleanup(AssignmentPolicyEnforcementType.FULL); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_MORGAN_OID, UserType.F_NAME, task, result, PrismTestUtil.createPolyString("sirhenry")); // THEN - then(TEST_NAME); + then(); assertSuccess(result); // Strong mappings assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 1); @@ -3223,11 +3223,11 @@ public void test300AddUserJackWithAssignmentBlue() throws Exception { XMLGregorianCalendar startTime = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(MiscSchemaUtil.createCollection(delta), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTime = clock.currentTimeXMLGregorianCalendar(); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestPreviewChanges.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestPreviewChanges.java index 10b72e71d90..c90edae8443 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestPreviewChanges.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestPreviewChanges.java @@ -464,11 +464,11 @@ public void test200ModifyUserGuybrushDeleteAccount() throws Exception { display("Input deltas: ", deltas); // WHEN - when(TEST_NAME); + when(); ModelContext modelContext = modelInteractionService.previewChanges(deltas, new ModelExecuteOptions(), task, result); // THEN - then(TEST_NAME); + then(); display("Preview context", modelContext); assertNotNull("Null model context", modelContext); @@ -507,11 +507,11 @@ public void test210GuybrushAddAccount() throws Exception { display("Input deltas: ", deltas); // WHEN - when(TEST_NAME); + when(); ModelContext modelContext = modelInteractionService.previewChanges(deltas, new ModelExecuteOptions(), task, result); // THEN - then(TEST_NAME); + then(); display("Preview context", modelContext); assertNotNull("Null model context", modelContext); @@ -560,11 +560,11 @@ public void test212ModifyUserAddAccountRef() throws Exception { display("Input deltas: ", userDelta); // WHEN - when(TEST_NAME); + when(); ModelContext modelContext = modelInteractionService.previewChanges(deltas, new ModelExecuteOptions(), task, result); // THEN - then(TEST_NAME); + then(); display("Preview context", modelContext); assertNotNull("Null model context", modelContext); @@ -612,12 +612,12 @@ public void test220PreviewJackAssignRolePirate() throws Exception { ROLE_PIRATE_OID, RoleType.COMPLEX_TYPE, null, null, null, true); // WHEN - when(TEST_NAME); + when(); ModelContext modelContext = modelInteractionService.previewChanges(MiscSchemaUtil.createCollection(delta), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertPreviewJackAssignRolePirate(modelContext); @@ -643,12 +643,12 @@ public void test221PreviewJackAssignRolePirateReconcile() throws Exception { ROLE_PIRATE_OID, RoleType.COMPLEX_TYPE, null, null, null, true); // WHEN - when(TEST_NAME); + when(); ModelContext modelContext = modelInteractionService.previewChanges(MiscSchemaUtil.createCollection(delta), ModelExecuteOptions.createReconcile(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertPreviewJackAssignRolePirate(modelContext); @@ -744,13 +744,13 @@ public void test230GuybrushAssignAccountDummy() throws Exception { ModelExecuteOptions options = ModelExecuteOptions.createReconcile(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_GUYBRUSH_OID, ItemPath.create(UserType.F_EXTENSION, PIRACY_WEAPON), task, result, "tongue"); assignAccountToUser(USER_GUYBRUSH_OID, RESOURCE_DUMMY_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); accountGuybrushOid = assertUserAfter(USER_GUYBRUSH_OID) @@ -778,12 +778,12 @@ public void test231PreviewGuybrushModifyAccountFullName() throws Exception { accountGuybrushOid, dummyResourceCtl.getAttributeFullnamePath(), "Mighty Pirate Guybrush Threepwood"); // WHEN - when(TEST_NAME); + when(); ModelContext modelContext = modelInteractionService.previewChanges(MiscSchemaUtil.createCollection(accountDelta), null, task, result); // THEN - then(TEST_NAME); + then(); display("Preview context", modelContext); assertNotNull("Null model context", modelContext); @@ -831,12 +831,12 @@ public void test232PreviewGuybrushModifyAccountShip() throws Exception { "The Mad Monkey"); // WHEN - when(TEST_NAME); + when(); ModelContext modelContext = modelInteractionService.previewChanges(MiscSchemaUtil.createCollection(accountDelta), null, task, result); // THEN - then(TEST_NAME); + then(); display("Preview context", modelContext); assertNotNull("Null model context", modelContext); @@ -882,12 +882,12 @@ public void test233PreviewGuybrushAddRolePirate() throws Exception { ROLE_PIRATE_OID, RoleType.COMPLEX_TYPE, null, null, null, true); // WHEN - when(TEST_NAME); + when(); ModelContext modelContext = modelInteractionService.previewChanges(MiscSchemaUtil.createCollection(delta), null, task, result); // THEN - then(TEST_NAME); + then(); display("Preview context", modelContext); assertNotNull("Null model context", modelContext); @@ -950,12 +950,12 @@ public void test234PreviewGuybrushAddRolePirateRecon() throws Exception { ModelExecuteOptions options = ModelExecuteOptions.createReconcile(); // WHEN - when(TEST_NAME); + when(); ModelContext modelContext = modelInteractionService.previewChanges(MiscSchemaUtil.createCollection(delta), options, task, result); // THEN - then(TEST_NAME); + then(); display("Preview context", modelContext); assertNotNull("Null model context", modelContext); @@ -1016,12 +1016,12 @@ public void test236PreviewGuybrushAddRoleSailor() throws Exception { ROLE_SAILOR_OID, RoleType.COMPLEX_TYPE, null, null, null, true); // WHEN - when(TEST_NAME); + when(); ModelContext modelContext = modelInteractionService.previewChanges(MiscSchemaUtil.createCollection(delta), null, task, result); // THEN - then(TEST_NAME); + then(); display("Preview context", modelContext); assertNotNull("Null model context", modelContext); @@ -1069,12 +1069,12 @@ public void test238PreviewGuybrushAddRoleSailorOwner() throws Exception { ROLE_SAILOR_OID, RoleType.COMPLEX_TYPE, SchemaConstants.ORG_OWNER, null, null, true); // WHEN - when(TEST_NAME); + when(); ModelContext modelContext = modelInteractionService.previewChanges(MiscSchemaUtil.createCollection(delta), null, task, result); // THEN - then(TEST_NAME); + then(); display("Preview context", modelContext); assertNotNull("Null model context", modelContext); @@ -1103,11 +1103,11 @@ public void test239GuybrushUnAssignAccountDummy() throws Exception { assumeAssignmentPolicy(AssignmentPolicyEnforcementType.RELATIVE); // WHEN - when(TEST_NAME); + when(); unassignAccountFromUser(USER_GUYBRUSH_OID, RESOURCE_DUMMY_OID, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1128,11 +1128,11 @@ public void test240GuybrushAssignAccountDummyRelative() throws Exception { assumeAssignmentPolicy(AssignmentPolicyEnforcementType.RELATIVE); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_GUYBRUSH_OID, RESOURCE_DUMMY_RELATIVE_OID, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1159,12 +1159,12 @@ public void test242PreviewGuybrushAddRolePirateRelative() throws Exception { ROLE_PIRATE_RELATIVE_OID, RoleType.COMPLEX_TYPE, null, null, null, true); // WHEN - when(TEST_NAME); + when(); ModelContext modelContext = modelInteractionService.previewChanges(MiscSchemaUtil.createCollection(delta), null, task, result); // THEN - then(TEST_NAME); + then(); display("Preview context", modelContext); assertNotNull("Null model context", modelContext); @@ -1226,12 +1226,12 @@ public void test244PreviewGuybrushAddRolePirateRelativeRecon() throws Exception ROLE_PIRATE_RELATIVE_OID, RoleType.COMPLEX_TYPE, null, null, null, true); // WHEN - when(TEST_NAME); + when(); ModelContext modelContext = modelInteractionService.previewChanges(MiscSchemaUtil.createCollection(delta), ModelExecuteOptions.createReconcile(), task, result); // THEN - then(TEST_NAME); + then(); display("Preview context", modelContext); assertNotNull("Null model context", modelContext); @@ -1287,11 +1287,11 @@ public void test249GuybrushUnAssignAccountDummyRelative() throws Exception { assumeAssignmentPolicy(AssignmentPolicyEnforcementType.RELATIVE); // WHEN - when(TEST_NAME); + when(); unassignAccountFromUser(USER_GUYBRUSH_OID, RESOURCE_DUMMY_RELATIVE_OID, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1461,11 +1461,11 @@ ACCOUNT_SHADOW_ELAINE_DUMMY_RED_OID, getDummyResourceObject(RESOURCE_DUMMY_RED_N display("Input deltas: ", deltas); // WHEN - when(TEST_NAME); + when(); ModelContext modelContext = modelInteractionService.previewChanges(deltas, new ModelExecuteOptions(), task, result); // THEN - then(TEST_NAME); + then(); display("Preview context", modelContext); assertPartialError(result); } @@ -1493,12 +1493,12 @@ public void test401ModifyElaineAccountDummyRedDeleteAdd() throws Exception { display("Input deltas: ", deltas); // WHEN - when(TEST_NAME); + when(); ModelContext modelContext = modelInteractionService.previewChanges(deltas, new ModelExecuteOptions(), task, result); display("Preview context", modelContext); // THEN - then(TEST_NAME); + then(); assertPartialError(result); } @@ -1640,11 +1640,11 @@ public void test600ModifyElaineUserDummyReplace() throws Exception { display("Input deltas: ", deltas); // WHEN - when(TEST_NAME); + when(); ModelContext modelContext = modelInteractionService.previewChanges(deltas, new ModelExecuteOptions(), task, result); // THEN - then(TEST_NAME); + then(); display("Preview context", modelContext); assertNotNull("Null model context", modelContext); @@ -1743,11 +1743,11 @@ ACCOUNT_SHADOW_ELAINE_DUMMY_BLUE_OID, getDummyResourceObject(RESOURCE_DUMMY_BLUE display("Input deltas: ", deltas); // WHEN - when(TEST_NAME); + when(); ModelContext modelContext = modelInteractionService.previewChanges(deltas, new ModelExecuteOptions(), task, result); // THEN - then(TEST_NAME); + then(); display("Preview context", modelContext); assertNotNull("Null model context", modelContext); @@ -2097,12 +2097,12 @@ public void test710PreviewGuybrushHavingRoleSailorOwner() throws Exception { ObjectDelta empty = prismContext.deltaFor(UserType.class).asObjectDeltaCast(USER_GUYBRUSH_OID); // WHEN - when(TEST_NAME); + when(); ModelContext modelContext = modelInteractionService.previewChanges(singleton(empty), createEvaluateAllAssignmentRelationsOnRecompute(), task, result); // THEN - then(TEST_NAME); + then(); display("Preview context", modelContext); assertNotNull("Null model context", modelContext); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestResources.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestResources.java index 471ab730792..0fac7c4f8be 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestResources.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestResources.java @@ -165,11 +165,11 @@ public void test050GetResourceRaw() throws Exception { Collection> options = SelectorOptions.createCollection(GetOperationOptions.createRaw()); // WHEN - when(TEST_NAME); + when(); PrismObject resource = modelService.getObject(ResourceType.class, RESOURCE_DUMMY_OID, options , task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Resource", resource); @@ -215,12 +215,12 @@ public void test052GetResourceNoFetch() throws Exception { GetOperationOptions.createNoFetch()); // WHEN - when(TEST_NAME); + when(); PrismObject resource = modelService.getObject(ResourceType.class, RESOURCE_DUMMY_OID, options, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Resource", resource); @@ -266,12 +266,12 @@ public void test053GetResourceNoFetchAgain() throws Exception { GetOperationOptions.createNoFetch()); // WHEN - when(TEST_NAME); + when(); PrismObject resource = modelService.getObject(ResourceType.class, RESOURCE_DUMMY_OID, options, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Resource", resource); @@ -320,12 +320,12 @@ public void test055GetResourceNoFetchReadOnly() throws Exception { Collection> options = SelectorOptions.createCollection(option); // WHEN - when(TEST_NAME); + when(); PrismObject resource = modelService.getObject(ResourceType.class, RESOURCE_DUMMY_OID, options, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Resource", resource); @@ -366,11 +366,11 @@ public void test100SearchResourcesNoFetch() throws Exception { Collection> options = SelectorOptions.createCollection(GetOperationOptions.createNoFetch()); // WHEN - when(TEST_NAME); + when(); List> resources = modelService.searchObjects(ResourceType.class, null, options, task, result); // THEN - then(TEST_NAME); + then(); assertNotNull("null search return", resources); assertFalse("Empty search return", resources.isEmpty()); assertEquals("Unexpected number of resources found", 2, resources.size()); @@ -416,11 +416,11 @@ public void test102SearchResourcesNoFetchReadOnly() throws Exception { Collection> options = SelectorOptions.createCollection(option); // WHEN - when(TEST_NAME); + when(); List> resources = modelService.searchObjects(ResourceType.class, null, options, task, result); // THEN - then(TEST_NAME); + then(); assertNotNull("null search return", resources); assertFalse("Empty search return", resources.isEmpty()); assertEquals("Unexpected number of resources found", 2, resources.size()); @@ -472,11 +472,11 @@ public void test105SearchResourcesIterativeNoFetch() throws Exception { Collection> options = SelectorOptions.createCollection(GetOperationOptions.createNoFetch()); // WHEN - when(TEST_NAME); + when(); modelService.searchObjectsIterative(ResourceType.class, null, handler, options, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertFalse("Empty search return", resources.isEmpty()); @@ -525,11 +525,11 @@ public void test107SearchResourcesIterativeNoFetchReadOnly() throws Exception { Collection> options = SelectorOptions.createCollection(option); // WHEN - when(TEST_NAME); + when(); modelService.searchObjectsIterative(ResourceType.class, null, handler, options, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertFalse("Empty search return", resources.isEmpty()); @@ -561,11 +561,11 @@ public void test110GetResourceDummy() throws Exception { rememberCounter(InternalCounters.PRISM_OBJECT_CLONE_COUNT); // WHEN - when(TEST_NAME); + when(); PrismObject resource = modelService.getObject(ResourceType.class, RESOURCE_DUMMY_OID, null , task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertCounterIncrement(InternalCounters.PRISM_OBJECT_CLONE_COUNT, 4); @@ -606,12 +606,12 @@ public void test112GetResourceDummyReadOnly() throws Exception { GetOperationOptions.createReadOnly()); // WHEN - when(TEST_NAME); + when(); PrismObject resource = modelService.getObject(ResourceType.class, RESOURCE_DUMMY_OID, options , task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertCounterIncrement(InternalCounters.PRISM_OBJECT_CLONE_COUNT, 1); @@ -645,11 +645,11 @@ public void test120SearchResources() throws Exception { assertSteadyResources(); // WHEN - when(TEST_NAME); + when(); List> resources = modelService.searchObjects(ResourceType.class, null, null, task, result); // THEN - then(TEST_NAME); + then(); assertNotNull("null search return", resources); assertFalse("Empty search return", resources.isEmpty()); assertEquals("Unexpected number of resources found", 2, resources.size()); @@ -832,11 +832,11 @@ public void test210GetResourceDummyRed() throws Exception { rememberCounter(InternalCounters.PRISM_OBJECT_CLONE_COUNT); // WHEN - when(TEST_NAME); + when(); PrismObject resource = modelService.getObject(ResourceType.class, RESOURCE_DUMMY_RED_OID, null , task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertCounterIncrement(InternalCounters.PRISM_OBJECT_CLONE_COUNT, 1); @@ -876,11 +876,11 @@ public void test750GetResourceRaw() throws Exception { Collection> options = SelectorOptions.createCollection(GetOperationOptions.createRaw()); // WHEN - when(TEST_NAME); + when(); PrismObject resource = modelService.getObject(ResourceType.class, RESOURCE_DUMMY_OID, options , task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Resource", resource); @@ -909,11 +909,11 @@ public void test752GetResourceDummy() throws Exception { rememberCounter(InternalCounters.PRISM_OBJECT_CLONE_COUNT); // WHEN - when(TEST_NAME); + when(); PrismObject resource = modelService.getObject(ResourceType.class, RESOURCE_DUMMY_OID, null , task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertCounterIncrement(InternalCounters.PRISM_OBJECT_CLONE_COUNT, 1); @@ -941,11 +941,11 @@ public void test760ModifyConfigurationString() throws Exception { "whatever wherever"); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(MiscSchemaUtil.createCollection(resourceDelta), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject resourceAfter = modelService.getObject(ResourceType.class, RESOURCE_DUMMY_OID, null, task, result); @@ -967,12 +967,12 @@ public void test761ModifyConfigurationStringRaw() throws Exception { "whatever raw wherever"); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(MiscSchemaUtil.createCollection(resourceDelta), ModelExecuteOptions.createRaw(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject resourceAfter = modelService.getObject(ResourceType.class, RESOURCE_DUMMY_OID, null, task, result); @@ -1050,11 +1050,11 @@ private void modifyConfigurationDiffExpressionRaw(final String TEST_NAME, display("Diff delta", diffDelta); // WHEN - when(TEST_NAME); + when(); executeChanges(diffDelta, ModelExecuteOptions.createRaw(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertCounterIncrement(InternalCounters.CONNECTOR_INSTANCE_INITIALIZATION_COUNT, 0); @@ -1108,11 +1108,11 @@ public void test800GetResourceDummy() throws Exception { rememberCounter(InternalCounters.PRISM_OBJECT_CLONE_COUNT); // WHEN - when(TEST_NAME); + when(); PrismObject resource = modelService.getObject(ResourceType.class, RESOURCE_DUMMY_OID, null , task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertCounterIncrement(InternalCounters.PRISM_OBJECT_CLONE_COUNT, 1); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestTolerantAttributes.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestTolerantAttributes.java index ed0398bfe67..b4fa08c557f 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestTolerantAttributes.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestTolerantAttributes.java @@ -136,11 +136,11 @@ UserType.F_DESCRIPTION, getUserDefinition().findPropertyDefinition(UserType.F_DE Collection> deltas = (Collection)MiscUtil.createCollection(userDelta); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, ModelExecuteOptions.createReconcile(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); // Check value in "quote attribute" @@ -322,11 +322,11 @@ public void test105ModifyAddNonTolerantAttribute() throws Exception { Collection> deltas = (Collection)MiscUtil.createCollection(userDelta); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, ModelExecuteOptions.createReconcile(), task, result); // THEN - then(TEST_NAME); + then(); assertPartialError(result); } diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestUserTemplateWithRanges.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestUserTemplateWithRanges.java index 650b4973138..012a91338dc 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestUserTemplateWithRanges.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/TestUserTemplateWithRanges.java @@ -359,7 +359,7 @@ public void test300GuybrushBloodyNose() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); executeChanges( deltaFor(UserType.class) .item(UserType.F_TITLE).add(PolyString.fromOrig(ROLE_BLOODY_NOSE_NAME)) @@ -367,7 +367,7 @@ public void test300GuybrushBloodyNose() throws Exception { null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_GUYBRUSH_OID) @@ -390,7 +390,7 @@ public void test309GuybrushNotBloody() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); executeChanges( deltaFor(UserType.class) .item(UserType.F_TITLE).delete(PolyString.fromOrig(ROLE_BLOODY_NOSE_NAME)) @@ -398,7 +398,7 @@ public void test309GuybrushNotBloody() throws Exception { null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_GUYBRUSH_OID) @@ -420,7 +420,7 @@ public void test310GuybrushBloodyNoseFuneral() throws Exception { GUYBRUSH_FUNERAL_DATE_123456_CAL); // WHEN - when(TEST_NAME); + when(); executeChanges( deltaFor(UserType.class) .item(UserType.F_TITLE).add(PolyString.fromOrig(ROLE_BLOODY_NOSE_NAME)) @@ -428,7 +428,7 @@ public void test310GuybrushBloodyNoseFuneral() throws Exception { null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_GUYBRUSH_OID) @@ -451,7 +451,7 @@ public void test319GuybrushNoBloodyNoseFuneral() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); executeChanges( deltaFor(UserType.class) .item(UserType.F_TITLE).delete(PolyString.fromOrig(ROLE_BLOODY_NOSE_NAME)) @@ -459,7 +459,7 @@ public void test319GuybrushNoBloodyNoseFuneral() throws Exception { null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_GUYBRUSH_OID) @@ -481,7 +481,7 @@ public void test320GuybrushBloodyNose() throws Exception { /* no value */); // WHEN - when(TEST_NAME); + when(); executeChanges( deltaFor(UserType.class) .item(UserType.F_TITLE).add(PolyString.fromOrig(ROLE_BLOODY_NOSE_NAME)) @@ -489,7 +489,7 @@ public void test320GuybrushBloodyNose() throws Exception { null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_GUYBRUSH_OID) @@ -512,12 +512,12 @@ public void test322GuybrushSetFuneral() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_GUYBRUSH_OID, getExtensionPath(PIRACY_FUNERAL_TIMESTAMP), task, result, GUYBRUSH_FUNERAL_DATE_123456_CAL); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_GUYBRUSH_OID) @@ -540,12 +540,12 @@ public void test324GuybrushSetFuneral22222() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_GUYBRUSH_OID, getExtensionPath(PIRACY_FUNERAL_TIMESTAMP), task, result, GUYBRUSH_FUNERAL_DATE_22222_CAL); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_GUYBRUSH_OID) @@ -570,12 +570,12 @@ public void test326GuybrushNoFuneral() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_GUYBRUSH_OID, getExtensionPath(PIRACY_FUNERAL_TIMESTAMP), task, result /* no value */); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_GUYBRUSH_OID) @@ -597,7 +597,7 @@ public void test329GuybrushNoBloodyNose() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); executeChanges( deltaFor(UserType.class) .item(UserType.F_TITLE).delete(PolyString.fromOrig(ROLE_BLOODY_NOSE_NAME)) @@ -605,7 +605,7 @@ public void test329GuybrushNoBloodyNose() throws Exception { null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_GUYBRUSH_OID) diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/archetypes/TestArchetypes.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/archetypes/TestArchetypes.java index 03a87443c3f..6d7b95dad37 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/archetypes/TestArchetypes.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/archetypes/TestArchetypes.java @@ -145,11 +145,11 @@ public void test050AddArchetypeTest() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); addObject(ARCHETYPE_TEST_FILE, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject archetypeTest = modelService.getObject(ArchetypeType.class, ARCHETYPE_TEST_OID, null, task, result); @@ -164,13 +164,13 @@ public void test060AddArchetypesAndRoles() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); addObject(ARCHETYPE_BUSINESS_ROLE_FILE, task, result); addObject(ROLE_BUSINESS_CAPTAIN_FILE, task, result); addObject(ROLE_BUSINESS_BOSUN_FILE, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject roleBusinessCaptainAfter = assertRoleAfter(ROLE_BUSINESS_CAPTAIN_OID) @@ -203,11 +203,11 @@ public void test070AssignGuybrushUserAdministrator() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_GUYBRUSH_OID, ROLE_USER_ADMINISTRATOR_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); // TODO: assert guybrush @@ -222,12 +222,12 @@ public void test100AssignJackArchetypeEmployee() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignArchetype(USER_JACK_OID, ARCHETYPE_EMPLOYEE_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = assertUserAfter(USER_JACK_OID) @@ -269,12 +269,12 @@ public void test102SearchEmployeeArchetypeRef() throws Exception { .build(); // WHEN - when(TEST_NAME); + when(); SearchResultList> searchResults = modelService.searchObjects(UserType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Search results", searchResults); assertEquals("Wrong number of search results", 1, searchResults.size()); @@ -369,12 +369,12 @@ public void test109UnassignJackArchetypeEmployee() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignArchetype(USER_JACK_OID, ARCHETYPE_EMPLOYEE_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = assertUserAfter(USER_JACK_OID) @@ -401,12 +401,12 @@ public void test110AssignJackRoleEmployeeBase() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_EMPLOYEE_BASE_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = assertUserAfter(USER_JACK_OID) @@ -456,12 +456,12 @@ public void test115UnassignJackRoleEmployeeBase() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_EMPLOYEE_BASE_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = assertUserAfter(USER_JACK_OID) @@ -499,12 +499,12 @@ public void test120AssignJackArchetypeTest() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignArchetype(USER_JACK_OID, ARCHETYPE_TEST_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) @@ -534,12 +534,12 @@ public void test129UnassignJackArchetypeTest() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignArchetype(USER_JACK_OID, ARCHETYPE_TEST_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) @@ -565,12 +565,12 @@ public void test130AssignJackArchetypeContractor() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignArchetype(USER_JACK_OID, ARCHETYPE_CONTRACTOR_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) @@ -597,12 +597,12 @@ public void test132JackContractorRecompute() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) @@ -630,12 +630,12 @@ public void test135UnassignJackArchetypeContractor() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignArchetype(USER_JACK_OID, ARCHETYPE_CONTRACTOR_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) @@ -666,12 +666,12 @@ public void test137JackEmpnoAndRecompute() throws Exception { modifyUserReplace(USER_JACK_OID, UserType.F_EMPLOYEE_NUMBER, task, result, "Number ONE"); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) @@ -700,12 +700,12 @@ public void test140AddMeathookContractor() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); addObject(USER_MEATHOOK_FILE, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_MEATHOOK_OID) @@ -734,12 +734,12 @@ public void test150AddWannabe() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); addObject(USER_WANNABE_FILE, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_WANNABE_OID) @@ -769,12 +769,12 @@ public void test160AddSelfMadeMan() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); addObject(USER_SELF_MADE_MAN_FILE, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_SELF_MADE_MAN_OID) @@ -806,7 +806,7 @@ public void test162AddFraudster() throws Exception { try { // WHEN - when(TEST_NAME); + when(); addObject(USER_FRAUDSTER_FILE, task, result); @@ -817,7 +817,7 @@ public void test162AddFraudster() throws Exception { } // THEN - then(TEST_NAME); + then(); assertFailure(result); assertNoObject(UserType.class, USER_FRAUDSTER_OID); @@ -831,13 +831,13 @@ public void test200AssignJackBarbossaArchetypeEmployee() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignArchetype(USER_JACK_OID, ARCHETYPE_EMPLOYEE_OID, task, result); assignArchetype(USER_BARBOSSA_OID, ARCHETYPE_EMPLOYEE_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) @@ -892,12 +892,12 @@ public void test203DisableBarbossa() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_BARBOSSA_OID, ACTIVATION_ADMINISTRATIVE_STATUS_PATH, task, result, ActivationStatusType.DISABLED); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) @@ -952,7 +952,7 @@ public void test300jackAssignArchetypeRaw() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); try { assignArchetype(USER_JACK_OID, ARCHETYPE_CONTRACTOR_OID, task, result); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/archetypes/TestCollections.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/archetypes/TestCollections.java index 83e52c98dd2..739febe6312 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/archetypes/TestCollections.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/archetypes/TestCollections.java @@ -70,11 +70,11 @@ public void test000Sanity() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); collectionActiveUsers = modelService.getObject(ObjectCollectionType.class, COLLECTION_ACTIVE_USERS_OID, null, task, result); // THEN - then(TEST_NAME); + then(); display("Collection", collectionActiveUsers); assertSuccess(result); assertNotNull("No collection", collectionActiveUsers); @@ -89,11 +89,11 @@ public void test100CompileCollectionView() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); collectionViewActiveUsers = modelInteractionService.compileObjectCollectionView(collectionActiveUsers, null, task, result); // THEN - then(TEST_NAME); + then(); display("Active users collection view", collectionViewActiveUsers); assertSuccess(result); assertNotNull("Null view", collectionActiveUsers); @@ -116,11 +116,11 @@ public void test102SearchCollectionUsers() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); SearchResultList> users = modelService.searchObjects(UserType.class, prismContext.queryFactory().createQuery(collectionViewActiveUsers.getFilter()), null, task, result); // THEN - then(TEST_NAME); + then(); display("Users in collection", users); assertSuccess(result); assertEquals("Wrong number of users in collection", getNumberOfUsers(), users.size()); @@ -135,11 +135,11 @@ public void test110CollectionStatsAllEnabled() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); CollectionStats stats = modelInteractionService.determineCollectionStats(collectionViewActiveUsers, task, result); // THEN - then(TEST_NAME); + then(); display("Collection stats", stats); assertSuccess(result); assertNotNull("Null stats", stats); @@ -158,11 +158,11 @@ public void test112EvaluateRulesAllEnabled() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); Collection evaluatedRules = modelInteractionService.evaluateCollectionPolicyRules(collectionActiveUsers, collectionViewActiveUsers, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertEvaluatedPolicyRules(evaluatedRules, collectionActiveUsers) @@ -182,11 +182,11 @@ public void test120CollectionStatsOneDisabled() throws Exception { numberOfDisabledUsers++; // WHEN - when(TEST_NAME); + when(); CollectionStats stats = modelInteractionService.determineCollectionStats(collectionViewActiveUsers, task, result); // THEN - then(TEST_NAME); + then(); display("Collection stats", stats); assertSuccess(result); assertNotNull("Null stats", stats); @@ -205,11 +205,11 @@ public void test122EvaluateRulesOneDisabled() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); Collection evaluatedRules = modelInteractionService.evaluateCollectionPolicyRules(collectionActiveUsers, collectionViewActiveUsers, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertEvaluatedPolicyRules(evaluatedRules, collectionActiveUsers) diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/gensync/TestEditSchema.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/gensync/TestEditSchema.java index 434df21b22e..792da9674d7 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/gensync/TestEditSchema.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/gensync/TestEditSchema.java @@ -89,11 +89,11 @@ public void test100LookupLanguagesGet() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); PrismObject lookup = modelService.getObject(LookupTableType.class, LOOKUP_LANGUAGES_OID, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -119,11 +119,11 @@ public void test102LookupLanguagesGetExclude() throws Exception { .build(); // WHEN - when(TEST_NAME); + when(); PrismObject lookup = modelService.getObject(LookupTableType.class, LOOKUP_LANGUAGES_OID, options, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -145,11 +145,11 @@ public void test110LookupLanguagesGetAll() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); PrismObject lookup = getLookupTableAll(LOOKUP_LANGUAGES_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); checkLookupResult(lookup, new String[]{"en_US", "en", "English (US)"}, @@ -167,7 +167,7 @@ public void test120LookupLanguagesGetByKeyExact() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); GetOperationOptionsBuilder optionsBuilder = schemaHelper.getOperationOptionsBuilder() .item(LookupTableType.F_ROW) @@ -178,7 +178,7 @@ public void test120LookupLanguagesGetByKeyExact() throws Exception { PrismObject lookup = modelService.getObject(LookupTableType.class, LOOKUP_LANGUAGES_OID, optionsBuilder.build(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); checkLookupResult(lookup, new String[] { "sk_SK", "sk", "Slovak" }); @@ -193,7 +193,7 @@ public void test121LookupLanguagesGetByKeyStartingWith() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); GetOperationOptionsBuilder optionsBuilder = schemaHelper.getOperationOptionsBuilder() .item(LookupTableType.F_ROW) @@ -204,7 +204,7 @@ public void test121LookupLanguagesGetByKeyStartingWith() throws Exception { PrismObject lookup = modelService.getObject(LookupTableType.class, LOOKUP_LANGUAGES_OID, optionsBuilder.build(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); checkLookupResult(lookup, new String[]{"en_US", "en", "English (US)"}, @@ -220,7 +220,7 @@ public void test122LookupLanguagesGetByKeyContaining() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); GetOperationOptionsBuilder optionsBuilder = schemaHelper.getOperationOptionsBuilder() .item(LookupTableType.F_ROW) @@ -231,7 +231,7 @@ public void test122LookupLanguagesGetByKeyContaining() throws Exception { PrismObject lookup = modelService.getObject(LookupTableType.class, LOOKUP_LANGUAGES_OID, optionsBuilder.build(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); checkLookupResult(lookup, new String[]{"tr_TR", "tr", "Turkish"}); @@ -246,7 +246,7 @@ public void test123LookupLanguagesGetByKeyContainingWithPaging() throws Exceptio OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); GetOperationOptionsBuilder optionsBuilder = schemaHelper.getOperationOptionsBuilder() .item(LookupTableType.F_ROW) @@ -260,7 +260,7 @@ public void test123LookupLanguagesGetByKeyContainingWithPaging() throws Exceptio PrismObject lookup = modelService.getObject(LookupTableType.class, LOOKUP_LANGUAGES_OID, optionsBuilder.build(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); checkLookupResult(lookup, new String[] { "sk_SK", "sk", "Slovak" }); @@ -275,7 +275,7 @@ public void test124LookupLanguagesGetByKeyContainingReturningNothing() throws Ex OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); GetOperationOptionsBuilder optionsBuilder = schemaHelper.getOperationOptionsBuilder() .item(LookupTableType.F_ROW) @@ -286,7 +286,7 @@ public void test124LookupLanguagesGetByKeyContainingReturningNothing() throws Ex PrismObject lookup = modelService.getObject(LookupTableType.class, LOOKUP_LANGUAGES_OID, optionsBuilder.build(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); IntegrationTestTools.display("Languages", lookup); @@ -308,7 +308,7 @@ public void test130LookupLanguagesGetByValueExact() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); GetOperationOptionsBuilder optionsBuilder = schemaHelper.getOperationOptionsBuilder() .item(LookupTableType.F_ROW) @@ -319,7 +319,7 @@ public void test130LookupLanguagesGetByValueExact() throws Exception { PrismObject lookup = modelService.getObject(LookupTableType.class, LOOKUP_LANGUAGES_OID, optionsBuilder.build(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); checkLookupResult(lookup, new String[] { "sk_SK", "sk", "Slovak" }); @@ -338,7 +338,7 @@ public void test131LookupLanguagesGetByLabelStartingWith() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); String fragment = "Eng"; GetOperationOptionsBuilder optionsBuilder = schemaHelper.getOperationOptionsBuilder() @@ -350,7 +350,7 @@ public void test131LookupLanguagesGetByLabelStartingWith() throws Exception { PrismObject lookup = modelService.getObject(LookupTableType.class, LOOKUP_LANGUAGES_OID, optionsBuilder.build(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); checkLookupResult(lookup, new String[]{"en_US", "en", "English (US)"}, @@ -366,7 +366,7 @@ public void test133LookupLanguagesGetByValueContainingWithPaging() throws Except OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); GetOperationOptionsBuilder optionsBuilder = schemaHelper.getOperationOptionsBuilder() .item(LookupTableType.F_ROW) @@ -380,7 +380,7 @@ public void test133LookupLanguagesGetByValueContainingWithPaging() throws Except PrismObject lookup = modelService.getObject(LookupTableType.class, LOOKUP_LANGUAGES_OID, optionsBuilder.build(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); checkLookupResult(lookup, new String[] { "en_US", "en", "English (US)" }); @@ -398,7 +398,7 @@ public void test140LookupLanguagesGetByIdExisting() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); Collection> options = SelectorOptions.createCollection( prismContext.path(LookupTableType.F_ROW, 1L), @@ -406,7 +406,7 @@ public void test140LookupLanguagesGetByIdExisting() throws Exception { PrismObject lookup = modelService.getObject(LookupTableType.class, LOOKUP_LANGUAGES_OID, options, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); checkLookupResult(lookup, new String[] { "en_US", "en", "English (US)" }); @@ -445,11 +445,11 @@ public void test150LookupLanguagesAddRowFull() throws Exception { LOOKUP_LANGUAGES_OID, LookupTableType.F_ROW, row); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(MiscSchemaUtil.createCollection(delta), null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -491,11 +491,11 @@ public void test152LookupLanguagesAddRowKeyLabel() throws Exception { LOOKUP_LANGUAGES_OID, LookupTableType.F_ROW, row); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(MiscSchemaUtil.createCollection(delta), null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -538,11 +538,11 @@ public void test154LookupLanguagesAddRowKeyValue() throws Exception { LOOKUP_LANGUAGES_OID, LookupTableType.F_ROW, row); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(MiscSchemaUtil.createCollection(delta), null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -587,7 +587,7 @@ public void test156LookupLanguagesAddRowExistingKey() throws Exception { LOOKUP_LANGUAGES_OID, LookupTableType.F_ROW, row); // WHEN - when(TEST_NAME); + when(); boolean exception = false; try { modelService.executeChanges(MiscSchemaUtil.createCollection(delta), null, task, result); @@ -597,7 +597,7 @@ public void test156LookupLanguagesAddRowExistingKey() throws Exception { AssertJUnit.assertFalse(exception); // as per description in https://wiki.evolveum.com/display/midPoint/Development+with+LookupTable // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -647,11 +647,11 @@ public void test162LookupLanguagesDeleteRowFullNoId() throws Exception { LOOKUP_LANGUAGES_OID, LookupTableType.F_ROW, row); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(MiscSchemaUtil.createCollection(delta), null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -695,11 +695,11 @@ public void test164LookupLanguagesDeleteRowFullId() throws Exception { LOOKUP_LANGUAGES_OID, LookupTableType.F_ROW, row); // WHEN - when(TEST_NAME); + when(); executeChanges(delta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject lookup = getLookupTableAll(LOOKUP_LANGUAGES_OID, task, result); @@ -737,11 +737,11 @@ public void test166LookupLanguagesDeleteRowIdOnly() throws Exception { LOOKUP_LANGUAGES_OID, LookupTableType.F_ROW, row); // WHEN - when(TEST_NAME); + when(); executeChanges(delta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject lookup = getLookupTableAll(LOOKUP_LANGUAGES_OID, task, result); @@ -778,11 +778,11 @@ public void test168LookupLanguagesDeleteRowByKey() throws Exception { LOOKUP_LANGUAGES_OID, LookupTableType.F_ROW, row); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(MiscSchemaUtil.createCollection(delta), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject lookup = getLookupTableAll(LOOKUP_LANGUAGES_OID, task, result); @@ -831,11 +831,11 @@ public void test170LookupLanguagesReplaceRows() throws Exception { LOOKUP_LANGUAGES_OID, LookupTableType.F_ROW, row1, row2, row3); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(MiscSchemaUtil.createCollection(delta), null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -871,13 +871,13 @@ public void test180LookupLanguagesReplaceObject() throws Exception { ObjectDelta delta = DeltaFactory.Object.createAddDelta(replacement); // WHEN - when(TEST_NAME); + when(); ModelExecuteOptions options = ModelExecuteOptions.createOverwrite(); options.setRaw(true); modelService.executeChanges(MiscSchemaUtil.createCollection(delta), options, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -911,11 +911,11 @@ public void test182LookupLanguagesReimport() throws Exception { options.setKeepOid(true); // WHEN - when(TEST_NAME); + when(); modelService.importObjectsFromFile(LOOKUP_LANGUAGES_FILE, options, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -972,11 +972,11 @@ public void test200EditSchemaUser() throws Exception { PrismObject user = userDef.instantiate(); // WHEN - when(TEST_NAME); + when(); PrismObjectDefinition editDef = getEditObjectDefinition(user); // THEN - then(TEST_NAME); + then(); PrismAsserts.assertEmphasized(editDef, UserType.F_NAME, true); @@ -1046,11 +1046,11 @@ public void test210UserDefinition() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); PrismObject user = modelService.getObject(UserType.class, USER_JACK_OID, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1116,11 +1116,11 @@ public void test213ModifiedUserJack() throws Exception { modifyObjectReplaceProperty(UserType.class, USER_JACK_OID, UserType.F_PREFERRED_LANGUAGE, task, result, "en_PR"); // WHEN - when(TEST_NAME); + when(); PrismObject user = modelService.getObject(UserType.class, USER_JACK_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertPropertyValues(user, UserType.F_ADDITIONAL_NAME, (propDef, name) -> { @@ -1206,11 +1206,11 @@ public void test250EditSchemaRole() throws Exception { PrismObject role = roleDef.instantiate(); // WHEN - when(TEST_NAME); + when(); PrismObjectDefinition editDef = getEditObjectDefinition(role); // THEN - then(TEST_NAME); + then(); // TODO PrismPropertyDefinition requestableDef = editDef.findPropertyDefinition(RoleType.F_REQUESTABLE); @@ -1231,11 +1231,11 @@ public void test260EditShadowSchemaKindIntent() throws Exception { ResourceShadowDiscriminator discr = new ResourceShadowDiscriminator(RESOURCE_DUMMY_OID, ShadowKindType.ACCOUNT, null, null, false); // WHEN - when(TEST_NAME); + when(); PrismObjectDefinition editDef = modelInteractionService.getEditShadowDefinition(discr, AuthorizationPhaseType.REQUEST, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismPropertyDefinition nameDef = editDef.findPropertyDefinition(ShadowType.F_NAME); @@ -1273,11 +1273,11 @@ public void test261EditShadowSchemaObjectclass() throws Exception { IntegrationTestTools.display("Discr", discr); // WHEN - when(TEST_NAME); + when(); PrismObjectDefinition editDef = modelInteractionService.getEditShadowDefinition(discr, AuthorizationPhaseType.REQUEST, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismPropertyDefinition nameDef = editDef.findPropertyDefinition(ShadowType.F_NAME); @@ -1305,11 +1305,11 @@ public void test263EditShadowSchemaEmpty() throws Exception { IntegrationTestTools.display("Discr", discr); // WHEN - when(TEST_NAME); + when(); PrismObjectDefinition editDef = modelInteractionService.getEditShadowDefinition(discr, AuthorizationPhaseType.REQUEST, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismPropertyDefinition nameDef = editDef.findPropertyDefinition(ShadowType.F_NAME); @@ -1332,11 +1332,11 @@ public void test265EditShadowSchemaNull() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); PrismObjectDefinition editDef = modelInteractionService.getEditShadowDefinition(null, AuthorizationPhaseType.REQUEST, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismPropertyDefinition nameDef = editDef.findPropertyDefinition(ShadowType.F_NAME); @@ -1361,11 +1361,11 @@ public void test310CustomRelations() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); List relations = modelInteractionService.getRelationDefinitions(); // THEN - then(TEST_NAME); + then(); display("Relations", relations); assertRelationDef(relations, SchemaConstants.ORG_MANAGER, "RelationTypes.manager"); assertRelationDef(relations, SchemaConstants.ORG_OWNER, "Master"); @@ -1391,12 +1391,12 @@ public void test800OtisEditSchemaUser() throws Exception { PrismObject user = userDef.instantiate(); // WHEN - when(TEST_NAME); + when(); PrismObjectDefinition editDef = getEditObjectDefinition(user); display("Otis edit schema", editDef); // THEN - then(TEST_NAME); + then(); PrismPropertyDefinition nameDef = editDef.findPropertyDefinition(UserType.F_NAME); assertNotNull("No definition for name in user", nameDef); @@ -1457,11 +1457,11 @@ public void test810OtisGetJack() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); PrismObject user = modelService.getObject(UserType.class, USER_JACK_OID, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1540,11 +1540,11 @@ public void test820OtisSearchUsers() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); SearchResultList> users = modelService.searchObjects(UserType.class, null, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/gensync/TestRoleEntitlement.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/gensync/TestRoleEntitlement.java index 3882a883656..a168e1316c3 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/gensync/TestRoleEntitlement.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/gensync/TestRoleEntitlement.java @@ -437,11 +437,11 @@ public void test120AddEntitlement() throws Exception { XMLGregorianCalendar startTime = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); Collection> executedChanges = executeChanges(groupDelta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTime = clock.currentTimeXMLGregorianCalendar(); @@ -493,11 +493,11 @@ public void test121ModifyRoleLinkEntitlement() throws Exception { roleDelta.addModification(linkDelta); // WHEN - when(TEST_NAME); + when(); executeChanges(roleDelta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject role = getRole(ROLE_PIRATE_OID); @@ -635,11 +635,11 @@ public void test131ModifyRoleAssignEntitlement() throws Exception { Collection> deltas = MiscSchemaUtil.createCollection(assignmentDelta); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess("executeChanges result", result); PrismObject role = getRole(ROLE_PIRATE_OID); @@ -1153,11 +1153,11 @@ public void test200AddRoleSwashbuckler() throws Exception { XMLGregorianCalendar startTime = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); executeChanges(roleDelta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTime = clock.currentTimeXMLGregorianCalendar(); @@ -1217,11 +1217,11 @@ public void test210ModifyRoleSwashbucklerRiskLevel() throws Exception { .assertItems(PIRACY_COST_CENTER); // WHEN - when(TEST_NAME); + when(); modifyObjectReplaceProperty(RoleType.class, ROLE_SWASHBUCKLER_OID, RoleType.F_RISK_LEVEL, task, result, "99"); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertRoleAfter(ROLE_SWASHBUCKLER_OID) diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/AbstractDirectManualResourceTest.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/AbstractDirectManualResourceTest.java index de7092e860d..687ebaf670e 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/AbstractDirectManualResourceTest.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/AbstractDirectManualResourceTest.java @@ -126,11 +126,11 @@ public void test220ModifyUserWillDisable() throws Exception { accountWillReqestTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(userWillOid, ACTIVATION_ADMINISTRATIVE_STATUS_PATH, task, result, ActivationStatusType.DISABLED); // THEN - then(TEST_NAME); + then(); display("result", result); willLastCaseOid = assertInProgress(result); @@ -211,11 +211,11 @@ public void test230ModifyAccountWillChangePasswordAndEnable() throws Exception { accountWillSecondReqestTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); executeChanges(delta, null, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); willSecondLastCaseOid = assertInProgress(result); @@ -293,12 +293,12 @@ public void test240CloseDisableCaseAndReadAccountWill() throws Exception { accountWillCompletionTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); PrismObject shadowModel = modelService.getObject(ShadowType.class, accountWillOid, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); accountWillCompletionTimestampEnd = clock.currentTimeXMLGregorianCalendar(); @@ -384,11 +384,11 @@ public void test250RecomputeWillAfter5min() throws Exception { display("Shadow before", shadowBefore); // WHEN - when(TEST_NAME); + when(); recomputeUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject shadowRepo = repositoryService.getObject(ShadowType.class, accountWillOid, null, result); @@ -468,12 +468,12 @@ public void test252UpdateBackingStoreAndGetAccountWill() throws Exception { backingStoreUpdateWill(USER_WILL_FULL_NAME_PIRATE, INTEREST_ONE, ActivationStatusType.DISABLED, USER_WILL_PASSWORD_OLD); // WHEN - when(TEST_NAME); + when(); PrismObject shadowModel = modelService.getObject(ShadowType.class, accountWillOid, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Model shadow", shadowModel); @@ -528,11 +528,11 @@ public void test260ClosePasswordChangeCaseAndRecomputeWill() throws Exception { accountWillSecondCompletionTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); recomputeUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); accountWillSecondCompletionTimestampEnd = clock.currentTimeXMLGregorianCalendar(); @@ -633,11 +633,11 @@ public void test270RecomputeWillAfter7min() throws Exception { display("Shadow before", shadowBefore); // WHEN - when(TEST_NAME); + when(); recomputeUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject shadowRepo = assertRepoShadow(accountWillOid) @@ -728,12 +728,12 @@ public void test272UpdateBackingStoreAndGetAccountWill() throws Exception { backingStoreUpdateWill(USER_WILL_FULL_NAME_PIRATE, INTEREST_ONE, ActivationStatusType.ENABLED, USER_WILL_PASSWORD_NEW); // WHEN - when(TEST_NAME); + when(); PrismObject shadowModel = modelService.getObject(ShadowType.class, accountWillOid, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); ShadowAsserter.forShadow(shadowModel, "model") @@ -789,11 +789,11 @@ public void test274RecomputeWillAfter22min() throws Exception { display("Shadow before", shadowBefore); // WHEN - when(TEST_NAME); + when(); recomputeUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject shadowRepo = assertRepoShadow(accountWillOid) @@ -871,11 +871,11 @@ public void test280RecomputeWillAfter27min() throws Exception { clockForward("PT5M"); // WHEN - when(TEST_NAME); + when(); recomputeUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject shadowRepo = assertRepoShadow(accountWillOid) @@ -944,11 +944,11 @@ public void test290RecomputeWillAfter32min() throws Exception { clockForward("PT5M"); // WHEN - when(TEST_NAME); + when(); recomputeUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject shadowRepo = repositoryService.getObject(ShadowType.class, accountWillOid, null, result); @@ -1008,11 +1008,11 @@ public void test300UnassignAccountWill() throws Exception { accountWillReqestTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); unassignRole(userWillOid, getRoleOneOid(), task, result); // THEN - then(TEST_NAME); + then(); display("result", result); willLastCaseOid = assertInProgress(result); @@ -1080,11 +1080,11 @@ public void test302RecomputeWill() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); recomputeUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); assertSuccess(result); @@ -1154,12 +1154,12 @@ public void test310CloseCaseAndReconcileWill() throws Exception { accountWillCompletionTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); // We need reconcile and not recompute here. We need to fetch the updated case status. reconcileUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); assertSuccess(result); @@ -1217,11 +1217,11 @@ public void test320RecomputeWillAfter5min() throws Exception { clockForward("PT5M"); // WHEN - when(TEST_NAME); + when(); reconcileUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); ShadowAsserter shadowRepoAsserter = assertRepoShadow(accountWillOid) @@ -1271,14 +1271,14 @@ public void test330UpdateBackingStoreAndRecomputeWill() throws Exception { displayBackingStore(); // WHEN - when(TEST_NAME); + when(); // Reconcile is needed here. Recompute means noFetch which means that we won't // discover that an account is missing from backing store which means that the // quantum state won't collapse. reconcileUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); ShadowAsserter shadowRepoAsserter = assertRepoShadow(accountWillOid) @@ -1333,11 +1333,11 @@ public void test340RecomputeWillAfter25min() throws Exception { clockForward("PT20M"); // WHEN - when(TEST_NAME); + when(); recomputeUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(userWillOid) @@ -1374,11 +1374,11 @@ public void test342RecomputeWillAfter35min() throws Exception { clockForward("PT10M"); // WHEN - when(TEST_NAME); + when(); recomputeUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertRepoShadow(accountWillOid); @@ -1412,11 +1412,11 @@ public void test344RecomputeWillAfter165min() throws Exception { clockForward("PT130M"); // WHEN - when(TEST_NAME); + when(); recomputeUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); UserAsserter userAfterAsserter = assertUserAfter(userWillOid); @@ -1475,11 +1475,11 @@ public void test510UnassignWillRoleOne() throws Exception { accountWillSecondReqestTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); unassignRole(userWillOid, getRoleOneOid(), task, result); // THEN - then(TEST_NAME); + then(); display("result", result); willSecondLastCaseOid = assertInProgress(result); @@ -1543,11 +1543,11 @@ public void test512ReconcileWill() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); reconcileUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); assertSuccess(result); @@ -1618,12 +1618,12 @@ public void test515CloseCasesAndReconcileWill() throws Exception { accountWillCompletionTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); // We need reconcile and not recompute here. We need to fetch the updated case status. reconcileUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); assertSuccess(result); @@ -1715,11 +1715,11 @@ public void test516RecomputeWillAfter20min() throws Exception { clockForward("PT20M"); // WHEN - when(TEST_NAME); + when(); reconcileUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(userWillOid) @@ -1749,11 +1749,11 @@ public void test517RecomputeWillAfter50min() throws Exception { clockForward("PT15M"); // WHEN - when(TEST_NAME); + when(); reconcileUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertRepoShadow(accountWillOid); @@ -1785,11 +1785,11 @@ public void test518RecomputeWillAfter180min() throws Exception { clockForward("PT130M"); // WHEN - when(TEST_NAME); + when(); reconcileUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(userWillOid) @@ -1847,11 +1847,11 @@ public void test522AssignWillRoleTwoValidFrom() throws Exception { activationType.setValidFrom(roleTwoValidFromTimestamp); // WHEN - when(TEST_NAME); + when(); assignRole(userWillOid, getRoleTwoOid(), activationType, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); accountWillOid = assertUserAfter(userWillOid) @@ -1881,11 +1881,11 @@ public void test524TwoHoursForRoleTwo() throws Exception { accountWillSecondReqestTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); reconcileUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); willSecondLastCaseOid = assertInProgress(result); @@ -1949,12 +1949,12 @@ public void test525CloseCasesAndReconcileWill() throws Exception { accountWillCompletionTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); // We need reconcile and not recompute here. We need to fetch the updated case status. reconcileUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); assertSuccess(result); @@ -1985,12 +1985,12 @@ public void test526UnassignWillBothRoles() throws Exception { accountWillSecondReqestTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); unassignAll(userBefore, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); willLastCaseOid = assertInProgress(result); @@ -2044,12 +2044,12 @@ public void test528CloseCaseAndRecomputeWill() throws Exception { accountWillCompletionTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); // We need reconcile and not recompute here. We need to fetch the updated case status. reconcileUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); assertSuccess(result); @@ -2118,11 +2118,11 @@ public void test800ImportShadowRefreshTask() throws Exception { // GIVEN // WHEN - when(TEST_NAME); + when(); addTask(TASK_SHADOW_REFRESH_FILE); // THEN - then(TEST_NAME); + then(); waitForTaskStart(TASK_SHADOW_REFRESH_OID, false); } @@ -2162,11 +2162,11 @@ public void test820AssignAccountJack() throws Exception { accountJackReqestTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_JACK_OID, getResourceOid(), null, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); jackLastCaseOid = assertInProgress(result); @@ -2199,12 +2199,12 @@ public void test830CloseCaseWillAndWaitForRefresh() throws Exception { accountWillCompletionTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); restartTask(TASK_SHADOW_REFRESH_OID); waitForTaskFinish(TASK_SHADOW_REFRESH_OID, false); // THEN - then(TEST_NAME); + then(); assertSuccess(result); accountWillCompletionTimestampEnd = clock.currentTimeXMLGregorianCalendar(); @@ -2224,11 +2224,11 @@ public void test840AddToBackingStoreAndGetAccountWill() throws Exception { backingStoreProvisionWill(INTEREST_ONE); // WHEN - when(TEST_NAME); + when(); PrismObject shadowModel = modelService.getObject(ShadowType.class, accountWillOid, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); ShadowAsserter.forShadow(shadowModel, "model") diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/AbstractGroupingManualResourceTest.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/AbstractGroupingManualResourceTest.java index 7705244dbb7..5d527898428 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/AbstractGroupingManualResourceTest.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/AbstractGroupingManualResourceTest.java @@ -170,11 +170,11 @@ public void test220ModifyUserWillDisable() throws Exception { accountWillReqestTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(userWillOid, ACTIVATION_ADMINISTRATIVE_STATUS_PATH, task, result, ActivationStatusType.DISABLED); // THEN - then(TEST_NAME); + then(); display("result", result); willLastCaseOid = assertInProgress(result); @@ -258,11 +258,11 @@ public void test230ModifyAccountWillChangePasswordAndEnable() throws Exception { accountWillSecondReqestTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); executeChanges(delta, null, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); assertInProgress(result); @@ -341,11 +341,11 @@ public void test232RunPropagationBeforeInterval() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); runPropagation(); // THEN - then(TEST_NAME); + then(); assertAccountWillAfterChangePasswordAndEnable(TEST_NAME); } @@ -366,11 +366,11 @@ public void test235RunPropagationAfterInterval() throws Exception { accountWillExecutionTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); runPropagation(); // THEN - then(TEST_NAME); + then(); accountWillExecutionTimestampEnd = clock.currentTimeXMLGregorianCalendar(); @@ -473,12 +473,12 @@ public void test240CloseCaseAndReadAccountWill() throws Exception { accountWillCompletionTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); PrismObject shadowModel = modelService.getObject(ShadowType.class, accountWillOid, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); accountWillCompletionTimestampEnd = clock.currentTimeXMLGregorianCalendar(); @@ -503,11 +503,11 @@ public void test250RecomputeWillAfter5min() throws Exception { display("Shadow before", shadowBefore); // WHEN - when(TEST_NAME); + when(); recomputeUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertAccountWillAfterChangePasswordAndEnableCaseClosed(TEST_NAME, null); @@ -530,12 +530,12 @@ public void test272UpdateBackingStoreAndGetAccountWill() throws Exception { backingStoreUpdateWill(USER_WILL_FULL_NAME_PIRATE, INTEREST_ONE, ActivationStatusType.ENABLED, USER_WILL_PASSWORD_NEW); // WHEN - when(TEST_NAME); + when(); PrismObject shadowModel = modelService.getObject(ShadowType.class, accountWillOid, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); ShadowAsserter shadowModelAsserter = ShadowAsserter.forShadow(shadowModel, "model") @@ -585,12 +585,12 @@ public void test273GetAccountWill() throws Exception { clockForward("PT15M"); // WHEN - when(TEST_NAME); + when(); PrismObject shadowModel = modelService.getObject(ShadowType.class, accountWillOid, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); ShadowAsserter shadowModelAsserter = ShadowAsserter.forShadow(shadowModel, "model") @@ -639,11 +639,11 @@ public void test290RecomputeWillAfter15min() throws Exception { clockForward("PT15M"); // WHEN - when(TEST_NAME); + when(); recomputeUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject shadowRepo = repositoryService.getObject(ShadowType.class, accountWillOid, null, result); @@ -698,11 +698,11 @@ public void test300UnassignAccountWill() throws Exception { accountWillReqestTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); unassignRole(userWillOid, getRoleOneOid(), task, result); // THEN - then(TEST_NAME); + then(); display("result", result); willLastCaseOid = assertInProgress(result); @@ -775,11 +775,11 @@ public void test302RunPropagationAfterInterval() throws Exception { accountWillExecutionTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); runPropagation(); // THEN - then(TEST_NAME); + then(); accountWillExecutionTimestampEnd = clock.currentTimeXMLGregorianCalendar(); @@ -850,12 +850,12 @@ public void test310CloseCaseAndRecomputeWill() throws Exception { accountWillCompletionTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); // We need reconcile and not recompute here. We need to fetch the updated case status. reconcileUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); assertSuccess(result); @@ -900,11 +900,11 @@ public void test330UpdateBackingStoreAndRecomputeWill() throws Exception { displayBackingStore(); // WHEN - when(TEST_NAME); + when(); recomputeUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject shadowRepo = repositoryService.getObject(ShadowType.class, accountWillOid, null, result); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/AbstractManualResourceTest.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/AbstractManualResourceTest.java index d28acdaf035..271fe7c6c52 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/AbstractManualResourceTest.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/AbstractManualResourceTest.java @@ -318,11 +318,11 @@ public void testConnection(final String TEST_NAME, boolean initialized) throws E } // WHEN - when(TEST_NAME); + when(); OperationResult testResult = modelService.testResource(getResourceOid(), task); // THEN - then(TEST_NAME); + then(); display("Test result", testResult); TestUtil.assertSuccess("Test resource failed (result)", testResult); @@ -500,19 +500,19 @@ public void testResourceCaching(final String TEST_NAME) throws Exception { assertSteadyResources(); // WHEN - when(TEST_NAME); + when(); PrismObject resourceReadOnlyAgain = modelService.getObject( ResourceType.class, getResourceOid(), GetOperationOptions.createReadOnlyCollection(), task, result); assertSteadyResources(); // WHEN - when(TEST_NAME); + when(); PrismObject resourceAgain = modelService.getObject( ResourceType.class, getResourceOid(), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); // assertTrue("Resource instance changed", resourceBefore == resourceReadOnlyAgain); @@ -531,11 +531,11 @@ public void test020ReimportResource() throws Exception { options.setOverwrite(true); // WHEN - when(TEST_NAME); + when(); modelService.importObjectsFromFile(getResourceFile(), options, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); } @@ -571,11 +571,11 @@ public void test030ReimportResourceAgain() throws Exception { options.setOverwrite(true); // WHEN - when(TEST_NAME); + when(); modelService.importObjectsFromFile(getResourceFile(), options, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); } @@ -590,11 +590,11 @@ public void test032UseResource() throws Exception { ObjectQuery query = ObjectQueryUtil.createResourceAndKindIntent(getResourceOid(), ShadowKindType.ACCOUNT, null, prismContext); // WHEN - when(TEST_NAME); + when(); SearchResultList> accounts = modelService.searchObjects(ShadowType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Found accounts", accounts); @@ -682,11 +682,11 @@ public void test101GetAccountWillFuture() throws Exception { Collection> options = SelectorOptions.createCollection(GetOperationOptions.createPointInTimeType(PointInTimeType.FUTURE)); // WHEN - when(TEST_NAME); + when(); PrismObject shadowModel = modelService.getObject(ShadowType.class, accountWillOid, options, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Model shadow", shadowModel); @@ -713,11 +713,11 @@ public void test102RecomputeWill() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); recomputeUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertAccountWillAfterAssign(TEST_NAME, USER_WILL_FULL_NAME, PendingOperationExecutionStatusType.EXECUTION_PENDING); @@ -738,11 +738,11 @@ public void test103RunPropagation() throws Exception { clockForward("PT2M"); // WHEN - when(TEST_NAME); + when(); runPropagation(); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertCounterIncrement(InternalCounters.CONNECTOR_MODIFICATION_COUNT, 1); @@ -763,11 +763,11 @@ public void test104RecomputeWill() throws Exception { rememberCounter(InternalCounters.CONNECTOR_MODIFICATION_COUNT); // WHEN - when(TEST_NAME); + when(); recomputeUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertCounterIncrement(InternalCounters.CONNECTOR_MODIFICATION_COUNT, 0); @@ -788,11 +788,11 @@ public void test105RunPropagationAgain() throws Exception { rememberCounter(InternalCounters.CONNECTOR_MODIFICATION_COUNT); // WHEN - when(TEST_NAME); + when(); runPropagation(); // THEN - then(TEST_NAME); + then(); assertCounterIncrement(InternalCounters.CONNECTOR_MODIFICATION_COUNT, 0); assertAccountWillAfterAssign(TEST_NAME, USER_WILL_FULL_NAME, PendingOperationExecutionStatusType.EXECUTING); @@ -815,11 +815,11 @@ public void test106AddToBackingStoreAndGetAccountWill() throws Exception { displayBackingStore(); // WHEN - when(TEST_NAME); + when(); PrismObject shadowModel = modelService.getObject(ShadowType.class, accountWillOid, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Model shadow", shadowModel); @@ -858,11 +858,11 @@ public void test108GetAccountWillFuture() throws Exception { Collection> options = SelectorOptions.createCollection(GetOperationOptions.createPointInTimeType(PointInTimeType.FUTURE)); // WHEN - when(TEST_NAME); + when(); PrismObject shadowModel = modelService.getObject(ShadowType.class, accountWillOid, options, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Model shadow", shadowModel); @@ -907,12 +907,12 @@ public void test110CloseCaseAndRecomputeWill() throws Exception { accountWillCompletionTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); // We need reconcile and not recompute here. We need to fetch the updated case status. reconcileUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); accountWillCompletionTimestampEnd = clock.currentTimeXMLGregorianCalendar(); @@ -934,11 +934,11 @@ public void test114RunPropagation() throws Exception { rememberCounter(InternalCounters.CONNECTOR_MODIFICATION_COUNT); // WHEN - when(TEST_NAME); + when(); runPropagation(); // THEN - then(TEST_NAME); + then(); assertCounterIncrement(InternalCounters.CONNECTOR_MODIFICATION_COUNT, 0); assertWillAfterCreateCaseClosed(TEST_NAME, true); @@ -959,11 +959,11 @@ public void test120RecomputeWillAfter5min() throws Exception { clockForward("PT5M"); // WHEN - when(TEST_NAME); + when(); recomputeUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertRepoShadow(accountWillOid) @@ -1001,11 +1001,11 @@ public void test130RecomputeWillAfter25min() throws Exception { clockForward("PT20M"); // WHEN - when(TEST_NAME); + when(); recomputeUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertRepoShadow(accountWillOid) @@ -1043,11 +1043,11 @@ public void test132RecomputeWillAfter32min() throws Exception { clockForward("PT7M"); // WHEN - when(TEST_NAME); + when(); recomputeUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertRepoShadow(accountWillOid) @@ -1078,11 +1078,11 @@ public void test200ModifyUserWillFullname() throws Exception { accountWillReqestTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(userWillOid, UserType.F_FULL_NAME, task, result, createPolyString(USER_WILL_FULL_NAME_PIRATE)); // THEN - then(TEST_NAME); + then(); display("result", result); willLastCaseOid = assertInProgress(result); @@ -1101,11 +1101,11 @@ public void test202RecomputeWill() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); recomputeUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertAccountWillAfterFullNameModification(TEST_NAME, PendingOperationExecutionStatusType.EXECUTION_PENDING); @@ -1121,11 +1121,11 @@ public void test203RunPropagation() throws Exception { clockForward("PT2M"); // WHEN - when(TEST_NAME); + when(); runPropagation(); // THEN - then(TEST_NAME); + then(); assertAccountWillAfterFullNameModification(TEST_NAME, PendingOperationExecutionStatusType.EXECUTING); @@ -1140,11 +1140,11 @@ public void test204RecomputeWill() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); recomputeUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertAccountWillAfterFullNameModification(TEST_NAME, PendingOperationExecutionStatusType.EXECUTING); @@ -1167,11 +1167,11 @@ public void test206CloseCaseAndRecomputeWill() throws Exception { accountWillCompletionTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); recomputeUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); accountWillCompletionTimestampEnd = clock.currentTimeXMLGregorianCalendar(); @@ -1242,11 +1242,11 @@ public void test210RecomputeWillAfter5min() throws Exception { clockForward("PT5M"); // WHEN - when(TEST_NAME); + when(); recomputeUser(userWillOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject shadowRepo = repositoryService.getObject(ShadowType.class, accountWillOid, null, result); @@ -1301,12 +1301,12 @@ public void test212UpdateBackingStoreAndGetAccountWill() throws Exception { backingStoreUpdateWill(USER_WILL_FULL_NAME_PIRATE, INTEREST_ONE, ActivationStatusType.ENABLED, USER_WILL_PASSWORD_OLD); // WHEN - when(TEST_NAME); + when(); PrismObject shadowModel = modelService.getObject(ShadowType.class, accountWillOid, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertShadowActivationAdministrativeStatus(shadowModel, ActivationStatusType.ENABLED); @@ -1362,11 +1362,11 @@ public void test400PhantomAccount() throws Exception { setupPhantom(); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_PHANTOM_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); // This should theoretically always return IN_PROGRESS, as there is // reconciliation operation going on. But due to various "peculiarities" @@ -1378,11 +1378,11 @@ public void test400PhantomAccount() throws Exception { } // WHEN - when(TEST_NAME); + when(); runPropagation(); // THEN - then(TEST_NAME); + then(); PrismObject userAfter = getUser(USER_PHANTOM_OID); display("User after", userAfter); @@ -1435,22 +1435,22 @@ public void test410AssignPhoenixAccount() throws Exception { addObject(USER_PHOENIX_FILE); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_PHOENIX_OID, getResourceOid(), null, task, result); // THEN - then(TEST_NAME); + then(); assertInProgress(result); // Make sure the operation will be picked up by propagation task clockForward("PT3M"); // WHEN - when(TEST_NAME); + when(); runPropagation(); // THEN - then(TEST_NAME); + then(); PrismObject userAfter = getUser(USER_PHOENIX_OID); display("User after", userAfter); @@ -1482,11 +1482,11 @@ public void test412AddPhoenixToBackingStoreAndCloseTicket() throws Exception { closeCase(phoenixLastCaseOid); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_PHOENIX_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_PHOENIX_OID); @@ -1519,11 +1519,11 @@ public void test413PhoenixLetOperationsExpire() throws Exception { clockForward("PT1H"); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_PHOENIX_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_PHOENIX_OID); @@ -1554,22 +1554,22 @@ public void test414UnassignPhoenixAccount() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignAccountFromUser(USER_PHOENIX_OID, getResourceOid(), null, task, result); // THEN - then(TEST_NAME); + then(); assertInProgress(result); // Make sure the operation will be picked up by propagation task clockForward("PT3M"); // WHEN - when(TEST_NAME); + when(); runPropagation(); // THEN - then(TEST_NAME); + then(); PrismObject userAfter = getUser(USER_PHOENIX_OID); display("User after", userAfter); @@ -1599,22 +1599,22 @@ public void test416PhoenixAccountUnassignCloseCase() throws Exception { closeCase(phoenixLastCaseOid); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_PHOENIX_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); // Make sure the operation will be picked up by propagation task clockForward("PT3M"); // WHEN - when(TEST_NAME); + when(); runPropagation(); // THEN - then(TEST_NAME); + then(); PrismObject userAfter = getUser(USER_PHOENIX_OID); display("User after", userAfter); @@ -1644,22 +1644,22 @@ public void test418AssignPhoenixAccountAgain() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_PHOENIX_OID, getResourceOid(), null, task, result); // THEN - then(TEST_NAME); + then(); phoenixLastCaseOid = assertInProgress(result); // Make sure the operation will be picked up by propagation task clockForward("PT3M"); // WHEN - when(TEST_NAME); + when(); runPropagation(); // THEN - then(TEST_NAME); + then(); PrismObject userAfter = getUser(USER_PHOENIX_OID); display("User after", userAfter); @@ -1789,7 +1789,7 @@ public void test910ConcurrentRolesAssign() throws Exception { final long TIMEOUT = 60000L; // WHEN - when(TEST_NAME); + when(); ParallelTestThread[] threads = multithread( (i) -> { @@ -1801,7 +1801,7 @@ public void test910ConcurrentRolesAssign() throws Exception { }, getConcurrentTestNumberOfThreads(), getConcurrentTestRandomStartDelayRangeAssign()); // THEN - then(TEST_NAME); + then(); waitForThreads(threads, TIMEOUT); PrismObject userAfter = getUser(USER_DRAKE_OID); @@ -1867,7 +1867,7 @@ public void test919ConcurrentRoleUnassign() throws Exception { final long TIMEOUT = 60000L; // WHEN - when(TEST_NAME); + when(); ParallelTestThread[] threads = multithread( (i) -> { @@ -1885,7 +1885,7 @@ public void test919ConcurrentRoleUnassign() throws Exception { }, getConcurrentTestNumberOfThreads(), getConcurrentTestRandomStartDelayRangeUnassign()); // THEN - then(TEST_NAME); + then(); waitForThreads(threads, TIMEOUT); PrismObject userAfter = getUser(USER_DRAKE_OID); @@ -2058,11 +2058,11 @@ protected void assignWillRoleOne(final String TEST_NAME, String expectedFullName accountWillReqestTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); assignRole(userWillOid, getRoleOneOid(), task, result); // THEN - then(TEST_NAME); + then(); display("result", result); willLastCaseOid = assertInProgress(result); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/TestDummyItsmIntegration.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/TestDummyItsmIntegration.java index 3a0ca88ecf2..7c530853a82 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/TestDummyItsmIntegration.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/TestDummyItsmIntegration.java @@ -125,11 +125,11 @@ public void test012TestConnection() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); OperationResult testResult = modelService.testResource(RESOURCE_DUMMY_ITSM_OID, task); // THEN - then(TEST_NAME); + then(); display("Test result", testResult); TestUtil.assertSuccess("Test resource failed (result)", testResult); @@ -153,11 +153,11 @@ public void test100AssignAccountToJack() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_JACK_OID, RESOURCE_DUMMY_ITSM_OID, null, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); jackLastTicketIdentifier = assertInProgress(result); @@ -184,11 +184,11 @@ public void test102CloseTicketAndRecomputeJack() throws Exception { closeDummyTicket(jackLastTicketIdentifier); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -208,11 +208,11 @@ public void test104UnassignAccountFromJack() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignAccountFromUser(USER_JACK_OID, RESOURCE_DUMMY_ITSM_OID, null, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); jackLastTicketIdentifier = assertInProgress(result); @@ -242,11 +242,11 @@ public void test108CloseTicketAndRecomputeJack() throws Exception { dumpItsm(); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -276,11 +276,11 @@ public void test109LetItExpire() throws Exception { clockForward("PT3H"); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) @@ -300,11 +300,11 @@ public void test110AssignItsmAccountToJackCommunicationError() throws Exception DummyItsm.getInstance().setFailureClass(CommunicationException.class); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_JACK_OID, RESOURCE_DUMMY_ITSM_OID, null, task, result); // THEN - then(TEST_NAME); + then(); DummyItsm.getInstance().clearFailureClass(); assertInProgress(result); @@ -341,12 +341,12 @@ public void test111ReconcileJackFixed() throws Exception { display("Repo shadow before", shadowRepoBefore); // WHEN - when(TEST_NAME); + when(); // This in fact should be a call to reconcile, not refresh directly (TODO: MID-4542) provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); jackLastTicketIdentifier = assertInProgress(result); @@ -380,11 +380,11 @@ public void test112CloseTicketAndRecomputeJackCommunicationError() throws Except DummyItsm.getInstance().setFailureClass(CommunicationException.class); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); DummyItsm.getInstance().clearFailureClass(); assertPartialError(result); @@ -416,11 +416,11 @@ public void test113RecomputeJackFixed() throws Exception { DummyItsm.getInstance().clearFailureClass(); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) @@ -450,11 +450,11 @@ public void test114UnassignAccountFromJackCommunicationError() throws Exception DummyItsm.getInstance().setFailureClass(CommunicationException.class); // WHEN - when(TEST_NAME); + when(); unassignAccountFromUser(USER_JACK_OID, RESOURCE_DUMMY_ITSM_OID, null, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); DummyItsm.getInstance().clearFailureClass(); assertResultStatus(result, OperationResultStatus.IN_PROGRESS); @@ -507,12 +507,12 @@ public void test115ReconcileJackFixed() throws Exception { display("Repo shadow before", shadowRepoBefore); // WHEN - when(TEST_NAME); + when(); // This in fact should be a call to reconcile, not refresh directly (TODO: MID-4542) provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); jackLastTicketIdentifier = assertInProgress(result); @@ -547,11 +547,11 @@ public void test117CloseTicketAndRecomputeJackCommunicationError() throws Except DummyItsm.getInstance().setFailureClass(CommunicationException.class); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); DummyItsm.getInstance().clearFailureClass(); assertPartialError(result); @@ -586,12 +586,12 @@ public void test118RecomputeJackFixed() throws Exception { display("Repo shadow before", shadowRepoBefore); // WHEN - when(TEST_NAME); + when(); // This in fact should be a call to reconcile, not refresh directly (TODO: MID-4542) provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) @@ -624,11 +624,11 @@ public void test119LetItExpire() throws Exception { clockForward("PT3H"); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/TestSemiManual.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/TestSemiManual.java index 4b644fa1207..bb63a51ae4b 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/TestSemiManual.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/TestSemiManual.java @@ -134,11 +134,11 @@ public void test700AssignAccountJackExisting() throws Exception { accountJackReqestTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_JACK_OID, getResourceOid(), null, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); assertSuccess(result, 2); assertNull("Unexpected ticket in result", result.getAsynchronousOperationReference()); @@ -185,11 +185,11 @@ public void test710UnassignAccountJack() throws Exception { accountJackReqestTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); unassignAccountFromUser(USER_JACK_OID, getResourceOid(), null, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); jackLastCaseOid = assertInProgress(result); @@ -242,12 +242,12 @@ public void test712CloseCaseAndRecomputeJack() throws Exception { accountJackCompletionTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); // We need reconcile and not recompute here. We need to fetch the updated case status. reconcileUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); assertSuccess(result); @@ -295,12 +295,12 @@ public void test717RecomputeJackAfter130min() throws Exception { clock.overrideDuration("PT130M"); // WHEN - when(TEST_NAME); + when(); // We need reconcile and not recompute here. We need to fetch the updated case status. reconcileUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); assertSuccess(result); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/TestSemiManualGroupingProposed.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/TestSemiManualGroupingProposed.java index 67ba3cfe7c5..bbff1af65b9 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/TestSemiManualGroupingProposed.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/manual/TestSemiManualGroupingProposed.java @@ -128,11 +128,11 @@ public void test500AssignBigmouthRoleOne() throws Exception { display("User before", userBefore); // WHEN - when(TEST_NAME); + when(); assignRole(userBigmouthOid, getRoleOneOid(), task, result); // THEN - then(TEST_NAME); + then(); display("result", result); bigmouthLastCaseOid = assertInProgress(result); @@ -182,11 +182,11 @@ public void test502RunPropagation() throws Exception { clockForward("PT20M"); // WHEN - when(TEST_NAME); + when(); runPropagation(); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PendingOperationExecutionStatusType executionStage = PendingOperationExecutionStatusType.EXECUTING; diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/mapping/TestMappingAutoInbound.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/mapping/TestMappingAutoInbound.java index 878f66eb00b..9dded5516b8 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/mapping/TestMappingAutoInbound.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/mapping/TestMappingAutoInbound.java @@ -78,18 +78,18 @@ public void test100ImportFromResource() throws Exception { assertUsers(getNumberOfUsers()); // WHEN - when(TEST_NAME); + when(); modelService.importFromResource(RESOURCE_DUMMY_AUTOGREEN_OID, new QName(MidPointConstants.NS_RI, SchemaConstants.ACCOUNT_OBJECT_CLASS_LOCAL_NAME), task, result); // THEN - then(TEST_NAME); + then(); OperationResult subresult = result.getLastSubresult(); TestUtil.assertInProgress("importAccountsFromResource result", subresult); waitForTaskFinish(task, true, 40000); // THEN - then(TEST_NAME); + then(); assertSuccess(task.getResult()); SearchResultList> users = modelService.searchObjects(UserType.class, null, null, task, result); @@ -121,11 +121,11 @@ public void test110ModifyAccountTitleCraticAndReconcile() throws Exception { accountHerman.replaceAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_TITLE_NAME, "cratic"); // WHEN - when(TEST_NAME); + when(); reconcileUser(userHermanOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(userHermanOid); @@ -149,11 +149,11 @@ public void test112ModifyAccountTitleDidacticGraphicAndReconcile() throws Except accountHerman.replaceAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_TITLE_NAME, "didactic", "graphic"); // WHEN - when(TEST_NAME); + when(); reconcileUser(userHermanOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(userHermanOid); @@ -187,18 +187,18 @@ public void test200ImportFromResourceAssociations() throws Exception { dummyGroup.addMember(USER_HERMAN_USERNAME); // WHEN - when(TEST_NAME); + when(); modelService.importFromResource(RESOURCE_DUMMY_AUTOGREEN_OID, new QName(MidPointConstants.NS_RI, "AccountObjectClass"), task, result); // THEN - then(TEST_NAME); + then(); OperationResult subresult = result.getLastSubresult(); TestUtil.assertInProgress("importAccountsFromResource result", subresult); waitForTaskFinish(task, true, 40000); // THEN - then(TEST_NAME); + then(); assertSuccess(task.getResult()); SearchResultList> users = modelService.searchObjects(UserType.class, null, null, task, result); @@ -226,12 +226,12 @@ public void test300ModifyAccountDirectAssign() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(userHermanOid, ROLE_ADMINS_OID); reconcileUser(userHermanOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(userHermanOid); @@ -264,18 +264,18 @@ public void test301removeUserFromAutoGroup() throws Exception { // WHEN - when(TEST_NAME); + when(); modelService.importFromResource(RESOURCE_DUMMY_AUTOGREEN_OID, new QName(MidPointConstants.NS_RI, "AccountObjectClass"), task, result); // THEN - then(TEST_NAME); + then(); OperationResult subresult = result.getLastSubresult(); TestUtil.assertInProgress("importAccountsFromResource result", subresult); waitForTaskFinish(task, true, 70000); // THEN - then(TEST_NAME); + then(); assertSuccess(task.getResult()); PrismObject userAfter = getUser(userHermanOid); @@ -307,11 +307,11 @@ public void test402assignAutoGroupDirectly() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(userHermanOid, ROLE_AUTOCRATIC_OID); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertDummyGroupMember(RESOURCE_DUMMY_AUTOGREEN_NAME, GROUP_DUMMY_TESTERS_NAME, USER_HERMAN_USERNAME); @@ -340,11 +340,11 @@ public void test403removeAllAssignments() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(userHermanOid, ROLE_ADMINS_OID); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(userHermanOid); @@ -371,18 +371,18 @@ public void test404importAssociationAutotesters() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modelService.importFromResource(RESOURCE_DUMMY_AUTOGREEN_OID, new QName(MidPointConstants.NS_RI, "AccountObjectClass"), task, result); // THEN - then(TEST_NAME); + then(); OperationResult subresult = result.getLastSubresult(); TestUtil.assertInProgress("importAccountsFromResource result", subresult); waitForTaskFinish(task, true, 40000); // THEN - then(TEST_NAME); + then(); assertSuccess(task.getResult()); PrismObject userAfter = getUser(userHermanOid); @@ -401,11 +401,11 @@ public void test405assignRoleAutocraticDirectly() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(userHermanOid, ROLE_AUTOCRATIC_OID); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(userHermanOid); @@ -429,11 +429,11 @@ public void test406unassignRoleAutocraticDirectly() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(userHermanOid, ROLE_AUTOCRATIC_OID); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(userHermanOid); @@ -460,11 +460,11 @@ public void test407addHermanToTestersReconcile() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); reconcileUser(userHermanOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(task.getResult()); PrismObject userAfter = getUser(userHermanOid); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/mapping/TestMappingInbound.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/mapping/TestMappingInbound.java index a68a563bd79..7ee0521a493 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/mapping/TestMappingInbound.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/mapping/TestMappingInbound.java @@ -97,11 +97,11 @@ public void test010SanitySchema() throws Exception { Task task = getTestTask(); /// WHEN - when(TEST_NAME); + when(); OperationResult testResult = modelService.testResource(RESOURCE_DUMMY_TEA_GREEN_OID, task); // THEN - then(TEST_NAME); + then(); TestUtil.assertSuccess(testResult); ResourceType resourceType = getDummyResourceType(RESOURCE_DUMMY_TEA_GREEN_NAME); @@ -125,11 +125,11 @@ public void test100ImportLiveSyncTaskDummyTeaGreen() throws Exception { OperationResult result = task.getResult(); /// WHEN - when(TEST_NAME); + when(); importSyncTask(); // THEN - then(TEST_NAME); + then(); waitForSyncTaskStart(); } @@ -153,14 +153,14 @@ public void test110AddDummyTeaGreenAccountMancomb() throws Exception { account.addAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_DRINK_NAME, "water"); /// WHEN - when(TEST_NAME); + when(); getDummyResource(RESOURCE_DUMMY_TEA_GREEN_NAME).addAccount(account); waitForSyncTaskNextRun(); // THEN - then(TEST_NAME); + then(); PrismObject accountMancomb = findAccountByUsername(ACCOUNT_MANCOMB_DUMMY_USERNAME, getDummyResourceObject(RESOURCE_DUMMY_TEA_GREEN_NAME)); display("Account mancomb", accountMancomb); @@ -204,7 +204,7 @@ public void test120ModifyMancombPhotoSource() throws Exception { OperationResult result = task.getResult(); /// WHEN - when(TEST_NAME); + when(); DummyAccount account = getDummyResource(RESOURCE_DUMMY_TEA_GREEN_NAME) .getAccountByUsername(ACCOUNT_MANCOMB_DUMMY_USERNAME); @@ -215,7 +215,7 @@ public void test120ModifyMancombPhotoSource() throws Exception { waitForSyncTaskNextRun(); // THEN - then(TEST_NAME); + then(); PrismObject accountMancomb = findAccountByUsername(ACCOUNT_MANCOMB_DUMMY_USERNAME, getDummyResourceObject(RESOURCE_DUMMY_TEA_GREEN_NAME)); display("Account mancomb", accountMancomb); @@ -239,7 +239,7 @@ public void test130ModifyMancombPhotoSourceAndReconcile() throws Exception { OperationResult result = task.getResult(); /// WHEN - when(TEST_NAME); + when(); // stop the task to avoid interference with the reconciliations suspendTask(TASK_LIVE_SYNC_DUMMY_TEA_GREEN_OID); @@ -256,7 +256,7 @@ public void test130ModifyMancombPhotoSourceAndReconcile() throws Exception { reconcileUser(userMancomb.getOid(), task, result); // THEN - then(TEST_NAME); + then(); PrismObject accountMancomb = findAccountByUsername(ACCOUNT_MANCOMB_DUMMY_USERNAME, getDummyResourceObject(RESOURCE_DUMMY_TEA_GREEN_NAME)); display("Account mancomb", accountMancomb); @@ -278,7 +278,7 @@ public void test140ModifyMancombPhotoInRepo() throws Exception { OperationResult result = task.getResult(); /// WHEN - when(TEST_NAME); + when(); PrismObject userMancomb = findUserByUsername(ACCOUNT_MANCOMB_DUMMY_USERNAME); assertNotNull("User mancomb has disappeared", userMancomb); @@ -289,7 +289,7 @@ public void test140ModifyMancombPhotoInRepo() throws Exception { executeChanges(delta, ModelExecuteOptions.createReconcile(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); @@ -318,7 +318,7 @@ public void test150UserReconcile() throws Exception { //assertUsers(5); /// WHEN - when(TEST_NAME); + when(); PrismObject userMancomb = findUserByUsername(ACCOUNT_MANCOMB_DUMMY_USERNAME); assertNotNull("User mancomb has disappeared", userMancomb); @@ -326,7 +326,7 @@ public void test150UserReconcile() throws Exception { reconcileUser(userMancomb.getOid(), task, result); // THEN - then(TEST_NAME); + then(); PrismObject accountMancomb = findAccountByUsername(ACCOUNT_MANCOMB_DUMMY_USERNAME, getDummyResourceObject(RESOURCE_DUMMY_TEA_GREEN_NAME)); display("Account mancomb", accountMancomb); @@ -372,7 +372,7 @@ public void test300DeleteDummyTeaGreenAccountMancomb() throws Exception { OperationResult result = task.getResult(); /// WHEN - when(TEST_NAME); + when(); getDummyResource(RESOURCE_DUMMY_TEA_GREEN_NAME).deleteAccountByName(ACCOUNT_MANCOMB_DUMMY_USERNAME); display("Dummy (tea green) resource", getDummyResource(RESOURCE_DUMMY_TEA_GREEN_NAME).debugDump()); @@ -382,7 +382,7 @@ public void test300DeleteDummyTeaGreenAccountMancomb() throws Exception { waitForSyncTaskNextRun(); // THEN - then(TEST_NAME); + then(); assertNoDummyAccount(RESOURCE_DUMMY_TEA_GREEN_NAME, ACCOUNT_MANCOMB_DUMMY_USERNAME); @@ -410,11 +410,11 @@ public void test399DeleteDummyTeaGreenAccountMancomb() throws Exception { OperationResult result = task.getResult(); /// WHEN - when(TEST_NAME); + when(); deleteObject(TaskType.class, TASK_LIVE_SYNC_DUMMY_TEA_GREEN_OID, task, result); // THEN - then(TEST_NAME); + then(); assertNoObject(TaskType.class, TASK_LIVE_SYNC_DUMMY_TEA_GREEN_OID); } @@ -437,7 +437,7 @@ public void test400AddUserLeeloo() throws Exception { getDummyResource(RESOURCE_DUMMY_TEA_GREEN_NAME).addAccount(account); /// WHEN - when(TEST_NAME); + when(); modelService.importFromResource(RESOURCE_DUMMY_TEA_GREEN_OID, new QName(MidPointConstants.NS_RI, SchemaConstants.ACCOUNT_OBJECT_CLASS_LOCAL_NAME), task, result); @@ -446,7 +446,7 @@ public void test400AddUserLeeloo() throws Exception { waitForTaskFinish(task, true); // THEN - then(TEST_NAME); + then(); userLeelooOid = assertUserAfterByUsername(ACCOUNT_LEELOO_USERNAME) .assertFullName(ACCOUNT_LEELOO_FULL_NAME_MULTIPASS) @@ -482,12 +482,12 @@ public void test402UserLeelooRecompute() throws Exception { dummyAuditService.clear(); /// WHEN - when(TEST_NAME); + when(); recomputeUser(userLeelooOid, task, result); // THEN - then(TEST_NAME); + then(); assertUserAfterByUsername(ACCOUNT_LEELOO_USERNAME) .assertFullName(ACCOUNT_LEELOO_FULL_NAME_MULTIPASS) @@ -515,12 +515,12 @@ public void test404UserLeelooReconcile() throws Exception { dummyAuditService.clear(); /// WHEN - when(TEST_NAME); + when(); reconcileUser(userLeelooOid, task, result); // THEN - then(TEST_NAME); + then(); assertUserAfterByUsername(ACCOUNT_LEELOO_USERNAME) .assertFullName(ACCOUNT_LEELOO_FULL_NAME_MULTIPASS) @@ -556,12 +556,12 @@ public void test410UserLeeloominaiReconcile() throws Exception { dummyAuditService.clear(); /// WHEN - when(TEST_NAME); + when(); reconcileUser(userLeelooOid, task, result); // THEN - then(TEST_NAME); + then(); assertUserAfterByUsername(ACCOUNT_LEELOO_USERNAME) .assertFullName(ACCOUNT_LEELOO_FULL_NAME_LEELOOMINAI) @@ -594,12 +594,12 @@ public void test412UserLeeloominaiRecompute() throws Exception { dummyAuditService.clear(); /// WHEN - when(TEST_NAME); + when(); recomputeUser(userLeelooOid, task, result); // THEN - then(TEST_NAME); + then(); assertUserAfterByUsername(ACCOUNT_LEELOO_USERNAME) .assertFullName(ACCOUNT_LEELOO_FULL_NAME_LEELOOMINAI) @@ -627,12 +627,12 @@ public void test414UserLeeloominaiReconcile() throws Exception { dummyAuditService.clear(); /// WHEN - when(TEST_NAME); + when(); reconcileUser(userLeelooOid, task, result); // THEN - then(TEST_NAME); + then(); assertUserAfterByUsername(ACCOUNT_LEELOO_USERNAME) .assertFullName(ACCOUNT_LEELOO_FULL_NAME_LEELOOMINAI) @@ -668,12 +668,12 @@ public void test420UserLeelooStrangeReconcile() throws Exception { dummyAuditService.clear(); /// WHEN - when(TEST_NAME); + when(); reconcileUser(userLeelooOid, task, result); // THEN - then(TEST_NAME); + then(); assertUserAfterByUsername(ACCOUNT_LEELOO_USERNAME) .assertFullName(ACCOUNT_LEELOO_FULL_NAME_LEELOOMINAI) @@ -707,12 +707,12 @@ public void test424UserLeelooStrangeReconcile() throws Exception { dummyAuditService.clear(); /// WHEN - when(TEST_NAME); + when(); reconcileUser(userLeelooOid, task, result); // THEN - then(TEST_NAME); + then(); assertUserAfterByUsername(ACCOUNT_LEELOO_USERNAME) .assertFullName(ACCOUNT_LEELOO_FULL_NAME_LEELOOMINAI) diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/misc/TestMigration.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/misc/TestMigration.java index c52aeb6d7ad..482e0c5684a 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/misc/TestMigration.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/misc/TestMigration.java @@ -61,11 +61,11 @@ public void test050SanityLost1() throws Exception { final String TEST_NAME = "test050SanityLost1"; // WHEN - when(TEST_NAME); + when(); PrismObject shadowLost1Repo = getShadowRepo(SHADOW_ACCOUNT_DUMMY_LOST1_OID); // THEN - then(TEST_NAME); + then(); assertShadow(shadowLost1Repo, "Repo shadow") .assertPrimaryIdentifierValue(null); @@ -82,12 +82,12 @@ public void test100RefreshTaskDefault() throws Exception { addObject(TASK_SHADOW_REFRESH_FILE); // WHEN - when(TEST_NAME); + when(); waitForTaskStart(TASK_SHADOW_REFRESH_OID, false); waitForTaskFinish(TASK_SHADOW_REFRESH_OID, false); // THEN - then(TEST_NAME); + then(); PrismObject shadowLost1Repo = getShadowRepo(SHADOW_ACCOUNT_DUMMY_LOST1_OID); assertShadow(shadowLost1Repo, "Repo shadow") @@ -106,12 +106,12 @@ public void test110RefreshTaskExplicitDummy() throws Exception { addObject(TASK_SHADOW_REFRESH_EXPLICIT_DUMMY_FILE); // WHEN - when(TEST_NAME); + when(); waitForTaskStart(TASK_SHADOW_REFRESH_EXPLICIT_DUMMY_OID, false); waitForTaskFinish(TASK_SHADOW_REFRESH_EXPLICIT_DUMMY_OID, false); // THEN - then(TEST_NAME); + then(); PrismObject shadowLost1Repo = getShadowRepo(SHADOW_ACCOUNT_DUMMY_LOST1_OID); assertShadow(shadowLost1Repo, "Repo shadow") diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/misc/TestMisc.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/misc/TestMisc.java index 09ae4a27cc4..0afde18db71 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/misc/TestMisc.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/misc/TestMisc.java @@ -98,11 +98,11 @@ public void test100GetRepositoryDiag() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); RepositoryDiag diag = modelDiagnosticService.getRepositoryDiag(task, result); // THEN - then(TEST_NAME); + then(); display("Diag", diag); assertSuccess(result); @@ -119,11 +119,11 @@ public void test110RepositorySelfTest() throws Exception { Task task = getTestTask(); // WHEN - when(TEST_NAME); + when(); OperationResult testResult = modelDiagnosticService.repositorySelfTest(task); // THEN - then(TEST_NAME); + then(); display("Repository self-test result", testResult); TestUtil.assertSuccess("Repository self-test result", testResult); @@ -139,12 +139,12 @@ public void test200ExportUsers() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); List> users = modelService.searchObjects(UserType.class, null, SelectorOptions.createCollection(GetOperationOptions.createRaw()), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertEquals("Unexpected number of users", 6, users.size()); @@ -187,11 +187,11 @@ public void test210SearchUsersMatchingRulesPolystringNorm() throws Exception { .build(); // WHEN - when(TEST_NAME); + when(); List> users = modelService.searchObjects(UserType.class, query,null , task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertEquals("Unexpected number of users", 1, users.size()); @@ -221,7 +221,7 @@ public void test212SearchUsersMatchingRulesPolystringIgnoreCase() throws Excepti try { // WHEN - when(TEST_NAME); + when(); List> users = modelService.searchObjects(UserType.class, query, null, task, result); } catch (SystemException e) { @@ -249,11 +249,11 @@ public void test214SearchUsersMatchingRulesStringIgnoreCase() throws Exception { .build(); // WHEN - when(TEST_NAME); + when(); List> users = modelService.searchObjects(UserType.class, query,null , task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertEquals("Unexpected number of users", 1, users.size()); @@ -282,11 +282,11 @@ public void test216SearchUsersMatchingRulesStringNorm() throws Exception { .build(); // WHEN - when(TEST_NAME); + when(); List> users = modelService.searchObjects(UserType.class, query,null , task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertEquals("Unexpected number of users", 0, users.size()); @@ -305,11 +305,11 @@ public void test300RecomputeJack() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -329,11 +329,11 @@ public void test302UpdateKeyJack() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, getExtensionPath(PIRACY_KEY), task, result, KEY); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -352,11 +352,11 @@ public void test310AddUserClean() throws Exception { PrismObject userBefore = createUser(USER_CLEAN_NAME, USER_CLEAN_GIVEN_NAME, USER_CLEAN_FAMILY_NAME, true); // WHEN - when(TEST_NAME); + when(); addObject(userBefore, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); userCleanOid = userBefore.getOid(); @@ -378,11 +378,11 @@ public void test312UpdateBinaryIdClean() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(userCleanOid, getExtensionPath(PIRACY_BINARY_ID), task, result, KEY); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(userCleanOid); @@ -401,11 +401,11 @@ public void test320DefaultRelations() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); List relations = modelInteractionService.getRelationDefinitions(); // THEN - then(TEST_NAME); + then(); display("Relations", relations); assertRelationDef(relations, SchemaConstants.ORG_MANAGER, "RelationTypes.manager"); assertRelationDef(relations, SchemaConstants.ORG_OWNER, "RelationTypes.owner"); @@ -424,11 +424,11 @@ public void test400ImportRoleWithFilters() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modelService.importObjectsFromFile(ROLE_IMPORT_FILTERS_FILE, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject roleAfter = getRole(ROLE_IMPORT_FILTERS_OID); @@ -452,11 +452,11 @@ public void test500AddHocProvisioningScriptAssignJackResourceScripty() throws Ex assertAssignments(userBefore, 0); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_JACK_OID, RESOURCE_SCRIPTY_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -486,11 +486,11 @@ public void test502GetAccountJackResourceScripty() throws Exception { String accountOid = getSingleLinkOid(userBefore); // WHEN - when(TEST_NAME); + when(); PrismObject accountShadow = modelService.getObject(ShadowType.class, accountOid, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertAttribute(accountShadow.asObjectable(), @@ -518,11 +518,11 @@ public void test504GetAccountJackResourceScriptyAgain() throws Exception { String accountOid = getSingleLinkOid(userBefore); // WHEN - when(TEST_NAME); + when(); PrismObject accountShadow = modelService.getObject(ShadowType.class, accountOid, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertAttribute(accountShadow.asObjectable(), @@ -557,12 +557,12 @@ public void test506ModifyResourceGetAccountJackResourceScripty() throws Exceptio display("Resource version before", resourceBefore.getVersion()); // WHEN - when(TEST_NAME); + when(); modifyObjectReplaceProperty(ResourceType.class, RESOURCE_SCRIPTY_OID, ResourceType.F_DESCRIPTION, null, task, result, "Whatever"); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject resourceAfter = getObject(ResourceType.class, RESOURCE_SCRIPTY_OID); @@ -595,11 +595,11 @@ public void test600jackAssignRoleShip() throws Exception { // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_SHIP_OID); //THEN - then(TEST_NAME); + then(); PrismObject userAfter = getUser(USER_JACK_OID); display("User before", userAfter); assertAssignments(userAfter, 2); @@ -626,11 +626,11 @@ public void test601jackUnassignResourceAccount() throws Exception { assertAssignments(userBefore, 2); // WHEN - when(TEST_NAME); + when(); unassignAccountFromUser(USER_JACK_OID, RESOURCE_SCRIPTY_OID, null); //THEN - then(TEST_NAME); + then(); PrismObject userAfter = getUser(USER_JACK_OID); display("User after", userAfter); assertAssignments(userAfter, 1); @@ -654,11 +654,11 @@ public void test602jackUnssigndRoleShip() throws Exception { // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_SHIP_OID); //THEN - then(TEST_NAME); + then(); PrismObject userAfter = getUser(USER_JACK_OID); display("User before", userAfter); assertAssignments(userAfter, 0); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/misc/TestUuidNonUniqueName.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/misc/TestUuidNonUniqueName.java index 35d5ae1f0ed..a29f8f769d0 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/misc/TestUuidNonUniqueName.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/misc/TestUuidNonUniqueName.java @@ -72,11 +72,11 @@ public void test010TestResourceConnection() throws Exception { Task task = getTestTask(); // WHEN - when(TEST_NAME); + when(); OperationResult result = modelService.testResource(RESOURCE_DUMMY_UUID_NONUNIQUE_NAME_OID, task); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertResourceAfter(RESOURCE_DUMMY_UUID_NONUNIQUE_NAME_OID) @@ -93,11 +93,11 @@ public void test020RefinedSchema() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); PrismObject resource = modelService.getObject(ResourceType.class, RESOURCE_DUMMY_UUID_NONUNIQUE_NAME_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertResourceAfter(RESOURCE_DUMMY_UUID_NONUNIQUE_NAME_OID) @@ -127,11 +127,11 @@ public void test100AssignAccountToJackSparrow() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_JACK_OID, RESOURCE_DUMMY_UUID_NONUNIQUE_NAME_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); accountJackSparrowUid = assertUserAfter(USER_JACK_OID) @@ -163,11 +163,11 @@ public void test102GetAccountJackSparrow() throws Exception { .getOid(); // WHEN - when(TEST_NAME); + when(); PrismObject shadow = modelService.getObject(ShadowType.class, accountJackSparrowOid, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertShadow(shadow, "getObject") @@ -193,11 +193,11 @@ public void test110AssignAccountToJackSkellington() throws Exception { assertEquals(USER_SKELLINGTON_GIVEN_NAME, USER_JACK_GIVEN_NAME); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_SKELLINGTON_OID, RESOURCE_DUMMY_UUID_NONUNIQUE_NAME_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); accountJackSkellingtonUid = assertUserAfter(USER_SKELLINGTON_OID) diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/multi/TestMultiAccount.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/multi/TestMultiAccount.java index 0f3ec3aa302..0478db721c0 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/multi/TestMultiAccount.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/multi/TestMultiAccount.java @@ -101,11 +101,11 @@ public void test010ImportAccountsFromDummyMultiGreen() throws Exception { assertUsers(getNumberOfUsers()); // WHEN - when(TEST_NAME); + when(); importMultiGreenAccounts(task, result); // THEN - then(TEST_NAME); + then(); // No accounts on multigreen resource yet. No users should be created. assertUsers(getNumberOfUsers()); @@ -134,11 +134,11 @@ public void test020ImportPaulAtreides() throws Exception { assertUsers(getNumberOfUsers()); // WHEN - when(TEST_NAME); + when(); importMultiGreenAccounts(task, result); // THEN - then(TEST_NAME); + then(); accountPaulOid = assertUserAfterByUsername(ACCOUNT_PAUL_ATREIDES_USERNAME) .displayWithProjections() @@ -178,11 +178,11 @@ public void test100ImportMuadDib() throws Exception { assertUsers(getNumberOfUsers() + 1); // WHEN - when(TEST_NAME); + when(); importMultiGreenAccounts(task, result); // THEN - then(TEST_NAME); + then(); accountMuaddibOid = assertUserAfterByUsername(ACCOUNT_PAUL_ATREIDES_USERNAME) .displayWithProjections() @@ -226,11 +226,11 @@ public void test102ReconcileUserPaul() throws Exception { userPaulOid = findUserByUsername(ACCOUNT_PAUL_ATREIDES_USERNAME).getOid(); // WHEN - when(TEST_NAME); + when(); reconcileUser(userPaulOid, task, result); // THEN - then(TEST_NAME); + then(); accountMuaddibOid = assertUserAfter(userPaulOid) .displayWithProjections() @@ -287,11 +287,11 @@ public void test200ImportDuke() throws Exception { assertUsers(getNumberOfUsers() + 1); // WHEN - when(TEST_NAME); + when(); importMultiGreenAccounts(task, result); // THEN - then(TEST_NAME); + then(); accountDukeOid = assertUserAfterByUsername(ACCOUNT_PAUL_ATREIDES_USERNAME) .displayWithProjections() @@ -355,11 +355,11 @@ public void test210ImportMahdi() throws Exception { assertUsers(getNumberOfUsers() + 1); // WHEN - when(TEST_NAME); + when(); importMultiGreenAccounts(task, result); // THEN - then(TEST_NAME); + then(); accountMahdiOid = assertUserAfterByUsername(ACCOUNT_PAUL_ATREIDES_USERNAME) .displayWithProjections() diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/negative/TestAssignmentErrors.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/negative/TestAssignmentErrors.java index 93ef24a369e..aac4c28f7c7 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/negative/TestAssignmentErrors.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/negative/TestAssignmentErrors.java @@ -218,12 +218,12 @@ public void test101AddUserCharlesAssignBlankAccount() throws Exception { ObjectDelta userDelta = DeltaFactory.Object.createAddDelta(userCharles); // WHEN - when(TEST_NAME); + when(); //we do not expect this to throw an exception. instead the fatal error in the result is excpected Collection> executedChanges = executeChanges(userDelta, null, task, result); // THEN - then(TEST_NAME); + then(); assertFailure(result); // Even though the operation failed the addition of a user should be successful. Let's check if user was really added. @@ -265,12 +265,12 @@ public void test200UserLemonheadAssignAccountBrokenNetwork() throws Exception { dummyAuditService.clear(); // WHEN - when(TEST_NAME); + when(); // not expected that it fails, instead the error in the result is expected modelService.executeChanges(deltas, null, task, result); // THEN - then(TEST_NAME); + then(); display(result); // account cannot be updated due to a network error. The operation was postponed, therefore // it is "in progress". @@ -351,14 +351,14 @@ public void test210UserSharptoothAssignAccountBrokenGeneric() throws Exception { try { // WHEN - when(TEST_NAME); + when(); //not expected that it fails, instead the error in the result is expected modelService.executeChanges(deltas, null, task, result); assertNotReached(); } catch (GenericConnectorException e) { // THEN - then(TEST_NAME); + then(); display("Expected exception", e); } assertFailure(result); @@ -404,11 +404,11 @@ public void test212UserSharptoothAssignAccountRecovery() throws Exception { dummyAuditService.clear(); // WHEN - when(TEST_NAME); + when(); recomputeUser(userSharptoothOid, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -477,11 +477,11 @@ public void testUserSharptoothChangePasswordError(final String TEST_NAME, BreakM dummyAuditService.clear(); // WHEN - when(TEST_NAME); + when(); modifyUserChangePassword(userSharptoothOid, newPassword, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertStatus(result, expectedResultStatus); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/negative/TestBrokenResources.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/negative/TestBrokenResources.java index 233bd122a1a..72fff14fd9f 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/negative/TestBrokenResources.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/negative/TestBrokenResources.java @@ -819,11 +819,11 @@ public void test400AssignTwoResouresNotFound() throws Exception { ObjectDelta userDelta = createAssignTwoResourcesDelta(RESOURCE_CSVFILE_NOTFOUND_OID); // WHEN - when(TEST_NAME); + when(); executeChanges(userDelta, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); display("executeChanges result", result); assertPartialError(result); @@ -851,13 +851,13 @@ public void test401AssignTwoResouresBroken() throws Exception { try { // WHEN - when(TEST_NAME); + when(); executeChanges(userDelta, null, task, result); assertNotReached(); } catch (GenericConnectorException e) { // THEN - then(TEST_NAME); + then(); display("Expected exception", e); } @@ -896,11 +896,11 @@ public void test500AssignResourceBlack() throws Exception { assertNoDummyAccount(RESOURCE_DUMMY_BLACK_NAME, ACCOUNT_GUYBRUSH_DUMMY_USERNAME); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_GUYBRUSH_OID, RESOURCE_DUMMY_BLACK_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -928,11 +928,11 @@ public void test502ModifyUserEmployeeNumberNone() throws Exception { prepareTest5xx(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_GUYBRUSH_OID, UserType.F_EMPLOYEE_NUMBER, task, result, "none"); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -960,11 +960,11 @@ public void test509UnassignResourceBlack() throws Exception { prepareTest5xx(); // WHEN - when(TEST_NAME); + when(); unassignAccountFromUser(USER_GUYBRUSH_OID, RESOURCE_DUMMY_BLACK_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -999,14 +999,14 @@ public void test510AssignResourceBlackError() throws Exception { try { // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_GUYBRUSH_OID, RESOURCE_DUMMY_BLACK_OID, null, task, result); assertNotReached(); } catch (GenericConnectorException e) { // THEN - then(TEST_NAME); + then(); display("Expected exception", e); } @@ -1038,11 +1038,11 @@ public void test512ReconcileUser() throws Exception { prepareTest5xx(); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_GUYBRUSH_OID, task, result); // THEN - then(TEST_NAME); + then(); // Errors deep inside the results are expected assertSuccess(result, 2); @@ -1070,14 +1070,14 @@ public void test514ModifyUserEmployeeNumberRuntime() throws Exception { try { // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_GUYBRUSH_OID, UserType.F_EMPLOYEE_NUMBER, task, result, DummyResource.POWERFAIL_ARG_ERROR_RUNTIME); assertNotReached(); } catch (RuntimeException e) { // THEN - then(TEST_NAME); + then(); display("Expected exception", e); assertEquals("Wrong exception message", "Booom! PowerFail script failed (runtime)", e.getMessage()); } @@ -1110,14 +1110,14 @@ public void test518UnassignResourceBlack() throws Exception { try { // WHEN - when(TEST_NAME); + when(); unassignAccountFromUser(USER_GUYBRUSH_OID, RESOURCE_DUMMY_BLACK_OID, null, task, result); assertNotReached(); } catch (RuntimeException e) { // THEN - then(TEST_NAME); + then(); display("Expected exception", e); assertEquals("Wrong exception message", "Booom! PowerFail script failed (runtime)", e.getMessage()); } @@ -1150,11 +1150,11 @@ public void test519ReconcileUser() throws Exception { prepareTest5xx(); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_GUYBRUSH_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -1186,11 +1186,11 @@ public void test520AssignResourceEbonyError() throws Exception { assertNoDummyAccount(RESOURCE_DUMMY_EBONY_NAME, ACCOUNT_GUYBRUSH_DUMMY_USERNAME); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_GUYBRUSH_OID, RESOURCE_DUMMY_EBONY_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertPartialError(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -1220,11 +1220,11 @@ public void test524ModifyUserEmployeeNumberRuntime() throws Exception { prepareTest5xx(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_GUYBRUSH_OID, UserType.F_EMPLOYEE_NUMBER, task, result, DummyResource.POWERFAIL_ARG_ERROR_RUNTIME); // THEN - then(TEST_NAME); + then(); assertPartialError(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -1257,11 +1257,11 @@ public void test528UnassignResourceEbony() throws Exception { .assertLinks(1); // WHEN - when(TEST_NAME); + when(); unassignAccountFromUser(USER_GUYBRUSH_OID, RESOURCE_DUMMY_EBONY_OID, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); assertPartialError(result); @@ -1305,7 +1305,7 @@ public void test600GuybrushAssignAccountDummyViolet() throws Exception { try { // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_GUYBRUSH_OID, RESOURCE_DUMMY_BROKEN_VIOLET_OID, null, task, result); assertNotReached(); @@ -1314,7 +1314,7 @@ public void test600GuybrushAssignAccountDummyViolet() throws Exception { } // THEN - then(TEST_NAME); + then(); assertFailure(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/orgstruct/TestOrgStruct.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/orgstruct/TestOrgStruct.java index 56c55b67d26..c85598f81ba 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/orgstruct/TestOrgStruct.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/orgstruct/TestOrgStruct.java @@ -318,11 +318,11 @@ public void test208JackUnassignAll() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignAllReplace(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userJack = getUser(USER_JACK_OID); @@ -567,11 +567,11 @@ public void test230JackRecompute() throws Exception { rememberCounter(InternalCounters.SHADOW_FETCH_OPERATION_COUNT); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertRefs23x(); @@ -596,11 +596,11 @@ public void test232JackDestroyRefsAndRecompute() throws Exception { rememberCounter(InternalCounters.CONNECTOR_OPERATION_COUNT); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, ModelExecuteOptions.createReconcile(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertRefs23x(); @@ -638,11 +638,11 @@ public void test234JackDestroyRefsAndLightRecompute() throws Exception { options.setReconcileFocus(true); // WHEN - when(TEST_NAME); + when(); modelService.recompute(UserType.class, USER_JACK_OID, options, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertRefs23x(); @@ -692,11 +692,11 @@ public void test300JackUnassignAllOrgs() throws Exception { .createModifyDelta(USER_JACK_OID, modifications, UserType.class); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(MiscSchemaUtil.createCollection(userDelta), null, task, result); // THEN - then(TEST_NAME); + then(); PrismObject userJack = getUser(USER_JACK_OID); display("User jack after", userJack); assertAssignedNoOrg(userJack); @@ -865,13 +865,13 @@ public void test310JackConflictParentOrgRefAndAssignmentsAddOrg() throws Excepti try { // WHEN - when(TEST_NAME); + when(); addObject(orgBefore, task, result); assertNotReached(); } catch (PolicyViolationException e) { // THEN - then(TEST_NAME); + then(); display("Expected exception", e); assertFailure(result); } @@ -1457,11 +1457,11 @@ public void test425JackUnassignDeletedOrg() throws Exception { deleteObject(OrgType.class, ORG_TEMP_OID, task, result); // WHEN - when(TEST_NAME); + when(); unassignOrg(USER_JACK_OID, ORG_TEMP_OID, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); result.computeStatus(); TestUtil.assertSuccess(result, 1); @@ -1632,11 +1632,11 @@ public void test440JackModifyEmployeeTypeRolePirate() throws Exception { assertNoAssignments(userBefore); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_SUBTYPE, task, result, "ROLE:Pirate"); // THEN - then(TEST_NAME); + then(); PrismObject userAfter = getUser(USER_JACK_OID); display("User after", userAfter); assertAssignments(userAfter, 1); @@ -1769,11 +1769,11 @@ public void test510JackEndPirate() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserChangePassword(USER_JACK_OID, "X.marks.the.SPOT", task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/persona/AbstractPersonaTest.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/persona/AbstractPersonaTest.java index 63b4e41e6a4..0d55ea714ea 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/persona/AbstractPersonaTest.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/persona/AbstractPersonaTest.java @@ -64,11 +64,11 @@ public void test100AssignRolePersonaAdminToJack() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_PERSONA_ADMIN_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -100,11 +100,11 @@ public void test102RecomputeUserJack() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserJack11x(); @@ -119,11 +119,11 @@ public void test103ReconcileUserJack() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserJack11x(); @@ -138,11 +138,11 @@ public void test104RecomputeJackAdminPersona() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); recomputeUser(userJackAdminPersonaOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserJack11x(); @@ -157,11 +157,11 @@ public void test105ReconcileJackAdminPersona() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); reconcileUser(userJackAdminPersonaOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserJack11x(); @@ -193,11 +193,11 @@ public void test120ModifyJackGivenName() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_GIVEN_NAME, task, result, createPolyString(USER_JACK_GIVEN_NAME_NEW)); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -232,11 +232,11 @@ public void test140ModifyUserJackPassword() throws Exception { XMLGregorianCalendar startCal = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); modifyUserChangePassword(USER_JACK_OID, USER_PASSWORD_2_CLEAR, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endCal = clock.currentTimeXMLGregorianCalendar(); @@ -269,11 +269,11 @@ public void test142ModifyPersonaPassword() throws Exception { XMLGregorianCalendar startCal = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); modifyUserChangePassword(personaBefore.getOid(), USER_PASSWORD_3_CLEAR, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endCal = clock.currentTimeXMLGregorianCalendar(); @@ -309,11 +309,11 @@ public void test145ModifyPersonaPasswordBack() throws Exception { XMLGregorianCalendar startCal = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); modifyUserChangePassword(personaBefore.getOid(), USER_PASSWORD_2_CLEAR, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endCal = clock.currentTimeXMLGregorianCalendar(); @@ -344,11 +344,11 @@ public void test199UnassignRolePersonaAdminFromJack() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_PERSONA_ADMIN_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/persona/TestPersonaPassword.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/persona/TestPersonaPassword.java index 41cb92f31c7..cdeb66a56fe 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/persona/TestPersonaPassword.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/persona/TestPersonaPassword.java @@ -82,7 +82,7 @@ public void test145ModifyPersonaPasswordBack() throws Exception { try { // WHEN - when(TEST_NAME); + when(); modifyUserChangePassword(personaBefore.getOid(), USER_PASSWORD_2_CLEAR, task, result); @@ -93,7 +93,7 @@ public void test145ModifyPersonaPasswordBack() throws Exception { } // THEN - then(TEST_NAME); + then(); assertFailure(result); XMLGregorianCalendar endCal = clock.currentTimeXMLGregorianCalendar(); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/rbac/TestAssignmentValidity.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/rbac/TestAssignmentValidity.java index 80283c31490..72cbcf99b77 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/rbac/TestAssignmentValidity.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/rbac/TestAssignmentValidity.java @@ -63,11 +63,11 @@ public void test100JackAssignRolePirateValidTo() throws Exception { XMLGregorianCalendar startTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_PIRATE_OID, activationType, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTs = clock.currentTimeXMLGregorianCalendar(); @@ -97,11 +97,11 @@ public void test102Forward15min() throws Exception { clockForward("PT15M"); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -131,11 +131,11 @@ public void test104JackAssignRolePirateAgain() throws Exception { XMLGregorianCalendar startTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_PIRATE_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTs = clock.currentTimeXMLGregorianCalendar(); @@ -161,11 +161,11 @@ public void test106JackUnassignRolePirateValid() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_PIRATE_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -208,12 +208,12 @@ public void test110JackAssignRolePirateValidToRaw() throws Exception { ModelExecuteOptions options = ModelExecuteOptions.createRaw(); // WHEN - when(TEST_NAME); + when(); modifyUserAssignment(USER_JACK_OID, ROLE_PIRATE_OID, RoleType.COMPLEX_TYPE, null, task, null, activationType, true, options, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -241,11 +241,11 @@ public void test111RecomputeJack() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -273,11 +273,11 @@ public void test112Forward15min() throws Exception { clockForward("PT15M"); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -307,11 +307,11 @@ public void test114JackAssignRolePirateAgain() throws Exception { XMLGregorianCalendar startTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_PIRATE_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTs = clock.currentTimeXMLGregorianCalendar(); @@ -354,11 +354,11 @@ public void test120JackAssignRoleSailorValidTo() throws Exception { XMLGregorianCalendar startTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_STRONG_SAILOR_OID, activationType, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTs = clock.currentTimeXMLGregorianCalendar(); @@ -388,11 +388,11 @@ public void test122Forward15min() throws Exception { clockForward("PT15M"); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -422,11 +422,11 @@ public void test124JackAssignRoleSailorAgain() throws Exception { XMLGregorianCalendar startTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_STRONG_SAILOR_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTs = clock.currentTimeXMLGregorianCalendar(); @@ -470,12 +470,12 @@ public void test130JackAssignRoleSailorValidToRaw() throws Exception { ModelExecuteOptions options = ModelExecuteOptions.createRaw(); // WHEN - when(TEST_NAME); + when(); modifyUserAssignment(USER_JACK_OID, ROLE_STRONG_SAILOR_OID, RoleType.COMPLEX_TYPE, null, task, null, activationType, true, options, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -503,11 +503,11 @@ public void test131RecomputeJack() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -535,11 +535,11 @@ public void test132Forward15min() throws Exception { clockForward("PT15M"); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -569,11 +569,11 @@ public void test134JackAssignRoleSailorAgain() throws Exception { XMLGregorianCalendar startTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_STRONG_SAILOR_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTs = clock.currentTimeXMLGregorianCalendar(); @@ -617,12 +617,12 @@ public void test140JackAssignRoleSailorValidToRaw() throws Exception { ModelExecuteOptions options = ModelExecuteOptions.createRaw(); // WHEN - when(TEST_NAME); + when(); modifyUserAssignment(USER_JACK_OID, ROLE_STRONG_SAILOR_OID, RoleType.COMPLEX_TYPE, null, task, null, activationType, true, options, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -647,12 +647,12 @@ public void test142Forward15min() throws Exception { Task task = getTestTask(); // WHEN - when(TEST_NAME); + when(); clockForward("PT15M"); // do NOT recompute // THEN - then(TEST_NAME); + then(); PrismObject userAfter = getUser(USER_JACK_OID); display("User jack after", userAfter); @@ -681,11 +681,11 @@ public void test144JackAssignRoleSailorAgain() throws Exception { XMLGregorianCalendar startTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_STRONG_SAILOR_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTs = clock.currentTimeXMLGregorianCalendar(); @@ -721,11 +721,11 @@ public void test150JackAssignRolePirate() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_PIRATE_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -760,11 +760,11 @@ public void test151JackAssignRoleSailorValidTo() throws Exception { activationType.setValidTo(jackPirateValidTo); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_STRONG_SAILOR_OID, activationType, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -796,11 +796,11 @@ public void test153Forward15min() throws Exception { clockForward("PT15M"); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -830,11 +830,11 @@ public void test154JackAssignRoleSailorAgain() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_STRONG_SAILOR_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -868,11 +868,11 @@ public void test160JackAssignRolePirate() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_PIRATE_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -908,12 +908,12 @@ public void test161JackAssignRoleSailorValidToRaw() throws Exception { ModelExecuteOptions options = ModelExecuteOptions.createRaw(); // WHEN - when(TEST_NAME); + when(); modifyUserAssignment(USER_JACK_OID, ROLE_STRONG_SAILOR_OID, RoleType.COMPLEX_TYPE, null, task, null, activationType, true, options, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -951,11 +951,11 @@ public void test162RecomputeJack() throws Exception { activationType.setValidTo(jackPirateValidTo); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -987,11 +987,11 @@ public void test163Forward15min() throws Exception { clockForward("PT15M"); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1021,11 +1021,11 @@ public void test164JackAssignRoleSailorAgain() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_STRONG_SAILOR_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1059,11 +1059,11 @@ public void test170JackAssignRolePirate() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_PIRATE_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1097,11 +1097,11 @@ public void test171JackAssignRoleWeakSingerValidTo() throws Exception { activationType.setValidTo(jackPirateValidTo); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_WEAK_SINGER_OID, activationType, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1133,11 +1133,11 @@ public void test173Forward15min() throws Exception { clockForward("PT15M"); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1168,11 +1168,11 @@ public void test174JackAssignRoleSingerAgain() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_WEAK_SINGER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1211,12 +1211,12 @@ public void test180JackAssignRoleSailorValidToRaw() throws Exception { activationType.setValidTo(jackPirateValidTo); // WHEN - when(TEST_NAME); + when(); modifyUserAssignment(USER_JACK_OID, ROLE_STRONG_SAILOR_OID, RoleType.COMPLEX_TYPE, null, task, null, activationType, true, ModelExecuteOptions.createRaw(), result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1243,12 +1243,12 @@ public void test182Forward15minAndAssignRaw() throws Exception { clockForward("PT15M"); // WHEN - when(TEST_NAME); + when(); modifyUserAssignment(USER_JACK_OID, ROLE_STRONG_SAILOR_OID, RoleType.COMPLEX_TYPE, null, task, null, null, true, ModelExecuteOptions.createRaw(), result); // THEN - then(TEST_NAME); + then(); PrismObject userAfter = getUser(USER_JACK_OID); display("User jack after", userAfter); @@ -1272,11 +1272,11 @@ public void test184RecomputeJack() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1313,12 +1313,12 @@ public void test200JackAssignCurrentPirateFutureSailor() throws Exception { activationType.setValidFrom(getTimestamp("P1M")); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_PIRATE_OID, task, result); assignRole(USER_JACK_OID, ROLE_STRONG_SAILOR_OID, activationType, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1346,11 +1346,11 @@ public void test202RecomputeJack() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1376,11 +1376,11 @@ public void test204ReconcileJack() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1416,12 +1416,12 @@ public void test210JackAssignCurrentPirateFutureRichSailor() throws Exception { activationType.setValidFrom(getTimestamp("P1M")); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_PIRATE_OID, task, result); assignRole(USER_JACK_OID, ROLE_STRONG_RICH_SAILOR_OID, activationType, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1449,11 +1449,11 @@ public void test212RecomputeJack() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1479,11 +1479,11 @@ public void test214ReconcileJack() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1519,11 +1519,11 @@ public void test220JackAssignFutureRichSailor() throws Exception { activationType.setValidFrom(getTimestamp("P1M")); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_STRONG_RICH_SAILOR_OID, activationType, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1563,14 +1563,14 @@ public void test230JackAssignRoleStrongRichSailorValidTo() throws Exception { XMLGregorianCalendar startTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); // beware of the order: weapon is weak and is set differently by role (cutlass) and resource (from user extension: pistol, mouth) // the assert expects cutlass, so the pirate role assignment must go first assignRole(USER_JACK_OID, ROLE_PIRATE_OID, task, result); assignRole(USER_JACK_OID, ROLE_STRONG_RICH_SAILOR_OID, activationType, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTs = clock.currentTimeXMLGregorianCalendar(); @@ -1600,11 +1600,11 @@ public void test232Forward15min() throws Exception { clockForward("PT15M"); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1644,14 +1644,14 @@ public void test240JackAssignRoleRichSailorValidTo() throws Exception { XMLGregorianCalendar startTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); // beware of the order: weapon is weak and is set differently by role (cutlass) and resource (from user extension: pistol, mouth) // the assert expects cutlass, so the pirate role assignment must go first assignRole(USER_JACK_OID, ROLE_PIRATE_OID, task, result); assignRole(USER_JACK_OID, ROLE_RICH_SAILOR_OID, activationType, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTs = clock.currentTimeXMLGregorianCalendar(); @@ -1681,11 +1681,11 @@ public void test242Forward15min() throws Exception { clockForward("PT15M"); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1722,14 +1722,14 @@ public void test250JackAssignFocusExistsResource() throws Exception { AssignmentType assignment = ObjectTypeUtil.createAssignmentTo(resourceDummyFocusExists, prismContext).activation(activation); // WHEN - when(TEST_NAME); + when(); ObjectDelta delta = prismContext.deltaFor(UserType.class) .item(UserType.F_ASSIGNMENT).add(assignment) .asObjectDeltaCast(USER_JACK_OID); executeChanges(delta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1754,11 +1754,11 @@ public void test252RecomputeJack() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1783,11 +1783,11 @@ public void test254ReconcileJack() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1884,11 +1884,11 @@ private void unassignAll(final String TEST_NAME) throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); unassignAll(userBefore, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/rbac/TestRbac.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/rbac/TestRbac.java index 6dc75cf4c3a..5469a6bd64e 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/rbac/TestRbac.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/rbac/TestRbac.java @@ -151,7 +151,7 @@ public void test101JackAssignRolePirate() throws Exception { assignRole(USER_JACK_OID, ROLE_PIRATE_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTs = clock.currentTimeXMLGregorianCalendar(); @@ -204,7 +204,7 @@ public void test102JackModifyUserLocality() throws Exception { createPolyString(LOCALITY_TORTUGA)); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTs = clock.currentTimeXMLGregorianCalendar(); @@ -237,7 +237,7 @@ public void test110UnAssignRolePirate() throws Exception { unassignRole(USER_JACK_OID, ROLE_PIRATE_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -288,11 +288,11 @@ public void test120JackAssignRolePirateWhileAlreadyHasAccount() throws Exception EXISTING_GOSSIP); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_PIRATE_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -810,11 +810,11 @@ public void test154JackAssignRoleIndianOceanPirate() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_INDIAN_OCEAN_PIRATE_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); display("Result", result); TestUtil.assertSuccess(result); @@ -922,21 +922,21 @@ public void testJackAssignRolePirateRelationNoPrivs(final String TEST_NAME, QNam assertNoDummyAccount(ACCOUNT_JACK_DUMMY_USERNAME); // WHEN (1) - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_PIRATE_OID, relation, getDefaultOptions(), task, result); // THEN (1) - then(TEST_NAME); + then(); assertSuccess(result); assertJackAssignRolePirateRelationNoPrivs(relation); // WHEN (2) - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, getDefaultOptions(), task, result); // THEN (2) - then(TEST_NAME); + then(); assertSuccess(result); assertJackAssignRolePirateRelationNoPrivs(relation); @@ -966,7 +966,7 @@ public void testJackUnassignRolePirateRelationNoPrivs(final String TEST_NAME, QN unassignRole(USER_JACK_OID, ROLE_PIRATE_OID, relation, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar endTs = clock.currentTimeXMLGregorianCalendar(); @@ -1242,11 +1242,11 @@ public void test502JackModifyUserLocality() throws Exception { EXISTING_GOSSIP); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_LOCALITY, getDefaultOptions(), task, result, createPolyString("Isla de Muerta")); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1427,11 +1427,11 @@ public void test532JackModifyAssignmentRoleCleric() throws Exception { UserType.class, USER_JACK_OID, itemPath, "soul"); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(MiscSchemaUtil.createCollection(assignmentDelta), getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1461,11 +1461,11 @@ public void test539JackUnAssignRoleCleric() throws Exception { UserType.class, USER_JACK_OID, UserType.F_ASSIGNMENT, assignmentType); // WHEN - when(TEST_NAME); + when(); executeChanges(assignmentDelta, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1490,11 +1490,11 @@ public void test540JackAssignRoleWannabe() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_WANNABE_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1519,11 +1519,11 @@ public void test541JackRemoveHonorificSuffixWannabe() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_HONORIFIC_SUFFIX, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1547,11 +1547,11 @@ public void test542JackModifySubtypeWannabe() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_SUBTYPE, getDefaultOptions(), task, result, "wannabe"); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1576,11 +1576,11 @@ public void test543JackRemoveHonorificPrefixWannabe() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_HONORIFIC_PREFIX, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1604,12 +1604,12 @@ public void test544JackSetHonorificSuffixWannabe() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_HONORIFIC_SUFFIX, getDefaultOptions(), task, result, PrismTestUtil.createPolyString("PhD.")); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1635,12 +1635,12 @@ public void test545JackRestoreHonorificPrefixWannabe() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_HONORIFIC_PREFIX, getDefaultOptions(), task, result, PrismTestUtil.createPolyString("captain")); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1665,11 +1665,11 @@ public void test549JackUnassignRoleWannabe() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_WANNABE_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -1696,7 +1696,7 @@ public void test600JackAssignRoleJudge() throws Exception { assignRole(USER_JACK_OID, ROLE_JUDGE_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1737,7 +1737,7 @@ public void test602JackAssignRolePirate() throws Exception { } // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertFailure(result); @@ -1764,11 +1764,11 @@ public void test605JackUnAssignRoleJudgeAssignRolePirate() throws Exception { userDelta.addModification(createAssignmentModification(ROLE_PIRATE_OID, RoleType.COMPLEX_TYPE, null, null, null, true)); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(MiscSchemaUtil.createCollection(userDelta), getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1798,11 +1798,11 @@ public void test609JackUnAssignRolePirate() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_PIRATE_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1826,7 +1826,7 @@ public void test610ElaineAssignRoleGovernor() throws Exception { assignRole(USER_ELAINE_OID, ROLE_GOVERNOR_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1866,7 +1866,7 @@ public void test612JackAssignRoleGovernor() throws Exception { } // THEN - then(TEST_NAME); + then(); assertFailure(result); assertNoAssignments(USER_JACK_OID); @@ -1902,7 +1902,7 @@ public void test613JackAssignRoleGovernorAsApprover() throws Exception { } // THEN - then(TEST_NAME); + then(); assertFailure(result); assertNoAssignments(USER_JACK_OID); @@ -1930,11 +1930,11 @@ public void test620LemonheadAssignRoleCanibal() throws Exception { assertAssignees(ROLE_CANNIBAL_OID, 0); // WHEN - when(TEST_NAME); + when(); assignRole(user.getOid(), ROLE_CANNIBAL_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertAssignedRole(user.getOid(), ROLE_CANNIBAL_OID, result); @@ -1960,11 +1960,11 @@ public void test622SharptoothAssignRoleCanibal() throws Exception { assertAssignees(ROLE_CANNIBAL_OID, 1); // WHEN - when(TEST_NAME); + when(); assignRole(user.getOid(), ROLE_CANNIBAL_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertAssignedRole(user.getOid(), ROLE_CANNIBAL_OID, result); @@ -1990,11 +1990,11 @@ public void test624RedskullAssignRoleCanibal() throws Exception { assertAssignees(ROLE_CANNIBAL_OID, 2); // WHEN - when(TEST_NAME); + when(); assignRole(user.getOid(), ROLE_CANNIBAL_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertAssignedRole(user.getOid(), ROLE_CANNIBAL_OID, result); @@ -2021,7 +2021,7 @@ public void test625BignoseAssignRoleCanibal() throws Exception { try { // WHEN - when(TEST_NAME); + when(); assignRole(user.getOid(), ROLE_CANNIBAL_OID, getDefaultOptions(), task, result); AssertJUnit.fail("Unexpected success"); @@ -2032,7 +2032,7 @@ public void test625BignoseAssignRoleCanibal() throws Exception { } // THEN - then(TEST_NAME); + then(); assertFailure(result); assertNoAssignments(user.getOid()); @@ -2052,11 +2052,11 @@ public void test627SharptoothUnassignRoleCanibal() throws Exception { assertAssignees(ROLE_CANNIBAL_OID, 3); // WHEN - when(TEST_NAME); + when(); unassignRole(userSharptoothOid, ROLE_CANNIBAL_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertNoAssignments(userSharptoothOid); @@ -2078,7 +2078,7 @@ public void test628RedskullUnassignRoleCanibal() throws Exception { try { // WHEN - when(TEST_NAME); + when(); unassignRole(userRedskullOid, ROLE_CANNIBAL_OID, getDefaultOptions(), task, result); AssertJUnit.fail("Unexpected success"); @@ -2089,7 +2089,7 @@ public void test628RedskullUnassignRoleCanibal() throws Exception { } // THEN - then(TEST_NAME); + then(); assertFailure(result); assertAssignedRole(userRedskullOid, ROLE_CANNIBAL_OID, result); @@ -2119,7 +2119,7 @@ public void test630RappAssignRoleCannibalAsOwner() throws Exception { assignRole(USER_RAPP_OID, ROLE_CANNIBAL_OID, SchemaConstants.ORG_OWNER, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertAssignees(ROLE_CANNIBAL_OID, 2); @@ -2147,7 +2147,7 @@ public void test632RappUnassignRoleCannibalAsOwner() throws Exception { try { // WHEN - when(TEST_NAME); + when(); // null namespace to test no-namespace "owner" relation unassignRole(USER_RAPP_OID, ROLE_CANNIBAL_OID, QNameUtil.nullNamespace(SchemaConstants.ORG_OWNER), getDefaultOptions(), task, result); @@ -2159,7 +2159,7 @@ public void test632RappUnassignRoleCannibalAsOwner() throws Exception { } // THEN - then(TEST_NAME); + then(); assertFailure(result); assertAssignees(ROLE_CANNIBAL_OID, 2); @@ -2189,7 +2189,7 @@ public void test634BignoseAssignRoleCannibalAsOwner() throws Exception { assignRole(userBignoseOid, ROLE_CANNIBAL_OID, SchemaConstants.ORG_OWNER, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(userBignoseOid) @@ -2224,7 +2224,7 @@ public void test636BignoseUnassignRoleCannibalAsOwner() throws Exception { unassignRole(userBignoseOid, ROLE_CANNIBAL_OID, SchemaConstants.ORG_OWNER, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(userBignoseOid) @@ -2249,11 +2249,11 @@ public void test649ElaineUnassignRoleGovernor() throws Exception { assertAssignees(ROLE_GOVERNOR_OID, 1); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_ELAINE_OID, ROLE_GOVERNOR_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_ELAINE_OID); @@ -2276,11 +2276,11 @@ public void test650BignoseAssignRoleCannibalAsOwner() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(userBignoseOid, ROLE_CANNIBAL_OID, SchemaConstants.ORG_OWNER, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(userBignoseOid) @@ -2298,11 +2298,11 @@ public void test651BignoseAssignRoleCannibalAsApprover() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(userBignoseOid, ROLE_CANNIBAL_OID, SchemaConstants.ORG_APPROVER, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(userBignoseOid) @@ -2324,11 +2324,11 @@ public void test655BignoseAssignRoleCannibal() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(userBignoseOid, ROLE_CANNIBAL_OID, SchemaConstants.ORG_DEFAULT, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(userBignoseOid) @@ -2348,11 +2348,11 @@ public void test656BignoseUnassignRoleCannibal() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(userBignoseOid, ROLE_CANNIBAL_OID, SchemaConstants.ORG_DEFAULT, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(userBignoseOid) @@ -2380,7 +2380,7 @@ public void test658BignoseUnassignRoleCannibalAsOwner() throws Exception { executeChanges(userDelta, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(userBignoseOid) @@ -2400,11 +2400,11 @@ public void test700JackAssignRoleJudge() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_JUDGE_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertAssignedRole(USER_JACK_OID, ROLE_JUDGE_OID, result); @@ -2426,11 +2426,11 @@ public void test701JackModifyJudgeDeleteConstructionRecompute() throws Exception display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); modifyRoleDeleteInducement(ROLE_JUDGE_OID, 1111L, true, getDefaultOptions(), task); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertInProgressOrSuccess(result); @@ -2456,11 +2456,11 @@ public void test702JackModifyJudgeAddInducementHonorabilityRecompute() throws Ex display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); modifyRoleAddInducementTarget(ROLE_JUDGE_OID, ROLE_HONORABILITY_OID, true, getDefaultOptions()); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertInProgressOrSuccess(result); @@ -2494,11 +2494,11 @@ public void test703JackModifyJudgeDeleteInducementHonorabilityRecompute() throws display("Role judge", roleJudge); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, ModelExecuteOptions.createReconcile(getDefaultOptions()), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -2525,11 +2525,11 @@ public void test709JackUnAssignRoleJudge() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_JUDGE_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2550,11 +2550,11 @@ public void test710JackAssignRoleEmpty() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_EMPTY_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2575,11 +2575,11 @@ public void test712JackModifyEmptyRoleAddInducementPirateRecompute() throws Exce display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); modifyRoleAddInducementTarget(ROLE_EMPTY_OID, ROLE_PIRATE_OID, true, getDefaultOptions()); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertInProgressOrSuccess(result); @@ -2608,11 +2608,11 @@ public void test714JackModifyEmptyRoleDeleteInducementPirateRecompute() throws E modifyRoleDeleteInducementTarget(ROLE_EMPTY_OID, ROLE_PIRATE_OID, getDefaultOptions()); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2633,11 +2633,11 @@ public void test719JackUnAssignRoleEmpty() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_EMPTY_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2660,11 +2660,11 @@ public void test720JackAssignRoleGovernorTenantRef() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); assignParametricRole(USER_JACK_OID, ROLE_GOVERNOR_OID, null, ORG_SCUMM_BAR_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2691,11 +2691,11 @@ public void test729JackUnassignRoleGovernorTenantRef() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); unassignParametricRole(USER_JACK_OID, ROLE_GOVERNOR_OID, null, ORG_SCUMM_BAR_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2720,11 +2720,11 @@ public void test750JackAssignRoleOmnimanager() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_PROJECT_OMNINAMAGER_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -2755,11 +2755,11 @@ public void test755AddProjectAndRecomputeJack() throws Exception { addObject(ORG_PROJECT_RECLAIM_BLACK_PEARL_FILE); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, ModelExecuteOptions.createReconcile(getDefaultOptions()), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -2786,11 +2786,11 @@ public void test759JackUnassignRoleOmnimanager() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_PROJECT_OMNINAMAGER_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -2823,11 +2823,11 @@ public void test760JackAssignRoleWeakGossiper() throws Exception { assertDummyAccount(RESOURCE_DUMMY_RED_NAME, ACCOUNT_JACK_DUMMY_USERNAME, ACCOUNT_JACK_DUMMY_FULLNAME, false); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_WEAK_GOSSIPER_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -2856,11 +2856,11 @@ public void test761JackRecompute() throws Exception { assertNoDummyAccount(ACCOUNT_JACK_DUMMY_USERNAME); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -2889,11 +2889,11 @@ public void test762JackReconcile() throws Exception { assertNoDummyAccount(ACCOUNT_JACK_DUMMY_USERNAME); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -2924,11 +2924,11 @@ public void test763PreviewChanges() throws Exception { ); // WHEN - when(TEST_NAME); + when(); ModelContext context = modelInteractionService.previewChanges(MiscSchemaUtil.createCollection(delta), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Preview context", context); @@ -2980,11 +2980,11 @@ public void test764JackAssignRoleSailor() throws Exception { assertAssignedRole(userBefore, ROLE_WEAK_GOSSIPER_OID); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_SAILOR_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3018,11 +3018,11 @@ public void test765JackRecompute() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3056,11 +3056,11 @@ public void test766JackReconcile() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3096,11 +3096,11 @@ public void test767JackUnAssignRoleWeakGossiper() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_WEAK_GOSSIPER_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3133,11 +3133,11 @@ public void test768JackRecompute() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3170,11 +3170,11 @@ public void test769JackUnAssignRoleSailor() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_SAILOR_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3204,11 +3204,11 @@ public void test770JackAssignRoleSailor() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_SAILOR_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3243,11 +3243,11 @@ public void test772JackAssignRoleGossiper() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_WEAK_GOSSIPER_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3283,11 +3283,11 @@ public void test774JackUnAssignRoleSailor() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_SAILOR_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3317,11 +3317,11 @@ public void test775JackUnAssignRoleGossiper() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_WEAK_GOSSIPER_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3357,11 +3357,11 @@ public void test778JackAssignRoleGossiperAndSailor() throws Exception { Collection> deltas = MiscSchemaUtil.createCollection(userDelta); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3402,11 +3402,11 @@ public void test779JackUnassignRoleGossiperAndSailor() throws Exception { Collection> deltas = MiscSchemaUtil.createCollection(userDelta); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3438,11 +3438,11 @@ public void test780JackAssignRoleWeakSinger() throws Exception { assertNoDummyAccount(ACCOUNT_JACK_DUMMY_USERNAME); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_WEAK_SINGER_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3475,11 +3475,11 @@ public void test781JackAssignRoleWeakGossiper() throws Exception { assertNoDummyAccount(ACCOUNT_JACK_DUMMY_USERNAME); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_WEAK_GOSSIPER_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3510,11 +3510,11 @@ public void test782JackAssignRoleSailor() throws Exception { assertAssignedRole(userBefore, ROLE_WEAK_GOSSIPER_OID); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_SAILOR_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3552,11 +3552,11 @@ public void test783JackUnassignRoleSailor() throws Exception { assertAssignedRole(userBefore, ROLE_WEAK_SINGER_OID); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_SAILOR_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3587,11 +3587,11 @@ public void test784JackUnAssignRoleWeakSinger() throws Exception { assertNoDummyAccount(ACCOUNT_JACK_DUMMY_USERNAME); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_WEAK_SINGER_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3621,11 +3621,11 @@ public void test785JackUnAssignRoleGossiper() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_WEAK_GOSSIPER_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3661,11 +3661,11 @@ public void test786JackAssignRoleGossiperAndSinger() throws Exception { Collection> deltas = MiscSchemaUtil.createCollection(userDelta); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3701,11 +3701,11 @@ public void test788JackUnassignRoleGossiperAndSinger() throws Exception { Collection> deltas = MiscSchemaUtil.createCollection(userDelta); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3738,11 +3738,11 @@ public void test790JackAssignRoleWeakSinger() throws Exception { assertNoDummyAccount(ACCOUNT_JACK_DUMMY_USERNAME); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_WEAK_SINGER_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3782,11 +3782,11 @@ public void test791JackSwitchRolesGossiperAndSinger() throws Exception { Collection> deltas = MiscSchemaUtil.createCollection(userDelta); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3817,11 +3817,11 @@ public void test792JackAssignRoleSailor() throws Exception { assertAssignedRole(userBefore, ROLE_WEAK_GOSSIPER_OID); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_SAILOR_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3866,11 +3866,11 @@ public void test793JackSwitchRolesSingerAndGossiper() throws Exception { Collection> deltas = MiscSchemaUtil.createCollection(userDelta); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3912,11 +3912,11 @@ public void test794JackSwitchRolesSailorAndGossiper() throws Exception { Collection> deltas = MiscSchemaUtil.createCollection(userDelta); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3952,11 +3952,11 @@ public void test795JackSwitchRolesSingerAndSailor() throws Exception { Collection> deltas = MiscSchemaUtil.createCollection(userDelta); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -3998,11 +3998,11 @@ public void test796JackSwitchRolesSailorAndGovernor() throws Exception { Collection> deltas = MiscSchemaUtil.createCollection(userDelta); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -4045,11 +4045,11 @@ public void test799JackUnassignGovernorAndWeakGossiper() throws Exception { Collection> deltas = MiscSchemaUtil.createCollection(userDelta); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -4071,14 +4071,14 @@ public void test800ModifyRoleImmutable() throws Exception { try { // WHEN - when(TEST_NAME); + when(); modifyObjectReplaceProperty(RoleType.class, ROLE_IMMUTABLE_OID, RoleType.F_DESCRIPTION, getDefaultOptions(), task, result, "whatever"); AssertJUnit.fail("Unexpected success"); } catch (PolicyViolationException e) { // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertFailure(result); } @@ -4103,11 +4103,11 @@ public void test802AddGlobalImmutableRole() throws Exception { display("Role before", role); // WHEN - when(TEST_NAME); + when(); addObject(role, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -4126,14 +4126,14 @@ public void test804ModifyRoleImmutableGlobalIdentifier() throws Exception { try { // WHEN - when(TEST_NAME); + when(); modifyObjectReplaceProperty(RoleType.class, ROLE_IMMUTABLE_GLOBAL_OID, RoleType.F_IDENTIFIER, getDefaultOptions(), task, result, "whatever"); AssertJUnit.fail("Unexpected success"); } catch (PolicyViolationException e) { // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertFailure(result); } @@ -4153,14 +4153,14 @@ public void test805ModifyRoleImmutableGlobalDescription() throws Exception { try { // WHEN - when(TEST_NAME); + when(); modifyObjectReplaceProperty(RoleType.class, ROLE_IMMUTABLE_GLOBAL_OID, RoleType.F_DESCRIPTION, getDefaultOptions(), task, result, "whatever"); AssertJUnit.fail("Unexpected success"); } catch (PolicyViolationException e) { // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertFailure(result); } @@ -4186,11 +4186,11 @@ public void test812AddGlobalImmutableDescriptionRole() throws Exception { display("Role before", role); // WHEN - when(TEST_NAME); + when(); addObject(role, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -4211,13 +4211,13 @@ public void test814ModifyRoleImmutableDescriptionGlobalIdentifier() throws Excep OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); final String NEW_VALUE = "whatever"; modifyObjectReplaceProperty(RoleType.class, ROLE_IMMUTABLE_DESCRIPTION_GLOBAL_OID, RoleType.F_IDENTIFIER, getDefaultOptions(), task, result, NEW_VALUE); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -4236,14 +4236,14 @@ public void test815ModifyRoleImmutableGlobalDescription() throws Exception { try { // WHEN - when(TEST_NAME); + when(); modifyObjectReplaceProperty(RoleType.class, ROLE_IMMUTABLE_DESCRIPTION_GLOBAL_OID, RoleType.F_DESCRIPTION, getDefaultOptions(), task, result, "whatever"); AssertJUnit.fail("Unexpected success"); } catch (PolicyViolationException e) { // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertFailure(result); } @@ -4265,13 +4265,13 @@ public void test826AddNonCreateableRole() throws Exception { try { // WHEN - when(TEST_NAME); + when(); addObject(role, getDefaultOptions(), task, result); AssertJUnit.fail("Unexpected success"); } catch (PolicyViolationException e) { // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertFailure(result); } @@ -4291,7 +4291,7 @@ public void test826bAddCreateableRole() throws Exception { display("Role before", role); // WHEN - when(TEST_NAME); + when(); addObject(role, getDefaultOptions(), task, result); result.computeStatus(); TestUtil.assertSuccess(result); @@ -4316,13 +4316,13 @@ public void test827AddImmutableAssignRole() throws Exception { try { // WHEN - when(TEST_NAME); + when(); addObject(role, getDefaultOptions(), task, result); AssertJUnit.fail("Unexpected success"); } catch (PolicyViolationException e) { // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertFailure(result); } @@ -4344,12 +4344,12 @@ public void test828ModifyUntouchableMetarole() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyObjectReplaceProperty(RoleType.class, ROLE_META_UNTOUCHABLE_OID, RoleType.F_DESCRIPTION, getDefaultOptions(), task, result, "Touche!"); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -4366,12 +4366,12 @@ public void test830ModifyRoleJudge() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyObjectReplaceProperty(RoleType.class, ROLE_JUDGE_OID, RoleType.F_DESCRIPTION, getDefaultOptions(), task, result, "whatever"); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -4393,13 +4393,13 @@ public void test840AssignRoleNonAssignable() throws Exception { try { // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_NON_ASSIGNABLE_OID, getDefaultOptions(), task, result); AssertJUnit.fail("Unexpected success"); } catch (PolicyViolationException e) { // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertFailure(result); } @@ -4422,11 +4422,11 @@ public void test850JackAssignRoleBloodyFool() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_BLOODY_FOOL_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -4460,11 +4460,11 @@ public void test855JackModifyFoolMetaroleDeleteInducement() throws Exception { assertInducements(roleBefore, 2); // WHEN - when(TEST_NAME); + when(); modifyRoleDeleteInducement(ROLE_META_FOOL_OID, 10002L, false, getDefaultOptions(), task); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -4486,11 +4486,11 @@ public void test857JackReconcile() throws Exception { display("User jack before", userBefore); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -4527,11 +4527,11 @@ public void test870AssignRoleScreaming() throws Exception { display("user jack", userJackBefore); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_SCREAMING_OID, getDefaultOptions(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userJackAfter = getUser(USER_JACK_OID); @@ -4567,7 +4567,7 @@ public void test880GlobalRuleOnChange() throws Exception { // WHEN - when(TEST_NAME); + when(); executeChangesAssertSuccess(delta, getDefaultOptions(), task, result); } @@ -4581,12 +4581,12 @@ public void test890DeleteRoleUndeletable() throws Exception { try { // WHEN - when(TEST_NAME); + when(); deleteObject(RoleType.class, ROLE_UNDELETABLE_OID, task, result); AssertJUnit.fail("Unexpected success"); } catch (PolicyViolationException e) { // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertFailure(result); } @@ -4602,12 +4602,12 @@ public void test892DeleteRoleUndeletableGlobal() throws Exception { try { // WHEN - when(TEST_NAME); + when(); deleteObject(RoleType.class, ROLE_UNDELETABLE_GLOBAL_OID, task, result); AssertJUnit.fail("Unexpected success"); } catch (PolicyViolationException e) { // THEN - then(TEST_NAME); + then(); System.out.println("Got expected exception: " + e.getMessage()); result.computeStatus(); TestUtil.assertFailure(result); @@ -4627,14 +4627,14 @@ public void test900ModifyDetectingRole() throws Exception { display("Role before", roleBefore); // WHEN - when(TEST_NAME); + when(); ObjectDelta delta = prismContext.deltaFor(RoleType.class) .item(RoleType.F_NAME).replace(PolyString.fromOrig("modified")) .asObjectDeltaCast(ROLE_DETECTING_MODIFICATIONS_OID); executeChanges(delta, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/rbac/TestSegregationOfDuties.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/rbac/TestSegregationOfDuties.java index 6ea4b6779b5..bbad6e9095e 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/rbac/TestSegregationOfDuties.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/rbac/TestSegregationOfDuties.java @@ -811,11 +811,11 @@ public void test210GuybrushAssignRoleRed() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_GUYBRUSH_OID, ROLE_COLOR_RED_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -933,11 +933,11 @@ public void test219GuybrushUnassignRoleBlue() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_GUYBRUSH_OID, ROLE_COLOR_BLUE_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -960,11 +960,11 @@ public void test220GuybrushAssignRoleBlue() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_GUYBRUSH_OID, ROLE_COLOR_BLUE_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -999,11 +999,11 @@ public void test221GuybrushDestroyAndRecompute() throws Exception { display("User before", userBefore); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_GUYBRUSH_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result, 2); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -1039,11 +1039,11 @@ public void test222GuybrushDestroyAndAssignRoleRed() throws Exception { display("User before", userBefore); // WHEN - when(TEST_NAME); + when(); assignRole(USER_GUYBRUSH_OID, ROLE_COLOR_RED_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result, 2); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -1069,11 +1069,11 @@ public void test229GuybrushUnassignRoleRed() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_GUYBRUSH_OID, ROLE_COLOR_RED_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -1132,11 +1132,11 @@ public void test240GuybrushAssignRoleExecutiveOne() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_GUYBRUSH_OID, ROLE_EXECUTIVE_1_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -1174,11 +1174,11 @@ public void test244GuybrushAssignRoleExecutiveTwo() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_GUYBRUSH_OID, ROLE_EXECUTIVE_2_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -1219,11 +1219,11 @@ public void test246GuybrushUnassignRoleExecutiveOne() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_GUYBRUSH_OID, ROLE_EXECUTIVE_1_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -1263,11 +1263,11 @@ public void test249GuybrushUnassignRoleExecutiveTwo() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_GUYBRUSH_OID, ROLE_EXECUTIVE_2_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -1290,11 +1290,11 @@ public void test250GuybrushAssignRoleControllingOne() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_GUYBRUSH_OID, ROLE_CONTROLLING_1_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -1332,11 +1332,11 @@ public void test259GuybrushUnassignRoleControllingOne() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_GUYBRUSH_OID, ROLE_CONTROLLING_1_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -1356,11 +1356,11 @@ public void test800ApplyGlobalPolicyRulesExclusion() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); transplantGlobalPolicyRulesAdd(CONFIG_WITH_GLOBAL_RULES_EXCLUSION_FILE, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); List globalPolicyRules = getSystemConfiguration().getGlobalPolicyRule(); @@ -1377,11 +1377,11 @@ public void test810GuybrushAssignRoleCitizenSk() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_GUYBRUSH_OID, ROLE_CITIZEN_SK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -1416,11 +1416,11 @@ public void test814GuybrushAssignRoleEmpty() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_GUYBRUSH_OID, ROLE_EMPTY_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -1438,11 +1438,11 @@ public void test818GuybrushUnassignRoleCitizenSk() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_GUYBRUSH_OID, ROLE_CITIZEN_SK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -1462,11 +1462,11 @@ public void test819GuybrushUnassignRoleEmpty() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_GUYBRUSH_OID, ROLE_EMPTY_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -1487,11 +1487,11 @@ public void test820GuybrushAssignRoleCriminal() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_GUYBRUSH_OID, ROLE_CRIMINAL_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -1512,11 +1512,11 @@ public void test822GuybrushAssignRoleMinister() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_GUYBRUSH_OID, ROLE_MINISTER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -1536,11 +1536,11 @@ public void test826GuybrushUnassignRoleCriminal() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_GUYBRUSH_OID, ROLE_CRIMINAL_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -1558,11 +1558,11 @@ public void test829GuybrushUnassignRoleMinister() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_GUYBRUSH_OID, ROLE_MINISTER_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -1580,11 +1580,11 @@ public void test900ApplyGlobalPolicyRulesSoDApproval() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); transplantGlobalPolicyRulesAdd(CONFIG_WITH_GLOBAL_RULES_SOD_APPROVAL_FILE, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); List globalPolicyRules = getSystemConfiguration().getGlobalPolicyRule(); @@ -1606,11 +1606,11 @@ public void test920GuybrushAssignRoleCriminal() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_GUYBRUSH_OID, ROLE_CRIMINAL_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -1638,11 +1638,11 @@ public void test922GuybrushPreviewAssignRoleMinister() throws Exception { ROLE_MINISTER_OID, RoleType.COMPLEX_TYPE, null, null, null, true); // WHEN - when(TEST_NAME); + when(); ModelContext modelContext = modelInteractionService.previewChanges(MiscSchemaUtil.createCollection(delta), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Preview context", modelContext); @@ -1712,11 +1712,11 @@ public void test929GuybrushUnassignRoleCriminal() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_GUYBRUSH_OID, ROLE_CRIMINAL_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -1831,7 +1831,7 @@ private PrismObject assignRolePolicyFailure(String TEST_NAME, String u try { // WHEN - when(TEST_NAME); + when(); assignRole(userOid, roleOid, task, result); assertNotReached(); @@ -1840,7 +1840,7 @@ private PrismObject assignRolePolicyFailure(String TEST_NAME, String u System.out.println("Got expected exception: " + e.getMessage()); // THEN - then(TEST_NAME); + then(); assertFailure(result); } diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/security/TestSecurityAdvanced.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/security/TestSecurityAdvanced.java index f211fe54dcc..db98a3d791c 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/security/TestSecurityAdvanced.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/security/TestSecurityAdvanced.java @@ -164,7 +164,7 @@ public void test000Sanity() throws Exception { cleanupAutzTest(USER_JACK_OID); // WHEN - when(TEST_NAME); + when(); assertSearch(UserType.class, null, NUMBER_OF_ALL_USERS); assertSearch(RoleType.class, null, getNumberOfRoles()); @@ -208,13 +208,13 @@ public void test080AutzJackEndUserPassword() throws Exception { XMLGregorianCalendar startTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); assertAllow("set jack's password", (task, result) -> modifyUserSetPassword(USER_JACK_OID, "nbusr123", task, result)); // THEN - then(TEST_NAME); + then(); XMLGregorianCalendar endTs = clock.currentTimeXMLGregorianCalendar(); @@ -237,7 +237,7 @@ public void test100AutzJackPersonaManagement() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_JACK_OID); assertGetDeny(UserType.class, USER_GUYBRUSH_OID); @@ -263,7 +263,7 @@ public void test102AutzLechuckPersonaManagement() throws Exception { login(USER_LECHUCK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetDeny(UserType.class, USER_JACK_OID); assertGetDeny(UserType.class, USER_GUYBRUSH_OID); @@ -293,7 +293,7 @@ public void test110AutzJackPersonaAdmin() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertAllow("assign application role 1 to jack", (task, result) -> assignRole(USER_JACK_OID, ROLE_PERSONA_ADMIN_OID, task, result)); @@ -352,7 +352,7 @@ public void test120AutzJackDelagator() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(NUMBER_OF_ALL_USERS); assertAddDeny(); @@ -399,7 +399,7 @@ public void test120AutzJackDelagator() throws Exception { login(USER_BARBOSSA_USERNAME); // WHEN - when(TEST_NAME); + when(); display("Logged in as Barbossa"); assertReadAllow(NUMBER_OF_ALL_USERS); @@ -409,7 +409,7 @@ public void test120AutzJackDelagator() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); display("Logged in as Jack"); assertAllow("undelegate from Barbossa", @@ -425,7 +425,7 @@ public void test120AutzJackDelagator() throws Exception { login(USER_BARBOSSA_USERNAME); // WHEN - when(TEST_NAME); + when(); display("Logged in as Barbossa"); assertReadDeny(); @@ -459,7 +459,7 @@ public void test122AutzJackDelagatorValidity() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); PrismObject userJack = getUser(USER_JACK_OID); assertAssignments(userJack, 1); @@ -499,7 +499,7 @@ public void test122AutzJackDelagatorValidity() throws Exception { login(USER_BARBOSSA_USERNAME); // WHEN - when(TEST_NAME); + when(); display("Logged in as Barbossa"); // Delegation is not active yet. No access. @@ -528,7 +528,7 @@ public void test122AutzJackDelagatorValidity() throws Exception { login(USER_BARBOSSA_USERNAME); // WHEN - when(TEST_NAME); + when(); display("Logged in as Barbossa"); assertReadAllow(NUMBER_OF_ALL_USERS); @@ -543,7 +543,7 @@ public void test122AutzJackDelagatorValidity() throws Exception { login(USER_BARBOSSA_USERNAME); // WHEN - when(TEST_NAME); + when(); display("Logged in as Barbossa"); // Delegation is not active any more. No access. @@ -554,7 +554,7 @@ public void test122AutzJackDelagatorValidity() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); display("Logged in as Jack"); assertAllow("undelegate from Barbossa", @@ -571,7 +571,7 @@ public void test122AutzJackDelagatorValidity() throws Exception { login(USER_BARBOSSA_USERNAME); // WHEN - when(TEST_NAME); + when(); display("Logged in as Barbossa"); assertReadDeny(); @@ -605,7 +605,7 @@ public void test124AutzJackDelagatorPlusValidity() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); PrismObject userJack = getUser(USER_JACK_OID); assertAssignments(userJack, 1); @@ -645,7 +645,7 @@ public void test124AutzJackDelagatorPlusValidity() throws Exception { login(USER_BARBOSSA_USERNAME); // WHEN - when(TEST_NAME); + when(); display("Logged in as Barbossa"); // Delegation is not active yet. No access. @@ -674,7 +674,7 @@ public void test124AutzJackDelagatorPlusValidity() throws Exception { login(USER_BARBOSSA_USERNAME); // WHEN - when(TEST_NAME); + when(); display("Logged in as Barbossa"); assertReadAllow(NUMBER_OF_ALL_USERS); @@ -703,7 +703,7 @@ public void test124AutzJackDelagatorPlusValidity() throws Exception { login(USER_BARBOSSA_USERNAME); // WHEN - when(TEST_NAME); + when(); display("Logged in as Barbossa"); // Delegation is not active any more. No access. @@ -714,7 +714,7 @@ public void test124AutzJackDelagatorPlusValidity() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); display("Logged in as Jack"); assertAllow("undelegate from Barbossa", @@ -731,7 +731,7 @@ public void test124AutzJackDelagatorPlusValidity() throws Exception { login(USER_BARBOSSA_USERNAME); // WHEN - when(TEST_NAME); + when(); display("Logged in as Barbossa"); assertReadDeny(); @@ -763,7 +763,7 @@ public void test150AutzJackApproverUnassignRoles() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(RoleType.class, ROLE_ORDINARY_OID); assertGetDeny(RoleType.class, ROLE_PERSONA_ADMIN_OID); // no assignment @@ -804,7 +804,7 @@ public void test151AutzJackApproverUnassignRolesAndRead() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(RoleType.class, ROLE_ORDINARY_OID); assertGetAllow(RoleType.class, ROLE_PERSONA_ADMIN_OID); // no assignment @@ -845,7 +845,7 @@ public void test154AutzJackApproverRead() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); PrismObject roleOrdinary = assertGetAllow(RoleType.class, ROLE_ORDINARY_OID); assertNoRoleMembershipRef(roleOrdinary); @@ -910,7 +910,7 @@ public void test155AutzJackApproverSelf() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetDeny(RoleType.class, ROLE_ORDINARY_OID); assertGetDeny(RoleType.class, ROLE_PERSONA_ADMIN_OID); @@ -966,7 +966,7 @@ public void test157AutzJackReadRoleMembers() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); PrismObject roleOrdinary = assertGetAllow(RoleType.class, ROLE_ORDINARY_OID); assertNoRoleMembershipRef(roleOrdinary); @@ -1018,7 +1018,7 @@ public void test158AutzJackReadRoleMembersWrong() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); PrismObject roleOrdinary = assertGetAllow(RoleType.class, ROLE_ORDINARY_OID); assertNoRoleMembershipRef(roleOrdinary); @@ -1070,7 +1070,7 @@ public void test159AutzJackReadRoleMembersNone() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); PrismObject roleOrdinary = assertGetAllow(RoleType.class, ROLE_ORDINARY_OID); assertNoRoleMembershipRef(roleOrdinary); @@ -1174,7 +1174,7 @@ public void test200AutzJackModifyOrgunit() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_JACK_OID); assertAddDeny(); @@ -1235,7 +1235,7 @@ public void test202AutzJackModifyOrgunitAndAssignRole() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_JACK_OID); assertAddDeny(); @@ -1308,7 +1308,7 @@ public void test220AutzJackRoleExpressionNoConstCenter() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadDeny(); assertAddDeny(); @@ -1351,7 +1351,7 @@ public void test222AutzJackRoleExpressionConstCenterBusiness() throws Exception login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadDeny(); assertAddDeny(); @@ -1393,7 +1393,7 @@ public void test230AttorneyCaribbeanUnlimited() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(); assertAddDeny(); @@ -1464,7 +1464,7 @@ public void test232ManagerAttorneyNoOrg() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(); assertAddDeny(); @@ -1510,7 +1510,7 @@ public void test234ManagerAttorneyRum() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(); assertAddDeny(); @@ -1578,7 +1578,7 @@ public void test235ManagerAttorneyRumRogersEntitled() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(); assertAddDeny(); @@ -1648,7 +1648,7 @@ public void test236ManagerAttorneyCaribbeanRum() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(); assertAddDeny(); @@ -1727,7 +1727,7 @@ public void test250AssignRequestableSelfOtherApporver() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(); assertAddDeny(); @@ -1820,7 +1820,7 @@ public void test252AssignRequestableSelfOtherApporverEmptyDelta() throws Excepti login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(); assertAddDeny(); @@ -1889,7 +1889,7 @@ public void test254AssignUnassignRequestableSelf() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(); assertAddDeny(); @@ -1925,7 +1925,7 @@ public void test256AssignUnassignRequestableSelfEmptyDelta() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(); assertAddDeny(); @@ -1959,7 +1959,7 @@ public void test260AutzJackLimitedRoleAdministrator() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_JACK_OID); assertGetDeny(UserType.class, USER_JACK_OID, SelectorOptions.createCollection(GetOperationOptions.createRaw())); @@ -2097,7 +2097,7 @@ public void test262AutzJackLimitedRoleAdministratorAndAssignApplicationRoles() t login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(); assertReadDenyRaw(); @@ -2222,7 +2222,7 @@ public void test264AutzJackLimitedReadRoleAdministrator() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_JACK_OID); assertGetDeny(UserType.class, USER_JACK_OID, SelectorOptions.createCollection(GetOperationOptions.createRaw())); @@ -2323,7 +2323,7 @@ public void test266AutzJackRoleAdministrator() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_JACK_OID); assertGetDeny(UserType.class, USER_JACK_OID, SelectorOptions.createCollection(GetOperationOptions.createRaw())); @@ -2380,7 +2380,7 @@ public void test270AutzJackModifyPolicyException() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_JACK_OID); assertReadDenyRaw(); @@ -2437,7 +2437,7 @@ public void test272AutzJackModifyPolicyExceptionFirstRule() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_JACK_OID); assertReadDenyRaw(); @@ -2538,7 +2538,7 @@ public void test280AutzJackModifyPolicyExceptionAndAssignOrg() throws Exception login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_JACK_OID); assertReadDenyRaw(); @@ -2573,7 +2573,7 @@ public void test282AutzJackModifyPolicyExceptionAndAssignOrgDeny() throws Except login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_JACK_OID); assertReadDenyRaw(); @@ -2606,7 +2606,7 @@ public void test283AutzJackModifyPolicyAssignOrg() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_JACK_OID); assertReadDenyRaw(); @@ -2650,7 +2650,7 @@ public void test300AutzJackExceptAssignment() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); PrismObject userJack = getUser(USER_JACK_OID); display("Jack", userJack); @@ -2713,7 +2713,7 @@ public void test302AutzJackExceptAdministrativeStatus() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); PrismObject userJack = getUser(USER_JACK_OID); display("Jack", userJack); @@ -2782,7 +2782,7 @@ public void test304AutzJackPropExceptAssignmentReadSomeModifySomeUser() throws E login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); PrismObject userJack = assertAlmostFullJackRead(2); PrismAsserts.assertPropertyValue(userJack, SchemaConstants.PATH_ACTIVATION_ADMINISTRATIVE_STATUS, ActivationStatusType.ENABLED); @@ -2839,7 +2839,7 @@ public void test306AutzJackPropExceptAssignmentExceptAdministrativeStatus() thro login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); PrismObject userJack = assertAlmostFullJackRead(2); // read of administrativeStatus is not allowed be either role @@ -2896,7 +2896,7 @@ public void test308AutzJackPropExceptAssignmentAssignApplicationRoles() throws E login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); PrismObject userJack = getUser(USER_JACK_OID); display("Jack", userJack); @@ -2994,12 +2994,12 @@ public void test310AutzJackPropSubtypeDenyEscapingZoneOfControl() throws Excepti .assertSubtype(USER_JACK_SUBTYPE); // WHEN - when(TEST_NAME); + when(); assertModifyDeny(UserType.class, USER_JACK_OID, UserType.F_SUBTYPE, "escape"); // WHEN - then(TEST_NAME); + then(); assertUserAfter(USER_JACK_OID) .assertName(USER_JACK_USERNAME) @@ -3029,14 +3029,14 @@ public void test312AutzJackPropSubtypeAllowEscapingZoneOfControl() throws Except .assertSubtype(USER_JACK_SUBTYPE); // WHEN - when(TEST_NAME); + when(); assertModifyAllow(UserType.class, USER_JACK_OID, UserType.F_SUBTYPE, "escape"); assertModifyDeny(UserType.class, USER_JACK_OID, UserType.F_SUBTYPE, "escape again"); assertModifyDeny(UserType.class, USER_JACK_OID, UserType.F_SUBTYPE, USER_JACK_SUBTYPE); // WHEN - then(TEST_NAME); + then(); assertUserAfter(USER_JACK_OID) .assertName(USER_JACK_USERNAME) @@ -3111,7 +3111,7 @@ public void test330AutzJackEndUserWithPrivacy() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); PrismObject userJack = assertGetAllow(UserType.class, USER_JACK_OID); display("Jack", userJack); @@ -3163,7 +3163,7 @@ public void test340AutzJackSuperUserAndExecRead() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertSearch(UserType.class, createOrgSubtreeQuery(ORG_MINISTRY_OF_OFFENSE_OID), USER_LECHUCK_OID, USER_GUYBRUSH_OID, userCobbOid, USER_ESTEVAN_OID); assertSearch(UserType.class, createOrgSubtreeAndNameQuery(ORG_MINISTRY_OF_OFFENSE_OID, USER_GUYBRUSH_USERNAME), USER_GUYBRUSH_OID); @@ -3190,7 +3190,7 @@ public void test350AutzJackResourceRead() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); PrismObject resource = getObject(ResourceType.class, RESOURCE_DUMMY_VAULT_OID); @@ -3212,7 +3212,7 @@ public void test360AutzAdminResourceRead() throws Exception { login(USER_ADMINISTRATOR_USERNAME); // WHEN - when(TEST_NAME); + when(); PrismObject resource = getObject(ResourceType.class, RESOURCE_DUMMY_VAULT_OID); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/security/TestSecurityBasic.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/security/TestSecurityBasic.java index d6214f63375..8415dd4df18 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/security/TestSecurityBasic.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/security/TestSecurityBasic.java @@ -100,7 +100,7 @@ public void test201AutzJackSuperuserRole() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertSuperuserAccess(NUMBER_OF_ALL_USERS); assertGlobalStateUntouched(); @@ -242,7 +242,7 @@ public void test204AutzJackSelfRole() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_JACK_OID); assertGetDeny(UserType.class, USER_GUYBRUSH_OID); @@ -295,7 +295,7 @@ public void test204aAutzJackCaseObjectSelfRole() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_JACK_OID); assertGetDeny(UserType.class, USER_GUYBRUSH_OID); @@ -348,7 +348,7 @@ public void test204bAutzJackCaseAssigneeSelfRole() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_JACK_OID); assertGetDeny(UserType.class, USER_GUYBRUSH_OID); @@ -404,7 +404,7 @@ public void test204cAutzJackCaseAssigneeSelfWithDelegatesRole() throws Exception login(USER_DEPUTY_1_NAME); // WHEN - when(TEST_NAME); + when(); assertGetDeny(UserType.class, USER_JACK_OID); assertGetAllow(UserType.class, USER_DEPUTY_1_OID); @@ -468,7 +468,7 @@ public void test204dAutzJackCaseAssigneeSelfWithNonWorkItemsDelegatesRole() thro login(USER_DEPUTY_2_NAME); // WHEN - when(TEST_NAME); + when(); assertGetDeny(UserType.class, USER_JACK_OID); assertGetAllow(UserType.class, USER_DEPUTY_2_OID); @@ -528,7 +528,7 @@ public void test205AutzJackObjectFilterModifyCaribbeanfRole() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(); assertReadDenyRaw(); @@ -553,7 +553,7 @@ public void test207AutzJackObjectFilterCaribbeanRole() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_JACK_OID); assertGetDeny(UserType.class, USER_JACK_OID, SelectorOptions.createCollection(GetOperationOptions.createRaw())); @@ -591,7 +591,7 @@ public void test207rAutzJackObjectFilterCaribbeanRole() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_JACK_OID); assertGetAllow(UserType.class, USER_JACK_OID, SelectorOptions.createCollection(GetOperationOptions.createRaw())); @@ -644,7 +644,7 @@ public void testAutzJackReadSomeRoles(final String TEST_NAME, String roleOid) th login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadDeny(); assertReadDenyRaw(); @@ -701,7 +701,7 @@ public void test210AutzJackPropReadAllModifySome() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(); assertReadDenyRaw(); @@ -738,7 +738,7 @@ public void test211AutzJackPropReadAllModifySomeUser() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_JACK_OID); assertGetDeny(UserType.class, USER_JACK_OID, SelectorOptions.createCollection(GetOperationOptions.createRaw())); @@ -786,7 +786,7 @@ public void test212AutzJackPropReadAllModifySomeUserPartial() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_JACK_OID); assertGetDeny(UserType.class, USER_JACK_OID, SelectorOptions.createCollection(GetOperationOptions.createRaw())); @@ -883,7 +883,7 @@ public void test217AutzJackPropGetSearchSomeModifySomeUser() throws Exception { private void doReadSomeModifySomeUser(final String TEST_NAME) throws Exception { // WHEN - when(TEST_NAME); + when(); PrismObject userJack = getUser(USER_JACK_OID); display("Jack", userJack); @@ -920,7 +920,7 @@ public void testAutzJackPropReadSomeModifySome(final String TEST_NAME, String ro login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadSomeModifySome(1); @@ -936,7 +936,7 @@ public void test218AutzJackPropReadSomeModifySomeExecAll() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(); @@ -1016,7 +1016,7 @@ public void test219AutzJackPropReadSomeModifySomeFullName() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(); @@ -1175,7 +1175,7 @@ public void test220AutzJackPropDenyModifySome() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(); @@ -1240,7 +1240,7 @@ public void test230AutzJackMasterMinistryOfRum() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadDeny(3); assertAddDeny(); @@ -1271,7 +1271,7 @@ public void test232AutzJackReadOrgMinistryOfRum() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadDeny(0); assertAddDeny(); @@ -1308,7 +1308,7 @@ public void test240AutzJackManagerFullControlNoOrg() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadDeny(0); assertAddDeny(); @@ -1359,7 +1359,7 @@ public void test241AutzJackManagerFullControlMemberMinistryOfRum() throws Except login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertJack24xMember(accountOid, true); @@ -1387,7 +1387,7 @@ public void test242AutzJackManagerFullControlManagerMinistryOfRum() throws Excep login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertJack24xManager(TEST_NAME, true); @@ -1418,7 +1418,7 @@ public void test243AutzJackManagerFullControlManagerMinistryOfRumAndDefense() th login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertJack24xManagerDefense(TEST_NAME, true); @@ -1444,7 +1444,7 @@ public void test245AutzJackManagerUserAdminMemberMinistryOfRum() throws Exceptio login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertJack24xMember(accountOid, false); @@ -1472,7 +1472,7 @@ public void test246AutzJackManagerUserAdminManagerMinistryOfRum() throws Excepti login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertJack24xManager(TEST_NAME, false); @@ -1501,7 +1501,7 @@ public void test247AutzJackManagerUserAdminManagerMinistryOfRumAndDefense() thro login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertJack24xManagerDefense(TEST_NAME, false); @@ -1747,7 +1747,7 @@ public void test250AutzJackSelfAccountsRead() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_JACK_OID); assertGetDeny(UserType.class, USER_GUYBRUSH_OID); @@ -1815,7 +1815,7 @@ public void test255AutzJackSelfAccountsReadWrite() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_JACK_OID); assertGetDeny(UserType.class, USER_GUYBRUSH_OID); @@ -1880,7 +1880,7 @@ public void test256AutzJackSelfAccountsPartialControl() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_JACK_OID); assertGetDeny(UserType.class, USER_GUYBRUSH_OID); @@ -1962,7 +1962,7 @@ public void test258AutzJackSelfAccountsPartialControlPassword() throws Exception login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_JACK_OID); assertGetDeny(UserType.class, USER_GUYBRUSH_OID); @@ -2025,7 +2025,7 @@ public void test259AutzJackSelfAccountsPartialControl() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_JACK_OID); assertGetDeny(UserType.class, USER_GUYBRUSH_OID); @@ -2093,7 +2093,7 @@ public void test260AutzJackObjectFilterLocationShadowRole() throws Exception { assumeAssignmentPolicy(AssignmentPolicyEnforcementType.NONE); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_JACK_OID); assertGetDeny(UserType.class, USER_JACK_OID, SelectorOptions.createCollection(GetOperationOptions.createRaw())); @@ -2165,7 +2165,7 @@ public void test261AutzAngelicaObjectFilterLocationCreateUserShadowRole() throws assumeAssignmentPolicy(AssignmentPolicyEnforcementType.RELATIVE); // WHEN - when(TEST_NAME); + when(); assertAllow("add user angelica", (task, result) -> addObject(USER_ANGELICA_FILE, task, result)); @@ -2196,7 +2196,7 @@ public void test270AutzJackAssignApplicationRoles() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(NUMBER_OF_ALL_USERS + 1); assertAddDeny(); @@ -2250,7 +2250,7 @@ public void test272AutzJackAssignAnyRoles() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(NUMBER_OF_ALL_USERS + 1); assertAddDeny(); @@ -2309,7 +2309,7 @@ public void test273AutzJackRedyAssignmentExceptionRules() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(NUMBER_OF_ALL_USERS + 1); assertAddDeny(); @@ -2362,7 +2362,7 @@ public void test274AutzJackAssignNonApplicationRoles() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(NUMBER_OF_ALL_USERS + 1); assertAddDeny(); @@ -2409,7 +2409,7 @@ public void test275aAutzJackAssignRequestableRoles() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(NUMBER_OF_ALL_USERS + 1); assertAddDeny(); @@ -2463,7 +2463,7 @@ public void test275bAutzJackAssignRequestableOrgs() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); PrismObject user = getUser(USER_JACK_OID); assertAssignments(user, 1); assertAssignedRole(user, ROLE_END_USER_REQUESTABLE_ABSTRACTROLES_OID); @@ -2508,7 +2508,7 @@ public void test275cAutzJackAssignRequestableRolesAndInduceAnyRole() throws Exce login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(NUMBER_OF_ALL_USERS + 1); assertAddDeny(); @@ -2563,7 +2563,7 @@ public void test276AutzJackAssignRequestableRolesWithOrgRef() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(NUMBER_OF_ALL_USERS + 1); assertAddDeny(); @@ -2616,7 +2616,7 @@ public void test277AutzJackAssignRequestableRolesWithOrgRefSecondTime() throws E login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(NUMBER_OF_ALL_USERS + 1); assertAddDeny(); @@ -2698,7 +2698,7 @@ public void test278AutzJackAssignRequestableRolesWithOrgRefTweakedDelta() throws login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(NUMBER_OF_ALL_USERS + 1); assertAddDeny(); @@ -2766,7 +2766,7 @@ public void test279AutzJackAssignRequestableRolesWithTenantRef() throws Exceptio login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(NUMBER_OF_ALL_USERS + 1); assertAddDeny(); @@ -2824,7 +2824,7 @@ public void test280AutzJackEndUser() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetDeny(UserType.class, USER_JACK_OID, SelectorOptions.createCollection(GetOperationOptions.createRaw())); assertGetDeny(UserType.class, USER_GUYBRUSH_OID); @@ -2907,7 +2907,7 @@ public void test281AutzJackEndUserSecondTime() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); PrismObject user = getUser(USER_JACK_OID); assertAssignments(user, 1); @@ -2973,7 +2973,7 @@ public void test282AutzJackEndUserAndModify() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(NUMBER_OF_ALL_USERS + 1); assertAddDeny(); @@ -3014,7 +3014,7 @@ public void test283AutzJackModifyAndEndUser() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(NUMBER_OF_ALL_USERS + 1); assertAddDeny(); @@ -3047,7 +3047,7 @@ public void test285AutzJackEndUserAndAdd() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertReadAllow(NUMBER_OF_ALL_USERS + 1); @@ -3078,7 +3078,7 @@ public void test295AutzJackAssignOrgRelation() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); ObjectFilter jackAssignableRoleFilter = assertAssignableRoleSpecification(getUser(USER_JACK_OID)) .relationDefault() @@ -3236,7 +3236,7 @@ public void test370AutzJackLimitedUserAdmin() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_JACK_OID); assertGetAllow(UserType.class, USER_GUYBRUSH_OID); @@ -3263,7 +3263,7 @@ public void test380AutzJackSelfTaskOwner() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetDeny(UserType.class, USER_JACK_OID); assertGetDeny(UserType.class, USER_GUYBRUSH_OID); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/security/TestSecurityMedium.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/security/TestSecurityMedium.java index 919de863ea2..0f03b6409da 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/security/TestSecurityMedium.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/security/TestSecurityMedium.java @@ -58,7 +58,7 @@ public void test000Sanity() throws Exception { cleanupAutzTest(USER_JACK_OID); // WHEN - when(TEST_NAME); + when(); assertSearch(UserType.class, null, NUMBER_OF_ALL_USERS); assertSearch(RoleType.class, null, getNumberOfRoles()); @@ -84,7 +84,7 @@ public void test100AutzEmployeeManager() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetDeny(UserType.class, USER_JACK_OID); assertGetDeny(UserType.class, USER_GUYBRUSH_OID); @@ -114,7 +114,7 @@ public void test102AutzEmployeeManagerAddEmployee() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertAddAllow(USER_EMPLOYEE_FRED_FILE); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/security/TestSecurityMultitenant.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/security/TestSecurityMultitenant.java index 3c9f56708a8..1449864b2ee 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/security/TestSecurityMultitenant.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/security/TestSecurityMultitenant.java @@ -216,7 +216,7 @@ public void test000Sanity() throws Exception { cleanupAutzTest(USER_JACK_OID); // WHEN - when(TEST_NAME); + when(); assertSearch(UserType.class, null, NUMBER_OF_ALL_USERS); assertSearch(RoleType.class, null, getNumberOfRoles()); @@ -246,11 +246,11 @@ public void test010ImportOrgstruct() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); importObjectsFromFileNotRaw(ORG_MULTITENANT_FILE, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); dumpOrgTree(); @@ -382,7 +382,7 @@ public void test100AutzLetoRead() throws Exception { login(USER_LETO_ATREIDES_NAME); // WHEN - when(TEST_NAME); + when(); // Matching tenant assertGetAllow(UserType.class, USER_LETO_ATREIDES_OID); @@ -406,7 +406,7 @@ public void test100AutzLetoRead() throws Exception { assertSearch(OrgType.class, null, ORG_ATREIDES_OID, ORG_CALADAN_OID); // THEN - then(TEST_NAME); + then(); assertGlobalStateUntouched(); } @@ -423,7 +423,7 @@ public void test102AutzLetoAdd() throws Exception { login(USER_LETO_ATREIDES_NAME); // WHEN - when(TEST_NAME); + when(); // Matching tenant assertAddAllow(USER_DUNCAN_FILE); @@ -435,7 +435,7 @@ public void test102AutzLetoAdd() throws Exception { assertAddDeny(USER_DMURR_FILE); // THEN - then(TEST_NAME); + then(); login(USER_ADMINISTRATOR_USERNAME); @@ -467,7 +467,7 @@ public void test104AutzLetoModify() throws Exception { login(USER_LETO_ATREIDES_NAME); // WHEN - when(TEST_NAME); + when(); // Matching tenant assertModifyAllow(UserType.class, USER_PAUL_ATREIDES_OID, UserType.F_LOCALITY, createPolyString("Arrakis")); @@ -479,7 +479,7 @@ public void test104AutzLetoModify() throws Exception { assertModifyDeny(UserType.class, USER_EDRIC_OID, UserType.F_LOCALITY, createPolyString("Whatever")); // THEN - then(TEST_NAME); + then(); assertGlobalStateUntouched(); } @@ -498,7 +498,7 @@ public void test106AutzLetoAddResourceTask() throws Exception { login(USER_LETO_ATREIDES_NAME); // WHEN - when(TEST_NAME); + when(); // Matching tenant assertAddDummyResourceAllow(RESOURCE_DUMMY_CASTLE_CALADAN_FILE); @@ -510,7 +510,7 @@ public void test106AutzLetoAddResourceTask() throws Exception { assertAddDummyResourceDeny(RESOURCE_DUMMY_JUNCTION_FILE); // THEN - then(TEST_NAME); + then(); login(USER_ADMINISTRATOR_USERNAME); @@ -543,7 +543,7 @@ public void test109AutzLetoDelete() throws Exception { login(USER_LETO_ATREIDES_NAME); // WHEN - when(TEST_NAME); + when(); // Matching tenant assertDeleteAllow(UserType.class, USER_DUNCAN_OID); @@ -555,7 +555,7 @@ public void test109AutzLetoDelete() throws Exception { assertDeleteDeny(UserType.class, USER_DMURR_OID); // THEN - then(TEST_NAME); + then(); assertGlobalStateUntouched(); } @@ -572,7 +572,7 @@ public void test110AutzLetoAddOrgs() throws Exception { login(USER_LETO_ATREIDES_NAME); // WHEN - when(TEST_NAME); + when(); // Matching tenant assertAddAllow(ORG_ARRAKIS_FILE); @@ -585,7 +585,7 @@ public void test110AutzLetoAddOrgs() throws Exception { assertAddDeny(ORG_JUNCTION_FILE); // THEN - then(TEST_NAME); + then(); login(USER_ADMINISTRATOR_USERNAME); @@ -626,7 +626,7 @@ public void test112AutzLetoProtectTenant() throws Exception { login(USER_LETO_ATREIDES_NAME); // WHEN - when(TEST_NAME); + when(); // Matching tenant assertAddDeny(ORG_ATREIDES_SUBTENANT_FILE); @@ -677,7 +677,7 @@ public void test112AutzLetoProtectTenant() throws Exception { assertDeleteDeny(OrgType.class, ORG_GUILD_OID); // THEN - then(TEST_NAME); + then(); assertGlobalStateUntouched(); } @@ -695,7 +695,7 @@ public void test114AutzLetoKeepWithinTenant() throws Exception { login(USER_LETO_ATREIDES_NAME); // WHEN - when(TEST_NAME); + when(); assertAddAllow(ROLE_ATREIDES_GUARD_FILE); @@ -740,7 +740,7 @@ public void test114AutzLetoKeepWithinTenant() throws Exception { (task, result) -> unassignOrg(OrgType.class, ORG_CASTLE_CALADAN_OID, ORG_CALADAN_OID, task, result)); // THEN - then(TEST_NAME); + then(); assertGlobalStateUntouched(); } @@ -757,7 +757,7 @@ public void test116AutzLetoProtectTenantAdminRole() throws Exception { login(USER_LETO_ATREIDES_NAME); // WHEN - when(TEST_NAME); + when(); assertAddDeny(ROLE_ATREIDES_HACKER_FILE); @@ -797,7 +797,7 @@ public void test116AutzLetoProtectTenantAdminRole() throws Exception { RoleType.F_POLICY_EXCEPTION, task, result, policyException)); // THEN - then(TEST_NAME); + then(); assertGlobalStateUntouched(); } @@ -816,7 +816,7 @@ public void test118AutzLetoBusinessRoles() throws Exception { assertAddAllow(ROLE_ATREIDES_GUARD_FILE); // WHEN - when(TEST_NAME); + when(); assertAddAllow(ROLE_ATREIDES_SWORDMASTER_FILE); @@ -835,7 +835,7 @@ public void test118AutzLetoBusinessRoles() throws Exception { assertDeleteAllow(RoleType.class, ROLE_ATREIDES_SWORDMASTER_OID); // THEN - then(TEST_NAME); + then(); assertGlobalStateUntouched(); } @@ -855,7 +855,7 @@ public void test120AutzPaulEndUser() throws Exception { login(USER_PAUL_ATREIDES_NAME); // WHEN - when(TEST_NAME); + when(); // Requestable role assertAllow("assign guard to paul", @@ -874,7 +874,7 @@ public void test120AutzPaulEndUser() throws Exception { (task, result) -> assignRole(USER_PAUL_ATREIDES_OID, ROLE_CORRINO_EMPEROR_OID, task, result)); // THEN - then(TEST_NAME); + then(); assertGlobalStateUntouched(); } @@ -891,7 +891,7 @@ public void test122AutzDuncanRoleManager() throws Exception { login(USER_DUNCAN_NAME); // WHEN - when(TEST_NAME); + when(); assertDeny("assign guard to paul", (task, result) -> assignRole(USER_PAUL_ATREIDES_OID, ROLE_ATREIDES_GUARD_OID, task, result)); @@ -915,7 +915,7 @@ public void test122AutzDuncanRoleManager() throws Exception { (task, result) -> induceOrg(RoleType.class, ROLE_ATREIDES_SWORDMASTER_OID, ORG_CALADAN_OID, task, result)); // THEN - then(TEST_NAME); + then(); assertGlobalStateUntouched(); } @@ -937,7 +937,7 @@ public void test130AutzEdricRead() throws Exception { login(USER_EDRIC_NAME); // WHEN - when(TEST_NAME); + when(); // Wrong tenant assertGetDeny(UserType.class, USER_LETO_ATREIDES_OID); @@ -955,7 +955,7 @@ public void test130AutzEdricRead() throws Exception { assertSearch(OrgType.class, null, 0); // THEN - then(TEST_NAME); + then(); assertGlobalStateUntouched(); } diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/security/TestSecurityPrincipal.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/security/TestSecurityPrincipal.java index a632856dde0..93c14b2ce37 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/security/TestSecurityPrincipal.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/security/TestSecurityPrincipal.java @@ -274,11 +274,11 @@ public void test110GuybrushRoleNicePirate() throws Exception { resetAuthentication(); // WHEN - when(TEST_NAME); + when(); MidPointPrincipal principal = focusProfileService.getPrincipal(USER_GUYBRUSH_USERNAME, UserType.class); // THEN - then(TEST_NAME); + then(); display("Principal guybrush", principal); assertEquals("Wrong number of authorizations", 2, principal.getAuthorities().size()); @@ -298,11 +298,11 @@ public void test111GuybrushRoleCaptain() throws Exception { resetAuthentication(); // WHEN - when(TEST_NAME); + when(); MidPointPrincipal principal = focusProfileService.getPrincipal(USER_GUYBRUSH_USERNAME, UserType.class); // THEN - then(TEST_NAME); + then(); display("Principal guybrush", principal); assertEquals("Wrong number of authorizations", 3, principal.getAuthorities().size()); @@ -323,11 +323,11 @@ public void test119GuybrushUnassignRoles() throws Exception { resetAuthentication(); // WHEN - when(TEST_NAME); + when(); MidPointPrincipal principal = focusProfileService.getPrincipal(USER_JACK_USERNAME, UserType.class); // THEN - then(TEST_NAME); + then(); assertEquals("Wrong number of authorizations", 0, principal.getAuthorities().size()); assertNotAuthorized(principal, AUTZ_LOOT_URL); @@ -352,11 +352,11 @@ public void test120JackRoleIndirectPirate() throws Exception { resetAuthentication(); // WHEN - when(TEST_NAME); + when(); MidPointPrincipal principal = focusProfileService.getPrincipal(USER_JACK_USERNAME, UserType.class); // THEN - then(TEST_NAME); + then(); display("Principal guybrush", principal); assertEquals("Wrong number of authorizations", 1, principal.getAuthorities().size()); @@ -384,11 +384,11 @@ public void test122JackOrgIndirectPirate() throws Exception { resetAuthentication(); // WHEN - when(TEST_NAME); + when(); MidPointPrincipal principal = focusProfileService.getPrincipal(USER_JACK_USERNAME, UserType.class); // THEN - then(TEST_NAME); + then(); display("Principal guybrush", principal); assertEquals("Wrong number of authorizations", 1, principal.getAuthorities().size()); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/AbstractObjTemplateSyncTest.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/AbstractObjTemplateSyncTest.java index 5d541191928..3b4ecc9aab3 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/AbstractObjTemplateSyncTest.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/AbstractObjTemplateSyncTest.java @@ -148,7 +148,7 @@ public void test110AddDummyByzantineAccountMancomb() throws Exception { account.addAttributeValue(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_GOSSIP_NAME, gossip); /// WHEN - when(TEST_NAME); + when(); display("Adding dummy account", account.debugDump()); @@ -157,7 +157,7 @@ public void test110AddDummyByzantineAccountMancomb() throws Exception { waitForSyncTaskNextRun(resourceDummyByzantine); // THEN - then(TEST_NAME); + then(); PrismObject accountMancomb = findAccountByUsername(ACCOUNT_MANCOMB_DUMMY_USERNAME, resourceDummyByzantine); display("Account mancomb", accountMancomb); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/AbstractSynchronizationStoryTest.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/AbstractSynchronizationStoryTest.java index eaaa30221f2..3693fdd6e0d 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/AbstractSynchronizationStoryTest.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/AbstractSynchronizationStoryTest.java @@ -112,11 +112,11 @@ public void test100ImportLiveSyncTaskDummyGreen() throws Exception { OperationResult result = task.getResult(); /// WHEN - when(TEST_NAME); + when(); importSyncTask(getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME)); // THEN - then(TEST_NAME); + then(); waitForSyncTaskStart(getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME)); } @@ -143,14 +143,14 @@ public void test110AddDummyGreenAccountMancomb() throws Exception { account.addAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_LOCATION_NAME, "Melee Island"); /// WHEN - when(TEST_NAME); + when(); getDummyResource(RESOURCE_DUMMY_GREEN_NAME).addAccount(account); waitForSyncTaskNextRunAssertSuccess(getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME)); // THEN - then(TEST_NAME); + then(); PrismObject accountMancomb = findAccountByUsername(ACCOUNT_MANCOMB_DUMMY_USERNAME, getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME)); display("Account mancomb", accountMancomb); @@ -198,11 +198,11 @@ public void test200ImportLiveSyncTaskDummyBlue() throws Exception { OperationResult result = task.getResult(); /// WHEN - when(TEST_NAME); + when(); importSyncTask(getDummyResourceObject(RESOURCE_DUMMY_BLUE_NAME)); // THEN - then(TEST_NAME); + then(); waitForSyncTaskStart(getDummyResourceObject(RESOURCE_DUMMY_BLUE_NAME)); } @@ -222,14 +222,14 @@ public void test210AddDummyGreenAccountWally() throws Exception { prepareNotifications(); /// WHEN - when(TEST_NAME); + when(); getDummyResourceController(RESOURCE_DUMMY_GREEN_NAME).addAccount(ACCOUNT_WALLY_DUMMY_USERNAME, "Wally Feed", "Scabb Island"); // Wait for sync task to pick up the change waitForSyncTaskNextRunAssertSuccess(getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME)); // THEN - then(TEST_NAME); + then(); dumpSyncTaskTree(getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME), result); @@ -274,7 +274,7 @@ public void test220AddDummyBlueAccountWally() throws Exception { prepareNotifications(); /// WHEN - when(TEST_NAME); + when(); getDummyResourceController(RESOURCE_DUMMY_BLUE_NAME).addAccount(ACCOUNT_WALLY_DUMMY_USERNAME, "Wally Feed", "Scabb Island"); // Wait for sync task to pick up the change @@ -288,7 +288,7 @@ public void test220AddDummyBlueAccountWally() throws Exception { waitForSyncTaskNextRunAssertSuccess(getDummyResourceObject(RESOURCE_DUMMY_BLUE_NAME)); // THEN - then(TEST_NAME); + then(); dumpSyncTaskTree(getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME), result); dumpSyncTaskTree(getDummyResourceObject(RESOURCE_DUMMY_BLUE_NAME), result); @@ -338,7 +338,7 @@ public void test315AddDummyBlueAccountMancomb() throws Exception { prepareNotifications(); /// WHEN - when(TEST_NAME); + when(); getDummyResourceController(RESOURCE_DUMMY_BLUE_NAME).addAccount(ACCOUNT_MANCOMB_DUMMY_USERNAME, "Mancomb Seepgood", "Melee Island"); // Wait for sync task to pick up the change @@ -351,7 +351,7 @@ public void test315AddDummyBlueAccountMancomb() throws Exception { waitForSyncTaskNextRunAssertSuccess(getDummyResourceObject(RESOURCE_DUMMY_BLUE_NAME)); // THEN - then(TEST_NAME); + then(); // The ckecks are simplified here because the developer has a lazy mood :-) assertDummyAccount(RESOURCE_DUMMY_BLUE_NAME, ACCOUNT_MANCOMB_DUMMY_USERNAME, "Mancomb Seepgood", true); @@ -393,11 +393,11 @@ public void test350ImportLiveSyncTaskDummyDefault() throws Exception { OperationResult result = task.getResult(); /// WHEN - when(TEST_NAME); + when(); importSyncTask(getDummyResourceObject()); // THEN - then(TEST_NAME); + then(); waitForSyncTaskStart(getDummyResourceObject()); @@ -428,11 +428,11 @@ public void test360ModifyUserAddDummyDefaultAccount() throws Exception { Collection> deltas = (Collection)MiscUtil.createCollection(userDelta); /// WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, null, task, result); // THEN - then(TEST_NAME); + then(); dumpSyncTaskTree(getDummyResourceObject(), result); dumpSyncTaskTree(getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME), result); @@ -545,7 +545,7 @@ public void test370ModifyDummyGreenAccountWally() throws Exception { DummyAccount wallyDummyAccount = getDummyResource(RESOURCE_DUMMY_GREEN_NAME).getAccountByUsername(ACCOUNT_WALLY_DUMMY_USERNAME); /// WHEN - when(TEST_NAME); + when(); wallyDummyAccount.replaceAttributeValue(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_FULLNAME_NAME, "Wally B. Feed"); // Wait for sync task to pick up the change @@ -560,7 +560,7 @@ public void test370ModifyDummyGreenAccountWally() throws Exception { waitForSyncTaskNextRunAssertSuccess(getDummyResourceObject()); // THEN - then(TEST_NAME); + then(); dumpSyncTaskTree(getDummyResourceObject(), result); dumpSyncTaskTree(getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME), result); @@ -627,7 +627,7 @@ public void test380ModifyUserWallyFullName() throws Exception { DummyAccount wallyDummyAccount = getDummyResource(RESOURCE_DUMMY_GREEN_NAME).getAccountByUsername(ACCOUNT_WALLY_DUMMY_USERNAME); /// WHEN - when(TEST_NAME); + when(); modifyUserReplace(userWallyOid, UserType.F_FULL_NAME, task, result, PrismTestUtil.createPolyString("Bloodnose")); // Wait for sync tasks to pick up the change and have some chance to screw things @@ -643,7 +643,7 @@ public void test380ModifyUserWallyFullName() throws Exception { waitForSyncTaskNextRunAssertSuccess(getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME)); // THEN - then(TEST_NAME); + then(); dumpSyncTaskTree(getDummyResourceObject(), result); dumpSyncTaskTree(getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME), result); @@ -697,7 +697,7 @@ public void test382ModifyUserWallyLocality() throws Exception { DummyAccount wallyDummyAccount = getDummyResource(RESOURCE_DUMMY_GREEN_NAME).getAccountByUsername(ACCOUNT_WALLY_DUMMY_USERNAME); /// WHEN - when(TEST_NAME); + when(); modifyUserReplace(userWallyOid, UserType.F_LOCALITY, task, result, PrismTestUtil.createPolyString("Plunder island")); // Wait for sync tasks to pick up the change and have some chance to screw things @@ -713,7 +713,7 @@ public void test382ModifyUserWallyLocality() throws Exception { waitForSyncTaskNextRunAssertSuccess(getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME)); // THEN - then(TEST_NAME); + then(); dumpSyncTaskTree(getDummyResourceObject(), result); dumpSyncTaskTree(getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME), result); @@ -776,7 +776,7 @@ public void test400DeleteDummyDefaultAccount() throws Exception { prepareNotifications(); /// WHEN - when(TEST_NAME); + when(); getDummyResource().deleteAccountByName(ACCOUNT_WALLY_DUMMY_USERNAME); display("Dummy (default) resource", getDummyResource().debugDump()); @@ -787,7 +787,7 @@ public void test400DeleteDummyDefaultAccount() throws Exception { waitForSyncTaskNextRunAssertSuccess(getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME)); // THEN - then(TEST_NAME); + then(); dumpSyncTaskTree(getDummyResourceObject(), result); dumpSyncTaskTree(getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME), result); @@ -844,7 +844,7 @@ public void test410DeleteDummyGreenAccount() throws Exception { prepareNotifications(); /// WHEN - when(TEST_NAME); + when(); getDummyResource(RESOURCE_DUMMY_GREEN_NAME).deleteAccountByName(ACCOUNT_WALLY_DUMMY_USERNAME); // Make sure we have steady state @@ -853,7 +853,7 @@ public void test410DeleteDummyGreenAccount() throws Exception { waitForSyncTaskNextRunAssertSuccess(getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME)); // THEN - then(TEST_NAME); + then(); dumpSyncTaskTree(getDummyResourceObject(), result); dumpSyncTaskTree(getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME), result); @@ -941,14 +941,14 @@ public void test510AddDummyGreenAccountWallyUserTemplate() throws Exception { assumeUserTemplate(USER_TEMPLATE_SYNC_OID, getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME).asObjectable(), null, result); /// WHEN - when(TEST_NAME); + when(); getDummyResourceController(RESOURCE_DUMMY_GREEN_NAME).addAccount(ACCOUNT_WALLY_DUMMY_USERNAME, "Wally Feed", "Scabb Island"); // Wait for sync task to pick up the change waitForSyncTaskNextRunAssertSuccess(getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME)); // THEN - then(TEST_NAME); + then(); PrismObject accountWallyGreen = checkWallyAccount(getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME), getDummyResource(RESOURCE_DUMMY_GREEN_NAME), "green", "Wally Feed"); assertShadowOperationalData(accountWallyGreen, SynchronizationSituationType.LINKED); @@ -992,14 +992,14 @@ public void test600AddDummyGreenAccountCalypso() throws Exception { account.addAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_LOCATION_NAME, "The Seven Seas"); /// WHEN - when(TEST_NAME); + when(); getDummyResource(RESOURCE_DUMMY_GREEN_NAME).addAccount(account); waitForSyncTaskNextRunAssertSuccess(getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME)); // THEN - then(TEST_NAME); + then(); PrismObject accountShadow = findAccountByUsername(ACCOUNT_CALYPSO_DUMMY_USERNAME, getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME)); display("Account calypso", accountShadow); @@ -1038,14 +1038,14 @@ public void test700AddDummyGreenAccountXjojo() throws Exception { account.addAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_LOCATION_NAME, "Scabb Island"); /// WHEN - when(TEST_NAME); + when(); getDummyResource(RESOURCE_DUMMY_GREEN_NAME).addAccount(account); waitForSyncTaskNextRunAssertSuccess(getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME)); // THEN - then(TEST_NAME); + then(); PrismObject accountAfter = findAccountByUsername("Xjojo", getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME)); display("Account after", accountAfter); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestImportRecon.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestImportRecon.java index 3bad0e2f56f..f46bdf4fead 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestImportRecon.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestImportRecon.java @@ -374,11 +374,11 @@ public void test100ImportStanFromResourceDummy() throws Exception { loginImportUser(); // WHEN - when(TEST_NAME); + when(); modelService.importFromResource(ACCOUNT_STAN_OID, task, result); // THEN - then(TEST_NAME); + then(); display(result); assertSuccess(result); @@ -430,11 +430,11 @@ public void test150ImportFromResourceDummy() throws Exception { rememberCounter(InternalCounters.SHADOW_FETCH_OPERATION_COUNT); // WHEN - when(TEST_NAME); + when(); modelService.importFromResource(RESOURCE_DUMMY_OID, new QName(RESOURCE_DUMMY_NAMESPACE, "AccountObjectClass"), task, result); // THEN - then(TEST_NAME); + then(); OperationResult subresult = result.getLastSubresult(); TestUtil.assertInProgress("importAccountsFromResource result", subresult); @@ -443,7 +443,7 @@ public void test150ImportFromResourceDummy() throws Exception { waitForTaskFinish(task, true, 40000); // THEN - then(TEST_NAME); + then(); TestUtil.assertSuccess(task.getResult()); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 6); @@ -489,11 +489,11 @@ public void test155ImportFromResourceDummyAgain() throws Exception { rememberCounter(InternalCounters.SHADOW_FETCH_OPERATION_COUNT); // WHEN - when(TEST_NAME); + when(); modelService.importFromResource(RESOURCE_DUMMY_OID, new QName(RESOURCE_DUMMY_NAMESPACE, "AccountObjectClass"), task, result); // THEN - then(TEST_NAME); + then(); OperationResult subresult = result.getLastSubresult(); TestUtil.assertInProgress("importAccountsFromResource result", subresult); @@ -502,7 +502,7 @@ public void test155ImportFromResourceDummyAgain() throws Exception { waitForTaskFinish(task, true, 40000); // THEN - then(TEST_NAME); + then(); assertSuccess(task.getResult()); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 3); @@ -557,11 +557,11 @@ public void test160ImportFromResourceDummyLime() throws Exception { loginImportUser(); // WHEN - when(TEST_NAME); + when(); modelService.importFromResource(RESOURCE_DUMMY_LIME_OID, new QName(RESOURCE_DUMMY_LIME_NAMESPACE, "AccountObjectClass"), task, result); // THEN - then(TEST_NAME); + then(); OperationResult subresult = result.getLastSubresult(); TestUtil.assertInProgress("importAccountsFromResource result", subresult); @@ -570,7 +570,7 @@ public void test160ImportFromResourceDummyLime() throws Exception { waitForTaskFinish(task, true, 40000); // THEN - then(TEST_NAME); + then(); TestUtil.assertSuccess(task.getResult()); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 2); @@ -635,11 +635,11 @@ public void test162ImportFromResourceDummyLimeRappOrganizationScummBar() throws rememberCounter(InternalCounters.SHADOW_FETCH_OPERATION_COUNT); // WHEN - when(TEST_NAME); + when(); modelService.importFromResource(RESOURCE_DUMMY_LIME_OID, new QName(RESOURCE_DUMMY_LIME_NAMESPACE, "AccountObjectClass"), task, result); // THEN - then(TEST_NAME); + then(); OperationResult subresult = result.getLastSubresult(); TestUtil.assertInProgress("importAccountsFromResource result", subresult); @@ -648,7 +648,7 @@ public void test162ImportFromResourceDummyLimeRappOrganizationScummBar() throws waitForTaskFinish(task, true, 40000); // THEN - then(TEST_NAME); + then(); TestUtil.assertSuccess(task.getResult()); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 2); @@ -720,11 +720,11 @@ public void test164ImportFromResourceDummyLimeRappOrganizationNull() throws Exce rememberCounter(InternalCounters.SHADOW_FETCH_OPERATION_COUNT); // WHEN - when(TEST_NAME); + when(); modelService.importFromResource(RESOURCE_DUMMY_LIME_OID, new QName(RESOURCE_DUMMY_LIME_NAMESPACE, "AccountObjectClass"), task, result); // THEN - then(TEST_NAME); + then(); OperationResult subresult = result.getLastSubresult(); TestUtil.assertInProgress("importAccountsFromResource result", subresult); @@ -733,7 +733,7 @@ public void test164ImportFromResourceDummyLimeRappOrganizationNull() throws Exce waitForTaskFinish(task, true, 40000); // THEN - then(TEST_NAME); + then(); assertSuccess(task.getResult()); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 2); @@ -813,16 +813,16 @@ public void test200ReconcileDummy() throws Exception { reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); importObjectFromFile(TASK_RECONCILE_DUMMY_SINGLE_FILE); // THEN - then(TEST_NAME); + then(); waitForTaskFinish(TASK_RECONCILE_DUMMY_OID, false); // THEN - then(TEST_NAME); + then(); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 6); reconciliationTaskResultListener.assertResult(RESOURCE_DUMMY_OID, 0, 7, 0, 0); @@ -912,12 +912,12 @@ public void test210ReconcileDummyBroken() throws Exception { reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); restartTask(TASK_RECONCILE_DUMMY_OID); waitForTaskFinish(TASK_RECONCILE_DUMMY_OID, false, DEFAULT_TASK_WAIT_TIMEOUT, true); // THEN - then(TEST_NAME); + then(); List> users = modelService.searchObjects(UserType.class, null, null, task, result); display("Users after reconciliation (broken resource)", users); @@ -978,12 +978,12 @@ public void test219ReconcileDummyFixed() throws Exception { rememberCounter(InternalCounters.SHADOW_FETCH_OPERATION_COUNT); // WHEN - when(TEST_NAME); + when(); restartTask(TASK_RECONCILE_DUMMY_OID); waitForTaskFinish(TASK_RECONCILE_DUMMY_OID, false, DEFAULT_TASK_WAIT_TIMEOUT, true); // THEN - then(TEST_NAME); + then(); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 6); reconciliationTaskResultListener.assertResult(RESOURCE_DUMMY_OID, 0, 7, 0, 0); @@ -1063,12 +1063,12 @@ public void test220ReconcileDummyBrokenGuybrush() throws Exception { reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); restartTask(TASK_RECONCILE_DUMMY_OID); waitForTaskFinish(TASK_RECONCILE_DUMMY_OID, false, DEFAULT_TASK_WAIT_TIMEOUT, true); // THEN - then(TEST_NAME); + then(); List> users = modelService.searchObjects(UserType.class, null, null, task, result); display("Users after reconciliation (broken resource account)", users); @@ -1132,12 +1132,12 @@ public void test229ReconcileDummyFixed() throws Exception { reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); restartTask(TASK_RECONCILE_DUMMY_OID); waitForTaskFinish(TASK_RECONCILE_DUMMY_OID, false, DEFAULT_TASK_WAIT_TIMEOUT, true); // THEN - then(TEST_NAME); + then(); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 6); reconciliationTaskResultListener.assertResult(RESOURCE_DUMMY_OID, 0, 7, 0, 0); @@ -1222,12 +1222,12 @@ public void test230ReconcileDummyRename() throws Exception { reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); restartTask(TASK_RECONCILE_DUMMY_OID); waitForTaskFinish(TASK_RECONCILE_DUMMY_OID, false, DEFAULT_TASK_WAIT_TIMEOUT, true); // THEN - then(TEST_NAME); + then(); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 6); reconciliationTaskResultListener.assertResult(RESOURCE_DUMMY_OID, 0, 7, 0, 1); @@ -1338,15 +1338,15 @@ public void test300ReconcileDummyAzureAddAccountOtis() throws Exception { reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); importObjectFromFile(TASK_RECONCILE_DUMMY_AZURE_FILE); // THEN - then(TEST_NAME); + then(); waitForTaskFinish(TASK_RECONCILE_DUMMY_AZURE_OID, false); - then(TEST_NAME); + then(); List> users = modelService.searchObjects(UserType.class, null, null, task, result); display("Users after reconcile", users); @@ -1401,15 +1401,15 @@ public void test310ReconcileDummyAzureAgain() throws Exception { reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); restartTask(TASK_RECONCILE_DUMMY_AZURE_OID); // THEN - then(TEST_NAME); + then(); waitForTaskFinish(TASK_RECONCILE_DUMMY_AZURE_OID, false); - then(TEST_NAME); + then(); reconciliationTaskResultListener.assertResult(RESOURCE_DUMMY_AZURE_OID, 0, 1, 0, 0); List> users = modelService.searchObjects(UserType.class, null, null, task, result); @@ -1470,15 +1470,15 @@ public void test320ReconcileDummyAzureDeleteOtis() throws Exception { reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); restartTask(TASK_RECONCILE_DUMMY_AZURE_OID); // THEN - then(TEST_NAME); + then(); waitForTaskFinish(TASK_RECONCILE_DUMMY_AZURE_OID, false); - then(TEST_NAME); + then(); List> users = modelService.searchObjects(UserType.class, null, null, task, result); display("Users after reconcile", users); @@ -1544,15 +1544,15 @@ public void test330ReconcileDummyAzureAddAccountRapp() throws Exception { reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); restartTask(TASK_RECONCILE_DUMMY_AZURE_OID); // THEN - then(TEST_NAME); + then(); waitForTaskFinish(TASK_RECONCILE_DUMMY_AZURE_OID, false); - then(TEST_NAME); + then(); List> users = modelService.searchObjects(UserType.class, null, null, task, result); display("Users after reconcile", users); @@ -1651,15 +1651,15 @@ public void test332ModifyUserRappAndReconcileDummyAzure() throws Exception { reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); restartTask(TASK_RECONCILE_DUMMY_AZURE_OID); // THEN - then(TEST_NAME); + then(); waitForTaskFinish(TASK_RECONCILE_DUMMY_AZURE_OID, false); - then(TEST_NAME); + then(); List> users = modelService.searchObjects(UserType.class, null, null, task, result); display("Users after reconcile", users); @@ -1725,15 +1725,15 @@ public void test334AssignRoleCorpseToRappAndReconcileDummyAzure() throws Excepti reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); restartTask(TASK_RECONCILE_DUMMY_AZURE_OID); // THEN - then(TEST_NAME); + then(); waitForTaskFinish(TASK_RECONCILE_DUMMY_AZURE_OID, false); - then(TEST_NAME); + then(); List> users = modelService.searchObjects(UserType.class, null, null, task, result); display("Users after reconcile", users); @@ -1795,15 +1795,15 @@ public void test339ReconcileDummyAzureDeleteRapp() throws Exception { reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); restartTask(TASK_RECONCILE_DUMMY_AZURE_OID); // THEN - then(TEST_NAME); + then(); waitForTaskFinish(TASK_RECONCILE_DUMMY_AZURE_OID, false); - then(TEST_NAME); + then(); List> users = modelService.searchObjects(UserType.class, null, null, task, result); display("Users after reconcile", users); @@ -1861,15 +1861,15 @@ public void test400ReconcileDummyLimeAddAccount() throws Exception { reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); importObjectFromFile(TASK_RECONCILE_DUMMY_LIME_FILE); // THEN - then(TEST_NAME); + then(); waitForTaskFinish(TASK_RECONCILE_DUMMY_LIME_OID, false); - then(TEST_NAME); + then(); List> users = modelService.searchObjects(UserType.class, null, null, task, result); display("Users after reconcile", users); @@ -1916,11 +1916,11 @@ public void test401ReconcileDummyLimeKateOnlyEmpty() throws Exception { reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); reconcileUser(userBefore.getOid(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1964,11 +1964,11 @@ public void test402ReconcileDummyLimeKateOnlyGrog() throws Exception { reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); reconcileUser(userBefore.getOid(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2012,11 +2012,11 @@ public void test403ReconcileDummyLimeKateOnlyNoValue() throws Exception { reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); reconcileUser(userBefore.getOid(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2057,11 +2057,11 @@ public void test404ReconcileDummyLimeKateOnlyRum() throws Exception { reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); reconcileUser(userBefore.getOid(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2104,11 +2104,11 @@ public void test405ReconcileDummyLimeKateOnlyEmpty() throws Exception { reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); reconcileUser(userBefore.getOid(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2148,11 +2148,11 @@ public void test406ReconcileDummyLimeKateOnlyEmptyAgain() throws Exception { reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); reconcileUser(userBefore.getOid(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2193,11 +2193,11 @@ public void test410ReconcileDummyLimeKatePassword() throws Exception { reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); reconcileUser(userBefore.getOid(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = findUserByUsername(ACCOUNT_CAPSIZE_NAME); @@ -2237,15 +2237,15 @@ public void test420ReconcileDummyLimeDeleteLinkedAccount() throws Exception { reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); restartTask(TASK_RECONCILE_DUMMY_LIME_OID); // THEN - then(TEST_NAME); + then(); waitForTaskFinish(TASK_RECONCILE_DUMMY_LIME_OID, false); - then(TEST_NAME); + then(); List> users = modelService.searchObjects(UserType.class, null, null, task, result); display("Users after reconcile", users); @@ -2294,11 +2294,11 @@ public void test500ImportTAugustusFromResourceDummy() throws Exception { rememberCounter(InternalCounters.SHADOW_FETCH_OPERATION_COUNT); // WHEN - when(TEST_NAME); + when(); modelService.importFromResource(ACCOUNT_TAUGUSTUS_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); loginAdministrator(); @@ -2363,11 +2363,11 @@ public void test502ImportAugustusFromResourceDummy() throws Exception { rememberCounter(InternalCounters.SHADOW_FETCH_OPERATION_COUNT); // WHEN - when(TEST_NAME); + when(); modelService.importFromResource(ACCOUNT_AUGUSTUS_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); loginAdministrator(); @@ -2449,11 +2449,11 @@ public void test510ImportFromResourceDummy() throws Exception { rememberCounter(InternalCounters.SHADOW_FETCH_OPERATION_COUNT); // WHEN - when(TEST_NAME); + when(); modelService.importFromResource(RESOURCE_DUMMY_OID, new QName(RESOURCE_DUMMY_NAMESPACE, "AccountObjectClass"), task, result); // THEN - then(TEST_NAME); + then(); OperationResult subresult = result.getLastSubresult(); TestUtil.assertInProgress("importAccountsFromResource result", subresult); @@ -2462,7 +2462,7 @@ public void test510ImportFromResourceDummy() throws Exception { waitForTaskFinish(task, true, 40000); // THEN - then(TEST_NAME); + then(); TestUtil.assertSuccess(task.getResult()); // First fetch: search in import handler @@ -2521,7 +2521,7 @@ public void test520ReconResourceDummyFilter() throws Exception { rememberCounter(InternalCounters.SHADOW_FETCH_OPERATION_COUNT); // WHEN - when(TEST_NAME); + when(); // runPrivileged is necessary for TestImportReconAuthorizations as importObjectFromFile() is using raw operations runPrivileged(() -> { try { @@ -2552,11 +2552,11 @@ public void test600SearchAllDummyAccounts() throws Exception { new QName(RESOURCE_DUMMY_NAMESPACE, "AccountObjectClass"), prismContext); // WHEN - when(TEST_NAME); + when(); SearchResultList> objects = modelService.searchObjects(ShadowType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2581,11 +2581,11 @@ public void test610SearchDummyAccountsNameSubstring() throws Exception { .build(); // WHEN - when(TEST_NAME); + when(); SearchResultList> objects = modelService.searchObjects(ShadowType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2608,16 +2608,16 @@ public void test900DeleteDummyShadows() throws Exception { rememberCounter(InternalCounters.SHADOW_FETCH_OPERATION_COUNT); // WHEN - when(TEST_NAME); + when(); importObjectFromFile(TASK_DELETE_DUMMY_SHADOWS_FILE); // THEN - then(TEST_NAME); + then(); waitForTaskFinish(TASK_DELETE_DUMMY_SHADOWS_OID, true, 20000); // THEN - then(TEST_NAME); + then(); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 0); PrismObject deleteTask = getTask(TASK_DELETE_DUMMY_SHADOWS_OID); @@ -2653,16 +2653,16 @@ public void test910DeleteDummyAccounts() throws Exception { rememberCounter(InternalCounters.SHADOW_FETCH_OPERATION_COUNT); // WHEN - when(TEST_NAME); + when(); importObjectFromFile(TASK_DELETE_DUMMY_ACCOUNTS_FILE); // THEN - then(TEST_NAME); + then(); waitForTaskFinish(TASK_DELETE_DUMMY_ACCOUNTS_OID, true, 20000); // THEN - then(TEST_NAME); + then(); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 2); PrismObject deleteTask = getTask(TASK_DELETE_DUMMY_ACCOUNTS_OID); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestInboundLiveSyncTask.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestInboundLiveSyncTask.java index 86a4e3d1cbf..43f832182c5 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestInboundLiveSyncTask.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestInboundLiveSyncTask.java @@ -72,14 +72,14 @@ public void test199DeleteDummyEmeraldAccountMancomb() throws Exception { assertUsers(7); /// WHEN - when(TEST_NAME); + when(); dummyResourceEmerald.deleteAccountByName(ACCOUNT_MANCOMB_DUMMY_USERNAME); waitForSyncTaskNextRun(resourceDummyEmerald); // THEN - then(TEST_NAME); + then(); PrismObject accountMancomb = findAccountByUsername(ACCOUNT_MANCOMB_DUMMY_USERNAME, resourceDummyEmerald); display("Account mancomb", accountMancomb); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestInboundReconTask.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestInboundReconTask.java index 50ec734dc3d..6526d66f8b4 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestInboundReconTask.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestInboundReconTask.java @@ -78,12 +78,12 @@ public void test180NoChange() throws Exception { assertUsers(7); /// WHEN - when(TEST_NAME); + when(); waitForSyncTaskNextRun(resourceDummyEmerald); // THEN - then(TEST_NAME); + then(); PrismObject accountMancomb = findAccountByUsername(ACCOUNT_MANCOMB_DUMMY_USERNAME, resourceDummyEmerald); display("Account mancomb", accountMancomb); @@ -120,14 +120,14 @@ public void test199DeleteDummyEmeraldAccountMancomb() throws Exception { assertUsers(7); /// WHEN - when(TEST_NAME); + when(); dummyResourceEmerald.deleteAccountByName(ACCOUNT_MANCOMB_DUMMY_USERNAME); waitForSyncTaskNextRun(resourceDummyEmerald); // THEN - then(TEST_NAME); + then(); PrismObject accountMancomb = findAccountByUsername(ACCOUNT_MANCOMB_DUMMY_USERNAME, resourceDummyEmerald); display("Account mancomb", accountMancomb); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestLiveSyncTask.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestLiveSyncTask.java index 980e8f3ca5f..0420f24253a 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestLiveSyncTask.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestLiveSyncTask.java @@ -100,7 +100,7 @@ public void test999DeletingNotUpdatedShadowDummyGreen() throws Exception { accountJack.addAttributeValues(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_LOCATION_NAME, "The Seven Seas"); /// WHEN - when(TEST_NAME); + when(); getDummyResource(RESOURCE_DUMMY_GREEN_NAME).addAccount(accountJack); waitForSyncTaskNextRunAssertSuccess(getDummyResourceObject(RESOURCE_DUMMY_GREEN_NAME)); @@ -112,7 +112,7 @@ public void test999DeletingNotUpdatedShadowDummyGreen() throws Exception { rerunTask(TASK_DELETE_NOT_UPDATED_SHADOWS_OID); // THEN - then(TEST_NAME); + then(); PrismObject userCarol = findUserByUsername(ACCOUNT_CAROL_DUMMY_USERNAME); display("User carol", userCarol); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestLiveSyncTaskMechanics.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestLiveSyncTaskMechanics.java index f9c947c72e5..9bcbaa572e3 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestLiveSyncTaskMechanics.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestLiveSyncTaskMechanics.java @@ -158,13 +158,13 @@ public void test100SuspendWhileIcfSync() throws Exception { interruptedSyncResource.getDummyResource().setOperationDelayOffset(2000); // WHEN - when(TEST_NAME); + when(); waitForTaskNextStart(TASK_SLOW_RESOURCE_OID, false, 2000, true); // starts the task boolean suspended = suspendTask(TASK_SLOW_RESOURCE_OID, 10000); // THEN - then(TEST_NAME); + then(); assertTrue("Task was not suspended", suspended); Task taskAfter = taskManager.getTaskWithResult(TASK_SLOW_RESOURCE_OID, result); @@ -189,13 +189,13 @@ public void test105SuspendWhileIcfSyncImprecise() throws Exception { interruptedSyncImpreciseResource.getDummyResource().setOperationDelayOffset(500); // WHEN - when(TEST_NAME); + when(); waitForTaskNextStart(TASK_SLOW_RESOURCE_IMPRECISE_OID, false, 2000, true); // starts the task boolean suspended = suspendTask(TASK_SLOW_RESOURCE_IMPRECISE_OID, 5000); // THEN - then(TEST_NAME); + then(); assertTrue("Task was not suspended", suspended); Task taskAfter = taskManager.getTaskWithResult(TASK_SLOW_RESOURCE_IMPRECISE_OID, result); @@ -228,14 +228,14 @@ public void test110SuspendWhileProcessing() throws Exception { DummyInterruptedSyncResource.delay = 100; // WHEN - when(TEST_NAME); + when(); waitForTaskNextStart(TASK_SLOW_MODEL_OID, false, 2000, true); // starts the task Thread.sleep(4000); boolean suspended = suspendTask(TASK_SLOW_MODEL_OID, 5000); // THEN - then(TEST_NAME); + then(); assertTrue("Task was not suspended", suspended); Task taskAfter = taskManager.getTaskWithResult(TASK_SLOW_MODEL_OID, result); @@ -284,14 +284,14 @@ public void test115SuspendWhileProcessingImprecise() throws Exception { DummyInterruptedSyncImpreciseResource.delay = 100; // WHEN - when(TEST_NAME); + when(); waitForTaskNextStart(TASK_SLOW_MODEL_IMPRECISE_OID, false, 2000, true); // starts the task Thread.sleep(4000); boolean suspended = suspendTask(TASK_SLOW_MODEL_IMPRECISE_OID, 5000); // THEN - then(TEST_NAME); + then(); assertTrue("Task was not suspended", suspended); Task taskAfter = taskManager.getTaskWithResult(TASK_SLOW_MODEL_IMPRECISE_OID, result); @@ -329,12 +329,12 @@ public void test120Batched() throws Exception { DummyInterruptedSyncResource.errorOn = getUserName(24, true); // WHEN - when(TEST_NAME); + when(); waitForTaskNextRun(TASK_BATCHED_OID, false, 10000, true); // THEN - then(TEST_NAME); + then(); Task taskAfter = taskManager.getTaskWithResult(TASK_BATCHED_OID, result); displayTaskWithOperationStats("Task after", taskAfter); @@ -344,12 +344,12 @@ public void test120Batched() throws Exception { assertObjects(UserType.class, query, 10); // WHEN - when(TEST_NAME); + when(); waitForTaskNextRun(TASK_BATCHED_OID, false, 10000, true); // THEN - then(TEST_NAME); + then(); taskAfter = taskManager.getTaskWithResult(TASK_BATCHED_OID, result); displayTaskWithOperationStats("Task after", taskAfter); @@ -359,12 +359,12 @@ public void test120Batched() throws Exception { assertObjects(UserType.class, query, 20); // WHEN 3 (with error) - when(TEST_NAME); + when(); waitForTaskNextRun(TASK_BATCHED_OID, false, 10000, true); // THEN 3 (with error) - then(TEST_NAME); + then(); taskAfter = taskManager.getTaskWithResult(TASK_BATCHED_OID, result); displayTaskWithOperationStats("Task after", taskAfter); @@ -396,7 +396,7 @@ public void test125BatchedImprecise() throws Exception { DummyInterruptedSyncImpreciseResource.delay = 0; // WHEN - when(TEST_NAME); + when(); try { waitForTaskNextRun(TASK_BATCHED_IMPRECISE_OID, false, 10000, true); @@ -406,7 +406,7 @@ public void test125BatchedImprecise() throws Exception { } // THEN - then(TEST_NAME); + then(); Task taskAfter = taskManager.getTaskWithResult(TASK_BATCHED_IMPRECISE_OID, result); displayTaskWithOperationStats("Task after", taskAfter); @@ -444,12 +444,12 @@ public void test130Error() throws Exception { DummyInterruptedSyncResource.errorOn = getUserName(ERROR_ON, true); // WHEN - when(TEST_NAME); + when(); waitForTaskNextRun(TASK_ERROR_OID, false, 10000, true); // THEN - then(TEST_NAME); + then(); Task taskAfter = taskManager.getTaskWithResult(TASK_ERROR_OID, result); displayTaskWithOperationStats("Task after", taskAfter); @@ -466,12 +466,12 @@ public void test130Error() throws Exception { // Another run - should fail the same // WHEN - when(TEST_NAME); + when(); waitForTaskNextRun(TASK_ERROR_OID, false, 10000, true); // THEN - then(TEST_NAME); + then(); taskAfter = taskManager.getTaskWithResult(TASK_ERROR_OID, result); displayTaskWithOperationStats("Task after", taskAfter); @@ -505,7 +505,7 @@ public void test135ErrorImprecise() throws Exception { DummyInterruptedSyncImpreciseResource.errorOn = getUserName(ERROR_ON, false); // WHEN - when(TEST_NAME); + when(); try { waitForTaskNextRun(TASK_ERROR_IMPRECISE_OID, false, 10000, true); @@ -515,7 +515,7 @@ public void test135ErrorImprecise() throws Exception { } // THEN - then(TEST_NAME); + then(); Task taskAfter = taskManager.getTaskWithResult(TASK_ERROR_IMPRECISE_OID, result); displayTaskWithOperationStats("Task after", taskAfter); @@ -534,12 +534,12 @@ public void test135ErrorImprecise() throws Exception { // Another run - should fail the same // WHEN - when(TEST_NAME); + when(); waitForTaskNextRun(TASK_ERROR_IMPRECISE_OID, false, 10000, true); // THEN - then(TEST_NAME); + then(); taskAfter = taskManager.getTaskWithResult(TASK_ERROR_IMPRECISE_OID, result); displayTaskWithOperationStats("Task after", taskAfter); @@ -572,12 +572,12 @@ public void test140DryRun() throws Exception { DummyInterruptedSyncResource.errorOn = null; // WHEN - when(TEST_NAME); + when(); waitForTaskNextRun(TASK_DRY_RUN.oid, false, 10000, true); // THEN - then(TEST_NAME); + then(); Task taskAfter = taskManager.getTaskWithResult(TASK_DRY_RUN.oid, result); displayTaskWithOperationStats("Task after", taskAfter); @@ -611,12 +611,12 @@ public void test150DryRunWithUpdate() throws Exception { DummyInterruptedSyncResource.errorOn = null; // WHEN - when(TEST_NAME); + when(); waitForTaskNextRun(TASK_DRY_RUN_WITH_UPDATE.oid, false, 10000, true); // THEN - then(TEST_NAME); + then(); Task taskAfter = taskManager.getTaskWithResult(TASK_DRY_RUN_WITH_UPDATE.oid, result); displayTaskWithOperationStats("Task after", taskAfter); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestParallelDiscovery.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestParallelDiscovery.java index c03a5a0006a..12889136655 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestParallelDiscovery.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestParallelDiscovery.java @@ -255,11 +255,11 @@ public void test100Synchronize() throws Exception { rememberCounter(InternalCounters.SHADOW_FETCH_OPERATION_COUNT); // WHEN - when(TEST_NAME); + when(); addObject(getSyncTaskFile(), task, result); // THEN - then(TEST_NAME); + then(); if (DISTRIBUTION == Distribution.MULTITHREADED) { waitForTaskFinish(getSyncTaskOid(), true, 600000); @@ -268,7 +268,7 @@ public void test100Synchronize() throws Exception { } // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestParallelSynchronization.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestParallelSynchronization.java index 351c8e4f790..c17274ea029 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestParallelSynchronization.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestParallelSynchronization.java @@ -214,11 +214,11 @@ public void test100Synchronize() throws Exception { rememberCounter(InternalCounters.SHADOW_FETCH_OPERATION_COUNT); // WHEN - when(TEST_NAME); + when(); addObject(getSyncTaskFile(), task, result); // THEN - then(TEST_NAME); + then(); if (DISTRIBUTION == Distribution.MULTITHREADED) { waitForTaskFinish(getSyncTaskOid(), true, 600000); @@ -227,7 +227,7 @@ public void test100Synchronize() throws Exception { } // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestUuid.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestUuid.java index adcd85eea7b..9a937271afa 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestUuid.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestUuid.java @@ -136,16 +136,16 @@ public void test200ReconcileDummyUuid() throws Exception { reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); importObjectFromFile(TASK_RECONCILE_DUMMY_UUID_FILE); // THEN - then(TEST_NAME); + then(); waitForTaskFinish(TASK_RECONCILE_DUMMY_UUID_OID, false); // THEN - then(TEST_NAME); + then(); reconciliationTaskResultListener.assertResult(RESOURCE_DUMMY_UUID_OID, 0, 0, 0, 0); List> users = modelService.searchObjects(UserType.class, null, null, task, result); @@ -191,16 +191,16 @@ public void test210ReconcileDummyUuidAddAugustus() throws Exception { Task taskBefore = taskManager.getTask(TASK_RECONCILE_DUMMY_UUID_OID, result); // WHEN - when(TEST_NAME); + when(); restartTask(TASK_RECONCILE_DUMMY_UUID_OID); // THEN - then(TEST_NAME); + then(); waitForTaskNextRunAssertSuccess(taskBefore, true); // THEN - then(TEST_NAME); + then(); reconciliationTaskResultListener.assertResult(RESOURCE_DUMMY_UUID_OID, 0, 1, 0, 0); List> users = modelService.searchObjects(UserType.class, null, null, task, result); @@ -272,16 +272,16 @@ public void test220ReconcileDummyUuidDeleteAddAugustus() throws Exception { reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); restartTask(TASK_RECONCILE_DUMMY_UUID_OID); // THEN - then(TEST_NAME); + then(); waitForTaskNextRunAssertSuccess(taskBefore, true); // THEN - then(TEST_NAME); + then(); reconciliationTaskResultListener.assertResult(RESOURCE_DUMMY_UUID_OID, 0, 1, 0, 1); List> users = modelService.searchObjects(UserType.class, null, null, task, result); @@ -360,16 +360,16 @@ public void test230ReconcileDummyUuidDeleteAugustusAddAugustina() throws Excepti reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); restartTask(TASK_RECONCILE_DUMMY_UUID_OID); // THEN - then(TEST_NAME); + then(); waitForTaskNextRunAssertSuccess(taskBefore, true); // THEN - then(TEST_NAME); + then(); reconciliationTaskResultListener.assertResult(RESOURCE_DUMMY_UUID_OID, 0, 1, 0, 2); List> users = modelService.searchObjects(UserType.class, null, null, task, result); diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestValidityRecomputeTask.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestValidityRecomputeTask.java index bc2145bfb3d..2a56e031ceb 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestValidityRecomputeTask.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/sync/TestValidityRecomputeTask.java @@ -1449,12 +1449,12 @@ public void test205AccountRedElaineDisable() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyAccountShadowReplace(ACCOUNT_SHADOW_ELAINE_DUMMY_RED_OID, ACTIVATION_ADMINISTRATIVE_STATUS_PATH, task, result, ActivationStatusType.DISABLED); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject accountShadow = getShadowModel(ACCOUNT_SHADOW_ELAINE_DUMMY_RED_OID); diff --git a/model/report-impl/src/test/java/com/evolveum/midpoint/report/TestReport.java b/model/report-impl/src/test/java/com/evolveum/midpoint/report/TestReport.java index 88256a649f0..378e5ba532f 100644 --- a/model/report-impl/src/test/java/com/evolveum/midpoint/report/TestReport.java +++ b/model/report-impl/src/test/java/com/evolveum/midpoint/report/TestReport.java @@ -75,7 +75,7 @@ public void test100ReportUserList() throws Exception { PrismObject report = getObject(ReportType.class, REPORT_USER_LIST_OID); // WHEN - when(TEST_NAME); + when(); reportManager.runReport(report, null, task, result); assertInProgress(result); @@ -85,7 +85,7 @@ public void test100ReportUserList() throws Exception { waitForTaskFinish(task.getOid(), true); // THEN - then(TEST_NAME); + then(); PrismObject finishedTask = getTask(task.getOid()); display("Background task", finishedTask); @@ -139,7 +139,7 @@ public void test200ReportUserListScript() throws Exception { PrismObject report = getObject(ReportType.class, REPORT_USER_LIST_SCRIPT_OID); // WHEN - when(TEST_NAME); + when(); reportManager.runReport(report, null, task, result); assertInProgress(result); @@ -149,7 +149,7 @@ public void test200ReportUserListScript() throws Exception { waitForTaskFinish(task.getOid(), true); // THEN - then(TEST_NAME); + then(); PrismObject finishedTask = getTask(task.getOid()); display("Background task", finishedTask); @@ -200,7 +200,7 @@ protected PrismObject runReport(final String TEST_NAME, PrismObject runReport(final String TEST_NAME, PrismObject finishedTask = getTask(task.getOid()); display("Background task (finished)", finishedTask); diff --git a/model/report-impl/src/test/java/com/evolveum/midpoint/report/TestReportWebService.java b/model/report-impl/src/test/java/com/evolveum/midpoint/report/TestReportWebService.java index 2ea0f78ad26..0b22a72d490 100644 --- a/model/report-impl/src/test/java/com/evolveum/midpoint/report/TestReportWebService.java +++ b/model/report-impl/src/test/java/com/evolveum/midpoint/report/TestReportWebService.java @@ -74,11 +74,11 @@ public void test100ProcessReportUserList() throws Exception { RemoteReportParametersType parameters = createReportParameters(); // WHEN - when(TEST_NAME); + when(); ObjectListType userList = reportWebService.processReport(REPORT_USER_LIST_EXPRESSIONS_CSV_OID, query, parameters, null); // THEN - then(TEST_NAME); + then(); display("Returned user list ("+userList.getObject().size()+" objects)", userList); assertUserList(userList); @@ -94,14 +94,14 @@ public void test110ProcessReportUserListNoReportOid() throws Exception { try { // WHEN - when(TEST_NAME); + when(); reportWebService.processReport(null, query, parameters, null); assertNotReached(); } catch (Fault f) { // THEN - then(TEST_NAME); + then(); display("Expected fault", f); } } @@ -116,14 +116,14 @@ public void test112ProcessReportUserListInvalidReportOid() throws Exception { try { // WHEN - when(TEST_NAME); + when(); reportWebService.processReport("l00n3y", query, parameters, null); assertNotReached(); } catch (Fault f) { // THEN - then(TEST_NAME); + then(); display("Expected fault", f); } } @@ -143,14 +143,14 @@ public void test115ProcessReportUserListUnauthorizedReader() throws Exception { try { // WHEN - when(TEST_NAME); + when(); reportWebService.processReport(REPORT_USER_LIST_EXPRESSIONS_CSV_OID, query, parameters, null); assertNotReached(); } catch (Fault f) { // THEN - then(TEST_NAME); + then(); display("Expected fault", f); } finally { login(USER_ADMINISTRATOR_USERNAME); @@ -172,14 +172,14 @@ public void test116ProcessReportUserListUnauthorizedRunner() throws Exception { try { // WHEN - when(TEST_NAME); + when(); reportWebService.processReport(REPORT_USER_LIST_EXPRESSIONS_CSV_OID, query, parameters, null); assertNotReached(); } catch (Fault f) { // THEN - then(TEST_NAME); + then(); display("Expected fault", f); } finally { login(USER_ADMINISTRATOR_USERNAME); @@ -202,7 +202,7 @@ public void test119ProcessReportUserListReaderRunner() throws Exception { try { // WHEN - when(TEST_NAME); + when(); userList = reportWebService.processReport(REPORT_USER_LIST_EXPRESSIONS_CSV_OID, query, parameters, null); } finally { @@ -210,7 +210,7 @@ public void test119ProcessReportUserListReaderRunner() throws Exception { } // THEN - then(TEST_NAME); + then(); display("Returned user list ("+userList.getObject().size()+" objects)", userList); assertUserList(userList); diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/TestConnectorDiscovery.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/TestConnectorDiscovery.java index 2ca3777235c..4879e39b057 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/TestConnectorDiscovery.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/TestConnectorDiscovery.java @@ -52,11 +52,11 @@ public void test001Connectors() throws Exception { OperationResult result = new OperationResult(TestConnectorDiscovery.class.getName() + "." + TEST_NAME); // WHEN - when(TEST_NAME); + when(); List> connectors = repositoryService.searchObjects(ConnectorType.class, null, null, result); // THEN - then(TEST_NAME); + then(); assertFalse("No connector found", connectors.isEmpty()); display("Found " + connectors.size() + " discovered connector"); diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/TestConnectorManager.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/TestConnectorManager.java index 1ecc9f9b1c9..c75e77340c4 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/TestConnectorManager.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/TestConnectorManager.java @@ -51,11 +51,11 @@ public void test100ListConnectorFactories() throws Exception { OperationResult result = new OperationResult(TestConnectorDiscovery.class.getName() + "." + TEST_NAME); // WHEN - when(TEST_NAME); + when(); Collection connectorFactories = connectorManager.getConnectorFactories(); // THEN - then(TEST_NAME); + then(); assertNotNull("Null connector factories", connectorFactories); assertFalse("No connector factories found", connectorFactories.isEmpty()); display("Found "+connectorFactories.size()+" connector factories"); @@ -81,11 +81,11 @@ public void test110SelfTest() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); connectorManager.connectorFrameworkSelfTest(result, task); // THEN - then(TEST_NAME); + then(); assertSuccess(result); } diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/csv/TestCsvBroken.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/csv/TestCsvBroken.java index 13d3911a558..d0028ce10d6 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/csv/TestCsvBroken.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/csv/TestCsvBroken.java @@ -75,11 +75,8 @@ public void initSystem(Task initTask, OperationResult initResult) throws Excepti */ @Test public void test100Connection() throws Exception { - final String TEST_NAME = "test100Connection"; - TestUtil.displayTestTitle(TEST_NAME); - - // GIVEN - Task task = createTask(TEST_NAME); + given(); + Task task = getTestTask(); OperationResult result = task.getResult(); // WHEN @@ -121,11 +118,8 @@ public void test100Connection() throws Exception { */ @Test public void test110FixResourceAndTestConnection() throws Exception { - final String TEST_NAME = "test110FixResourceAndTestConnection"; - TestUtil.displayTestTitle(TEST_NAME); - - // GIVEN - Task task = createTask(TEST_NAME); + given(); + Task task = getTestTask(); OperationResult result = task.getResult(); setCsvFile(RESOURCE_CSV_BROKEN.oid, CSV_FILE_OK.getPath(), result); @@ -175,11 +169,8 @@ public void test110FixResourceAndTestConnection() throws Exception { */ @Test public void test120BreakResourceAndTestConnection() throws Exception { - final String TEST_NAME = "test120BreakResourceAndTestConnection"; - TestUtil.displayTestTitle(TEST_NAME); - // GIVEN - Task task = createTask(TEST_NAME); + Task task = getTestTask(); OperationResult result = task.getResult(); setCsvFile(RESOURCE_CSV_BROKEN.oid, CSV_FILE_NON_EXISTING.getPath(), result); @@ -217,11 +208,8 @@ public void test120BreakResourceAndTestConnection() throws Exception { */ @Test public void test130FixResourceAndSearchObjects() throws Exception { - final String TEST_NAME = "test130FixResourceAndSearchObjects"; - TestUtil.displayTestTitle(TEST_NAME); - - // GIVEN - Task task = createTask(TEST_NAME); + given(); + Task task = getTestTask(); OperationResult result = task.getResult(); setCsvFile(RESOURCE_CSV_BROKEN.oid, CSV_FILE_OK.getPath(), result); @@ -283,14 +271,10 @@ public void test130FixResourceAndSearchObjects() throws Exception { */ @Test public void test140TwoMoreStatusChanges() throws Exception { - final String TEST_NAME = "test140TwoMoreStatusChanges"; - TestUtil.displayTestTitle(TEST_NAME); - - // GIVEN - Task task = createTask(TEST_NAME); + given(); + Task task = getTestTask(); OperationResult result = task.getResult(); - // WHEN long before = System.currentTimeMillis(); setCsvFile(RESOURCE_CSV_BROKEN.oid, CSV_FILE_NON_EXISTING.getPath(), result); diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/AbstractBasicDummyTest.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/AbstractBasicDummyTest.java index b07a124a9c7..7757f9fff87 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/AbstractBasicDummyTest.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/AbstractBasicDummyTest.java @@ -5,34 +5,21 @@ * and European Union Public License. See LICENSE file for details. */ -/* - * - */ package com.evolveum.midpoint.provisioning.impl.dummy; -import static com.evolveum.midpoint.test.IntegrationTestTools.assertProvisioningAccountShadow; -import static com.evolveum.midpoint.test.asserter.predicate.TimeAssertionPredicates.approximatelyCurrent; +import static org.testng.AssertJUnit.*; +import static com.evolveum.midpoint.test.IntegrationTestTools.assertProvisioningAccountShadow; import static com.evolveum.midpoint.test.asserter.predicate.StringAssertionPredicates.startsWith; - -import static org.testng.AssertJUnit.assertEquals; -import static org.testng.AssertJUnit.assertFalse; -import static org.testng.AssertJUnit.assertNotNull; -import static org.testng.AssertJUnit.assertNull; -import static org.testng.AssertJUnit.assertTrue; +import static com.evolveum.midpoint.test.asserter.predicate.TimeAssertionPredicates.approximatelyCurrent; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Set; - import javax.xml.datatype.XMLGregorianCalendar; import javax.xml.namespace.QName; -import com.evolveum.midpoint.prism.path.ItemName; -import com.evolveum.midpoint.prism.path.ItemPath; -import com.evolveum.midpoint.xml.ns._public.common.common_3.*; - import org.apache.commons.lang.StringUtils; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ContextConfiguration; @@ -47,33 +34,22 @@ import com.evolveum.midpoint.common.refinery.RefinedObjectClassDefinition; import com.evolveum.midpoint.common.refinery.RefinedResourceSchema; import com.evolveum.midpoint.common.refinery.RefinedResourceSchemaImpl; -import com.evolveum.midpoint.prism.Containerable; -import com.evolveum.midpoint.prism.Definition; -import com.evolveum.midpoint.prism.PrismContainer; -import com.evolveum.midpoint.prism.PrismContainerDefinition; -import com.evolveum.midpoint.prism.PrismContext; -import com.evolveum.midpoint.prism.PrismObject; -import com.evolveum.midpoint.prism.PrismProperty; -import com.evolveum.midpoint.prism.PrismPropertyDefinition; +import com.evolveum.midpoint.prism.*; import com.evolveum.midpoint.prism.crypto.EncryptionException; import com.evolveum.midpoint.prism.delta.DiffUtil; import com.evolveum.midpoint.prism.delta.ObjectDelta; +import com.evolveum.midpoint.prism.impl.schema.PrismSchemaImpl; import com.evolveum.midpoint.prism.match.MatchingRule; +import com.evolveum.midpoint.prism.path.ItemName; +import com.evolveum.midpoint.prism.path.ItemPath; import com.evolveum.midpoint.prism.schema.PrismSchema; -import com.evolveum.midpoint.prism.impl.schema.PrismSchemaImpl; import com.evolveum.midpoint.prism.util.PrismAsserts; import com.evolveum.midpoint.prism.util.PrismTestUtil; import com.evolveum.midpoint.provisioning.impl.ProvisioningContext; -import com.evolveum.midpoint.provisioning.impl.opendj.TestOpenDj; import com.evolveum.midpoint.provisioning.ucf.api.AttributesToReturn; import com.evolveum.midpoint.provisioning.ucf.api.ConnectorInstance; import com.evolveum.midpoint.provisioning.util.ProvisioningUtil; -import com.evolveum.midpoint.schema.CapabilityUtil; -import com.evolveum.midpoint.schema.DeltaConvertor; -import com.evolveum.midpoint.schema.GetOperationOptions; -import com.evolveum.midpoint.schema.ResourceShadowDiscriminator; -import com.evolveum.midpoint.schema.SearchResultList; -import com.evolveum.midpoint.schema.SelectorOptions; +import com.evolveum.midpoint.schema.*; import com.evolveum.midpoint.schema.constants.ConnectorTestOperation; import com.evolveum.midpoint.schema.constants.SchemaConstants; import com.evolveum.midpoint.schema.internals.InternalCounters; @@ -84,31 +60,16 @@ import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.result.OperationResultStatus; import com.evolveum.midpoint.schema.statistics.ConnectorOperationalStatus; -import com.evolveum.midpoint.schema.util.ConnectorTypeUtil; -import com.evolveum.midpoint.schema.util.ObjectTypeUtil; -import com.evolveum.midpoint.schema.util.ResourceTypeUtil; -import com.evolveum.midpoint.schema.util.SchemaTestConstants; -import com.evolveum.midpoint.schema.util.ShadowUtil; +import com.evolveum.midpoint.schema.util.*; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.test.DummyResourceContoller; import com.evolveum.midpoint.test.IntegrationTestTools; import com.evolveum.midpoint.test.ObjectChecker; import com.evolveum.midpoint.test.util.TestUtil; import com.evolveum.midpoint.util.exception.SchemaException; -import com.evolveum.midpoint.util.logging.Trace; -import com.evolveum.midpoint.util.logging.TraceManager; import com.evolveum.midpoint.xml.ns._public.common.api_types_3.ObjectModificationType; -import com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ActivationCapabilityType; -import com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.AddRemoveAttributeValuesCapabilityType; -import com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.CountObjectsCapabilityType; -import com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.CountObjectsSimulateType; -import com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.CredentialsCapabilityType; -import com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.PasswordCapabilityType; -import com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ReadCapabilityType; -import com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.RunAsCapabilityType; -import com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ScriptCapabilityType; -import com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.TestConnectionCapabilityType; -import com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.UpdateCapabilityType; +import com.evolveum.midpoint.xml.ns._public.common.common_3.*; +import com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.*; import com.evolveum.prism.xml.ns._public.types_3.ProtectedStringType; /** @@ -122,8 +83,6 @@ @Listeners({ com.evolveum.midpoint.tools.testng.AlphabeticalMethodInterceptor.class }) public class AbstractBasicDummyTest extends AbstractDummyTest { - private static final Trace LOGGER = TraceManager.getTrace(AbstractBasicDummyTest.class); - protected CachingMetadataType capabilitiesCachingMetadataType; protected String willIcfUid; protected XMLGregorianCalendar lastPasswordModifyStart; @@ -146,21 +105,18 @@ protected int getExpectedRefinedSchemaDefinitions() { } @AfterClass - public static void assertCleanShutdown() throws Exception { + public static void assertCleanShutdown() { dummyResource.assertNoConnections(); } @Test public void test000Integrity() throws Exception { - final String TEST_NAME = "test000Integrity"; - display("Dummy resource instance", dummyResource.toString()); assertNotNull("Resource is null", resource); assertNotNull("ResourceType is null", resourceType); - OperationResult result = new OperationResult(AbstractBasicDummyTest.class.getName() - + "." + TEST_NAME); + OperationResult result = createResult(); ResourceType resource = repositoryService.getObject(ResourceType.class, RESOURCE_DUMMY_OID, null, result) .asObjectable(); @@ -183,9 +139,8 @@ public void test000Integrity() throws Exception { */ @Test public void test010ListConnectors() throws Exception { - final String TEST_NAME = "test010ListConnectors"; // GIVEN - OperationResult result = new OperationResult(AbstractBasicDummyTest.class.getName() + "." + TEST_NAME); + OperationResult result = createResult(); // WHEN List> connectors = repositoryService.searchObjects(ConnectorType.class, @@ -220,8 +175,7 @@ public void test010ListConnectors() throws Exception { PrismContainerDefinition definition = schema.findItemDefinition(ResourceType.F_CONNECTOR_CONFIGURATION.getLocalPart(), PrismContainerDefinition.class); assertNotNull("Definition of property container not found", definition); - PrismContainerDefinition pcd = (PrismContainerDefinition) definition; - assertFalse("Empty definition", pcd.isEmpty()); + assertFalse("Empty definition", definition.isEmpty()); } } @@ -231,14 +185,13 @@ public void test010ListConnectors() throws Exception { */ @Test public void test012ConnectorRediscovery() { - final String TEST_NAME = "test012ConnectorRediscovery"; - // GIVEN - OperationResult result = new OperationResult(AbstractBasicDummyTest.class.getName() + "." + TEST_NAME); + given(); + OperationResult result = createResult(); - // WHEN + when(); Set discoverLocalConnectors = connectorManager.discoverLocalConnectors(result); - // THEN + then(); assertSuccess("discoverLocalConnectors failed", result); assertTrue("Rediscovered something", discoverLocalConnectors.isEmpty()); } @@ -249,9 +202,8 @@ public void test012ConnectorRediscovery() { */ @Test public void test015ListResourcesNoFetch() throws Exception { - final String TEST_NAME = "test015ListResourcesNoFetch"; // GIVEN - Task task = taskManager.createTaskInstance(AbstractBasicDummyTest.class.getName() + "." + TEST_NAME); + Task task = createPlainTask(); OperationResult result = task.getResult(); Collection> options = SelectorOptions.createCollection(GetOperationOptions.createNoFetch()); @@ -271,7 +223,7 @@ public void test015ListResourcesNoFetch() throws Exception { XmlSchemaType xmlSchemaType = resourceType.getSchema(); if (xmlSchemaType != null) { Element xsdSchemaElement = ResourceTypeUtil.getResourceXsdSchema(resourceType); - assertNull("Found schema in "+resource, xsdSchemaElement); + assertNull("Found schema in " + resource, xsdSchemaElement); } } @@ -285,15 +237,14 @@ public void test015ListResourcesNoFetch() throws Exception { /** * This should be the very first test that works with the resource. - * + *

* The original repository object does not have resource schema. The schema * should be generated from the resource on the first use. This is the test * that executes testResource and checks whether the schema was generated. */ @Test public void test020Connection() throws Exception { - final String TEST_NAME = "test020Connection"; - // GIVEN + given(); Task task = getTestTask(); OperationResult result = task.getResult(); @@ -345,19 +296,19 @@ public void test020Connection() throws Exception { assertResource(resourceRepoAfter, "Resource after test") .display() .operationalState() - .assertAny() - .assertPropertyEquals(OperationalStateType.F_LAST_AVAILABILITY_STATUS, AvailabilityStatusType.UP) - .assertPropertyEquals(OperationalStateType.F_NODE_ID, localNodeId) - .assertPropertyValueSatisfies(OperationalStateType.F_TIMESTAMP, approximatelyCurrent(60000)) - .assertPropertyValueSatisfies(OperationalStateType.F_MESSAGE, startsWith("Status set to UP")) - .end() + .assertAny() + .assertPropertyEquals(OperationalStateType.F_LAST_AVAILABILITY_STATUS, AvailabilityStatusType.UP) + .assertPropertyEquals(OperationalStateType.F_NODE_ID, localNodeId) + .assertPropertyValueSatisfies(OperationalStateType.F_TIMESTAMP, approximatelyCurrent(60000)) + .assertPropertyValueSatisfies(OperationalStateType.F_MESSAGE, startsWith("Status set to UP")) + .end() .operationalStateHistory() - .assertSize(1) - .value(0) - .assertPropertyEquals(OperationalStateType.F_LAST_AVAILABILITY_STATUS, AvailabilityStatusType.UP) - .assertPropertyEquals(OperationalStateType.F_NODE_ID, localNodeId) - .assertPropertyValueSatisfies(OperationalStateType.F_TIMESTAMP, approximatelyCurrent(60000)) - .assertPropertyValueSatisfies(OperationalStateType.F_MESSAGE, startsWith("Status set to UP")); + .assertSize(1) + .value(0) + .assertPropertyEquals(OperationalStateType.F_LAST_AVAILABILITY_STATUS, AvailabilityStatusType.UP) + .assertPropertyEquals(OperationalStateType.F_NODE_ID, localNodeId) + .assertPropertyValueSatisfies(OperationalStateType.F_TIMESTAMP, approximatelyCurrent(60000)) + .assertPropertyValueSatisfies(OperationalStateType.F_MESSAGE, startsWith("Status set to UP")); XmlSchemaType xmlSchemaTypeAfter = resourceTypeRepoAfter.getSchema(); assertNotNull("No schema after test connection", xmlSchemaTypeAfter); @@ -402,15 +353,14 @@ protected void assertResourceAfterTest() { @Test public void test021Configuration() throws Exception { - final String TEST_NAME = "test021Configuration"; - // GIVEN - OperationResult result = new OperationResult(AbstractBasicDummyTest.class.getName() + "." + TEST_NAME); + given(); + OperationResult result = createResult(); - // WHEN + when(); resource = provisioningService.getObject(ResourceType.class, RESOURCE_DUMMY_OID, null, null, result); resourceType = resource.asObjectable(); - // THEN + then(); assertSuccess(result); assertCounterIncrement(InternalCounters.RESOURCE_SCHEMA_PARSE_COUNT, 0); @@ -454,11 +404,7 @@ protected void assertConfigurationProperty(PrismProperty confProp) { @Test public void test022ParsedSchema() throws Exception { - final String TEST_NAME = "test022ParsedSchema"; - // GIVEN - - // THEN - // The returned type should have the schema pre-parsed + expect("The returned type should have the schema pre-parsed"); assertNotNull(RefinedResourceSchemaImpl.hasParsedSchema(resourceType)); // Also test if the utility method returns the same thing @@ -483,7 +429,6 @@ public void test022ParsedSchema() throws Exception { @Test public void test023RefinedSchema() throws Exception { - final String TEST_NAME = "test023RefinedSchema"; // GIVEN // WHEN @@ -530,7 +475,7 @@ public void test023RefinedSchema() throws Exception { assertTrue("No NAME read", nameDef.canRead()); assertTrue("NAME definition not in identifiers", accountDef.getSecondaryIdentifiers().contains(nameDef)); // MID-3144 - assertEquals("Wrong NAME displayOrder", (Integer)110, nameDef.getDisplayOrder()); + assertEquals("Wrong NAME displayOrder", (Integer) 110, nameDef.getDisplayOrder()); assertEquals("Wrong NAME displayName", "Username", nameDef.getDisplayName()); RefinedAttributeDefinition fullnameDef = accountDef.findAttributeDefinition("fullname"); @@ -551,9 +496,9 @@ public void test023RefinedSchema() throws Exception { rememberRefinedResourceSchema(refinedSchema); - for (Definition def: refinedSchema.getDefinitions()) { + for (Definition def : refinedSchema.getDefinitions()) { if (!(def instanceof RefinedObjectClassDefinition)) { - fail("Non-refined definition sneaked into resource schema: "+def); + fail("Non-refined definition sneaked into resource schema: " + def); } } @@ -570,7 +515,6 @@ public void test023RefinedSchema() throws Exception { */ @Test public void test024ParsedSchemaAgain() throws Exception { - final String TEST_NAME = "test024ParsedSchemaAgain"; // GIVEN // THEN @@ -589,17 +533,14 @@ public void test024ParsedSchemaAgain() throws Exception { @Test public void test028Capabilities() throws Exception { - final String TEST_NAME = "test028Capabilities"; + given(); + OperationResult result = createResult(); - // GIVEN - OperationResult result = new OperationResult(AbstractBasicDummyTest.class.getName() - + "." + TEST_NAME); - - // WHEN + when(); PrismObject resource = provisioningService.getObject(ResourceType.class, RESOURCE_DUMMY_OID, null, null, result); ResourceType resourceType = resource.asObjectable(); - // THEN + then(); result.computeStatus(); display("getObject result", result); TestUtil.assertSuccess(result); @@ -722,11 +663,8 @@ protected void assertNativeCredentialsCapability(CredentialsCapabilityType capCr */ @Test public void test029CapabilitiesRepo() throws Exception { - final String TEST_NAME = "test029CapabilitiesRepo"; - // GIVEN - OperationResult result = new OperationResult(AbstractBasicDummyTest.class.getName() - + "." + TEST_NAME); + OperationResult result = createResult(); // WHEN PrismObject resource = repositoryService.getObject(ResourceType.class, RESOURCE_DUMMY_OID, null, result); @@ -786,18 +724,15 @@ public void test029CapabilitiesRepo() throws Exception { * Create steady state of the system by invoking test connection again. * Previous operations may have modified the resource, which may have changed * resource version which might have interfered with caching. - * @throws Exception */ @Test public void test030ResourceAndConnectorCachingTestConnection() throws Exception { - final String TEST_NAME = "test030ResourceAndConnectorCachingTestConnection"; - Task task = getTestTask(); - // WHEN + when(); OperationResult testResult = provisioningService.testResource(RESOURCE_DUMMY_OID, task); - // THEN + then(); display("Test result", testResult); assertSuccess(testResult); @@ -827,10 +762,8 @@ public void test030ResourceAndConnectorCachingTestConnection() throws Exception @Test public void test032ResourceAndConnectorCaching() throws Exception { - final String TEST_NAME = "test032ResourceAndConnectorCaching"; - // GIVEN - OperationResult result = new OperationResult(TestOpenDj.class.getName() + "." + TEST_NAME); + OperationResult result = createResult(); ConnectorInstance configuredConnectorInstance = resourceManager.getConfiguredConnectorInstance( resource, ReadCapabilityType.class, false, result); assertNotNull("No configuredConnectorInstance", configuredConnectorInstance); @@ -838,12 +771,12 @@ public void test032ResourceAndConnectorCaching() throws Exception { assertNotNull("No resource schema", resourceSchema); // WHEN - when(TEST_NAME); - PrismObject resourceAgain = provisioningService.getObject(ResourceType.class, RESOURCE_DUMMY_OID, - null, null, result); + when(); + PrismObject resourceAgain = provisioningService.getObject( + ResourceType.class, RESOURCE_DUMMY_OID, null, null, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); ResourceType resourceTypeAgain = resourceAgain.asObjectable(); @@ -877,7 +810,7 @@ public void test032ResourceAndConnectorCaching() throws Exception { resourceAgain.asObjectable().setFetchResult(null); ObjectDelta dummyResourceDiff = DiffUtil.diff(resource, resourceAgain); display("Dummy resource diff", dummyResourceDiff); - assertTrue("The resource read again is not the same as the original. diff:"+dummyResourceDiff, dummyResourceDiff.isEmpty()); + assertTrue("The resource read again is not the same as the original. diff:" + dummyResourceDiff, dummyResourceDiff.isEmpty()); // Now we stick our nose deep inside the provisioning impl. But we need // to make sure that the @@ -888,13 +821,12 @@ public void test032ResourceAndConnectorCaching() throws Exception { assertTrue("Connector instance was not cached", configuredConnectorInstance == configuredConnectorInstanceAgain); // Check if the connector still works. - OperationResult testResult = new OperationResult(TestOpenDj.class.getName() + "."+TEST_NAME+".test"); + OperationResult testResult = createResult("test"); configuredConnectorInstanceAgain.test(testResult); testResult.computeStatus(); TestUtil.assertSuccess("Connector test failed", testResult); // Test connection should also refresh the connector by itself. So check if it has been refreshed - ConnectorInstance configuredConnectorInstanceAfterTest = resourceManager.getConfiguredConnectorInstance( resourceAgain, ReadCapabilityType.class, false, result); assertNotNull("No configuredConnectorInstance (again)", configuredConnectorInstanceAfterTest); @@ -945,8 +877,7 @@ public void test034ResourceAndConnectorCachingForceFresh() throws Exception { assertTrue("Connector instance was changed", configuredConnectorInstance == configuredConnectorInstanceAgain); // Check if the connector still works - OperationResult testResult = new OperationResult(TestOpenDj.class.getName() - + ".test011ResourceAndConnectorCachingForceFresh.test"); + OperationResult testResult = createResult("test"); configuredConnectorInstanceAgain.test(testResult); testResult.computeStatus(); TestUtil.assertSuccess("Connector test failed", testResult); @@ -958,11 +889,8 @@ public void test034ResourceAndConnectorCachingForceFresh() throws Exception { assertSteadyResource(); } - @Test public void test040ApplyDefinitionShadow() throws Exception { - final String TEST_NAME = "test040ApplyDefinitionShadow"; - // GIVEN Task task = getTestTask(); OperationResult result = task.getResult(); @@ -978,7 +906,7 @@ public void test040ApplyDefinitionShadow() throws Exception { TestUtil.assertSuccess(result); account.checkConsistence(true, true); - ShadowUtil.checkConsistence(account, TEST_NAME); + ShadowUtil.checkConsistence(account, getTestNameShort()); TestUtil.assertSuccess("applyDefinition(account) result", result); assertSteadyResource(); @@ -986,8 +914,6 @@ public void test040ApplyDefinitionShadow() throws Exception { @Test public void test041ApplyDefinitionAddShadowDelta() throws Exception { - final String TEST_NAME = "test041ApplyDefinitionAddShadowDelta"; - // GIVEN Task task = getTestTask(); OperationResult result = task.getResult(); @@ -1012,8 +938,6 @@ public void test041ApplyDefinitionAddShadowDelta() throws Exception { @Test public void test042ApplyDefinitionResource() throws Exception { - final String TEST_NAME = "test042ApplyDefinitionResource"; - // GIVEN Task task = getTestTask(); OperationResult result = task.getResult(); @@ -1041,8 +965,6 @@ public void test042ApplyDefinitionResource() throws Exception { @Test public void test043ApplyDefinitionAddResourceDelta() throws Exception { - final String TEST_NAME = "test043ApplyDefinitionAddResourceDelta"; - // GIVEN Task task = getTestTask(); OperationResult result = task.getResult(); @@ -1070,12 +992,10 @@ public void test043ApplyDefinitionAddResourceDelta() throws Exception { } @Test - public void test050SelfTest() throws Exception { - final String TEST_NAME = "test050SelfTest"; - + public void test050SelfTest() { // GIVEN Task task = getTestTask(); - OperationResult testResult = new OperationResult(AbstractBasicDummyTest.class + "." + TEST_NAME); + OperationResult testResult = task.getResult(); // WHEN provisioningService.provisioningSelfTest(testResult, task); @@ -1087,7 +1007,7 @@ public void test050SelfTest() throws Exception { // There may be warning about illegal key size on some platforms. As far as it is warning and not error we are OK // the system will fall back to a interoperable key size if (testResult.getStatus() != OperationResultStatus.SUCCESS && testResult.getStatus() != OperationResultStatus.WARNING) { - AssertJUnit.fail("Self-test failed: "+testResult); + AssertJUnit.fail("Self-test failed: " + testResult); } } @@ -1096,8 +1016,6 @@ public void test050SelfTest() throws Exception { @Test public void test080TestAttributesToReturn() throws Exception { - final String TEST_NAME = "test080TestAttributesToReturn"; - // GIVEN Task task = taskManager.createTaskInstance(); OperationResult result = task.getResult(); @@ -1112,7 +1030,7 @@ public void test080TestAttributesToReturn() throws Exception { display("attributesToReturn", attributesToReturn); assertFalse("wrong isReturnDefaultAttributes", attributesToReturn.isReturnDefaultAttributes()); Collection attrs = new ArrayList<>(); - for (ResourceAttributeDefinition attributeToReturnDef: attributesToReturn.getAttributesToReturn()) { + for (ResourceAttributeDefinition attributeToReturnDef : attributesToReturn.getAttributesToReturn()) { attrs.add(attributeToReturnDef.getItemName().getLocalPart()); } // No "memebers" attribute here @@ -1123,7 +1041,6 @@ public void test080TestAttributesToReturn() throws Exception { @Test public void test090ConnectorStatsAfterSomeUse() throws Exception { - final String TEST_NAME = "test090ConnectorStatsAfterSomeUse"; // GIVEN Task task = getTestTask(); OperationResult result = task.getResult(); @@ -1141,21 +1058,19 @@ public void test090ConnectorStatsAfterSomeUse() throws Exception { assertEquals("Wrong connectorClassName", getDummyConnectorClass().getName(), operationalStatus.getConnectorClassName()); assertEquals("Wrong poolConfigMinSize", null, operationalStatus.getPoolConfigMinSize()); - assertEquals("Wrong poolConfigMaxSize", (Integer)10, operationalStatus.getPoolConfigMaxSize()); - assertEquals("Wrong poolConfigMinIdle", (Integer)1, operationalStatus.getPoolConfigMinIdle()); - assertEquals("Wrong poolConfigMaxIdle", (Integer)10, operationalStatus.getPoolConfigMaxIdle()); - assertEquals("Wrong poolConfigWaitTimeout", (Long)150000L, operationalStatus.getPoolConfigWaitTimeout()); - assertEquals("Wrong poolConfigMinEvictableIdleTime", (Long)120000L, operationalStatus.getPoolConfigMinEvictableIdleTime()); - assertEquals("Wrong poolStatusNumIdle", (Integer)1, operationalStatus.getPoolStatusNumIdle()); - assertEquals("Wrong poolStatusNumActive", (Integer)0, operationalStatus.getPoolStatusNumActive()); + assertEquals("Wrong poolConfigMaxSize", (Integer) 10, operationalStatus.getPoolConfigMaxSize()); + assertEquals("Wrong poolConfigMinIdle", (Integer) 1, operationalStatus.getPoolConfigMinIdle()); + assertEquals("Wrong poolConfigMaxIdle", (Integer) 10, operationalStatus.getPoolConfigMaxIdle()); + assertEquals("Wrong poolConfigWaitTimeout", (Long) 150000L, operationalStatus.getPoolConfigWaitTimeout()); + assertEquals("Wrong poolConfigMinEvictableIdleTime", (Long) 120000L, operationalStatus.getPoolConfigMinEvictableIdleTime()); + assertEquals("Wrong poolStatusNumIdle", (Integer) 1, operationalStatus.getPoolStatusNumIdle()); + assertEquals("Wrong poolStatusNumActive", (Integer) 0, operationalStatus.getPoolStatusNumActive()); assertSteadyResource(); } - @Test public void test100AddAccountWill() throws Exception { - final String TEST_NAME = "test100AddAccountWill"; // GIVEN Task task = getTestTask(); OperationResult result = task.getResult(); @@ -1169,11 +1084,11 @@ public void test100AddAccountWill() throws Exception { XMLGregorianCalendar start = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); String addedObjectOid = provisioningService.addObject(account, null, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar end = clock.currentTimeXMLGregorianCalendar(); @@ -1192,8 +1107,8 @@ public void test100AddAccountWill() throws Exception { ActivationType activationRepo = accountRepo.asObjectable().getActivation(); if (supportsActivation()) { - assertNotNull("No activation in "+accountRepo+" (repo)", activationRepo); - assertEquals("Wrong activation enableTimestamp in "+accountRepo+" (repo)", ACCOUNT_WILL_ENABLE_TIMESTAMP, activationRepo.getEnableTimestamp()); + assertNotNull("No activation in " + accountRepo + " (repo)", activationRepo); + assertEquals("Wrong activation enableTimestamp in " + accountRepo + " (repo)", ACCOUNT_WILL_ENABLE_TIMESTAMP, activationRepo.getEnableTimestamp()); } else { assertNull("Activation sneaked in (repo)", activationRepo); } @@ -1216,10 +1131,10 @@ public void test100AddAccountWill() throws Exception { ActivationType activationProvisioning = accountTypeProvisioning.getActivation(); if (supportsActivation()) { - assertNotNull("No activation in "+accountProvisioning+" (provisioning)", activationProvisioning); - assertEquals("Wrong activation administrativeStatus in "+accountProvisioning+" (provisioning)", + assertNotNull("No activation in " + accountProvisioning + " (provisioning)", activationProvisioning); + assertEquals("Wrong activation administrativeStatus in " + accountProvisioning + " (provisioning)", ActivationStatusType.ENABLED, activationProvisioning.getAdministrativeStatus()); - TestUtil.assertEqualsTimestamp("Wrong activation enableTimestamp in "+accountProvisioning+" (provisioning)", + TestUtil.assertEqualsTimestamp("Wrong activation enableTimestamp in " + accountProvisioning + " (provisioning)", ACCOUNT_WILL_ENABLE_TIMESTAMP, activationProvisioning.getEnableTimestamp()); } else { assertNull("Activation sneaked in (provisioning)", activationProvisioning); @@ -1285,7 +1200,7 @@ protected void checkRepoAccountShadowWillBasic(PrismObject accountRe protected void assertPrimaryIdentifierValue(PrismObject shadow, String expected) { if (shadow.asObjectable().getLifecycleState() == null || shadow.asObjectable().getLifecycleState().equals(SchemaConstants.LIFECYCLE_ACTIVE)) { - assertEquals("Wrong primaryIdentifierValue in "+shadow, expected, shadow.asObjectable().getPrimaryIdentifierValue()); + assertEquals("Wrong primaryIdentifierValue in " + shadow, expected, shadow.asObjectable().getPrimaryIdentifierValue()); } } @@ -1306,10 +1221,8 @@ protected void checkRepoAccountShadowWill(PrismObject accountRepo, X @Test public void test102GetAccount() throws Exception { - final String TEST_NAME = "test102GetAccount"; // GIVEN - OperationResult result = new OperationResult(AbstractBasicDummyTest.class.getName() - + "." + TEST_NAME); + OperationResult result = createResult(); rememberCounter(InternalCounters.SHADOW_FETCH_OPERATION_COUNT); XMLGregorianCalendar startTs = clock.currentTimeXMLGregorianCalendar(); @@ -1346,10 +1259,8 @@ public void test102GetAccount() throws Exception { @Test public void test103GetAccountNoFetch() throws Exception { - final String TEST_NAME="test103GetAccountNoFetch"; // GIVEN - OperationResult result = new OperationResult(AbstractBasicDummyTest.class.getName() - + "."+TEST_NAME); + OperationResult result = createResult(); rememberCounter(InternalCounters.SHADOW_FETCH_OPERATION_COUNT); GetOperationOptions rootOptions = new GetOperationOptions(); @@ -1363,7 +1274,6 @@ public void test103GetAccountNoFetch() throws Exception { ACCOUNT_WILL_OID, options, null, result); // THEN - XMLGregorianCalendar endTs = clock.currentTimeXMLGregorianCalendar(); display("getObject result", result); assertSuccess(result); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 0); @@ -1372,7 +1282,7 @@ public void test103GetAccountNoFetch() throws Exception { assertNotNull("No dummy account", shadow); - checkAccountShadow(shadow, result, false, startTs, endTs); + checkAccountShadow(shadow, result, false); // This is noFetch. Therefore the read should NOT update the caching timestamp checkRepoAccountShadowWill(shadow, null, startTs); @@ -1383,8 +1293,6 @@ public void test103GetAccountNoFetch() throws Exception { @Test public void test105ApplyDefinitionModifyDelta() throws Exception { - final String TEST_NAME = "test105ApplyDefinitionModifyDelta"; - // GIVEN Task task = getTestTask(); OperationResult result = task.getResult(); @@ -1412,9 +1320,8 @@ public void test105ApplyDefinitionModifyDelta() throws Exception { */ @Test public void test106GetModifiedAccount() throws Exception { - final String TEST_NAME = "test106GetModifiedAccount"; // GIVEN - OperationResult result = new OperationResult(AbstractBasicDummyTest.class.getName() + "." + TEST_NAME); + OperationResult result = createResult(); rememberCounter(InternalCounters.SHADOW_FETCH_OPERATION_COUNT); DummyAccount accountWill = getDummyAccountAssert(transformNameFromResource(ACCOUNT_WILL_USERNAME), willIcfUid); @@ -1425,11 +1332,11 @@ public void test106GetModifiedAccount() throws Exception { XMLGregorianCalendar startTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); PrismObject shadow = provisioningService.getObject(ShadowType.class, ACCOUNT_WILL_OID, null, null, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 1); @@ -1464,19 +1371,17 @@ public void test106GetModifiedAccount() throws Exception { } @Test - public void test999Shutdown() throws Exception { - final String TEST_NAME = "test999Shutdown"; - - // WHEN + public void test999Shutdown() { + when(); provisioningService.shutdown(); - // THEN + then(); dummyResource.assertNoConnections(); } protected void checkAccountWill(PrismObject shadow, OperationResult result, XMLGregorianCalendar startTs, XMLGregorianCalendar endTs) throws SchemaException, EncryptionException { - checkAccountShadow(shadow, result, true, startTs, endTs); + checkAccountShadow(shadow, result, true); Collection> attributes = ShadowUtil.getAttributes(shadow); assertAttribute(shadow, DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_SHIP_NAME, "Flying Dutchman"); assertAttribute(shadow, DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_WEAPON_NAME, "Sword", "LOVE"); @@ -1487,49 +1392,47 @@ protected void checkAccountWill(PrismObject shadow, OperationResult /** * We do not know what the timestamp should be */ - protected void assertRepoCachingMetadata(PrismObject shadowRepo) { - assertNull("Unexpected caching metadata in "+shadowRepo, shadowRepo.asObjectable().getCachingMetadata()); - } - protected void assertRepoCachingMetadata(PrismObject shadowRepo, XMLGregorianCalendar start, XMLGregorianCalendar end) { - assertNull("Unexpected caching metadata in "+shadowRepo, shadowRepo.asObjectable().getCachingMetadata()); + assertNull("Unexpected caching metadata in " + shadowRepo, shadowRepo.asObjectable().getCachingMetadata()); } protected void assertCachingMetadata(PrismObject shadow, boolean expectedCached, XMLGregorianCalendar startTs, XMLGregorianCalendar endTs) { - assertNull("Unexpected caching metadata in "+shadow, shadow.asObjectable().getCachingMetadata()); + assertNull("Unexpected caching metadata in " + shadow, shadow.asObjectable().getCachingMetadata()); } - protected void checkAccountShadow(PrismObject shadowType, OperationResult parentResult, boolean fullShadow, XMLGregorianCalendar startTs, - XMLGregorianCalendar endTs) throws SchemaException { + protected void checkAccountShadow( + PrismObject shadowType, OperationResult parentResult, boolean fullShadow) + throws SchemaException { ObjectChecker checker = createShadowChecker(fullShadow); ShadowUtil.checkConsistence(shadowType, parentResult.getOperation()); - IntegrationTestTools.checkAccountShadow(shadowType.asObjectable(), resourceType, repositoryService, checker, getUidMatchingRule(), prismContext, parentResult); + IntegrationTestTools.checkAccountShadow(shadowType.asObjectable(), resourceType, + repositoryService, checker, getUidMatchingRule(), prismContext, parentResult); } protected ObjectChecker createShadowChecker(final boolean fullShadow) { return (shadow) -> { - String icfName = ShadowUtil.getSingleStringAttributeValue(shadow, - SchemaTestConstants.ICFS_NAME); - assertNotNull("No ICF NAME", icfName); - assertEquals("Wrong shadow name ("+shadow.getName()+")", StringUtils.lowerCase(icfName), StringUtils.lowerCase(shadow.getName().getOrig())); - assertNotNull("No kind in "+shadow, shadow.getKind()); - - if (shadow.getKind() == ShadowKindType.ACCOUNT) { - if (fullShadow) { - assertNotNull( - "Missing fullname attribute", - ShadowUtil.getSingleStringAttributeValue(shadow, - new QName(ResourceTypeUtil.getResourceNamespace(resourceType), "fullname"))); - if (supportsActivation()) { - assertNotNull("no activation", shadow.getActivation()); - assertNotNull("no activation status", shadow.getActivation().getAdministrativeStatus()); - assertEquals("not enabled", ActivationStatusType.ENABLED, shadow.getActivation().getAdministrativeStatus()); - } + String icfName = ShadowUtil.getSingleStringAttributeValue(shadow, + SchemaTestConstants.ICFS_NAME); + assertNotNull("No ICF NAME", icfName); + assertEquals("Wrong shadow name (" + shadow.getName() + ")", StringUtils.lowerCase(icfName), StringUtils.lowerCase(shadow.getName().getOrig())); + assertNotNull("No kind in " + shadow, shadow.getKind()); + + if (shadow.getKind() == ShadowKindType.ACCOUNT) { + if (fullShadow) { + assertNotNull( + "Missing fullname attribute", + ShadowUtil.getSingleStringAttributeValue(shadow, + new QName(ResourceTypeUtil.getResourceNamespace(resourceType), "fullname"))); + if (supportsActivation()) { + assertNotNull("no activation", shadow.getActivation()); + assertNotNull("no activation status", shadow.getActivation().getAdministrativeStatus()); + assertEquals("not enabled", ActivationStatusType.ENABLED, shadow.getActivation().getAdministrativeStatus()); } - - assertProvisioningAccountShadow(shadow.asPrismObject(), resourceType, RefinedAttributeDefinition.class); } - }; + + assertProvisioningAccountShadow(shadow.asPrismObject(), resourceType, RefinedAttributeDefinition.class); + } + }; } protected void assertRepoShadowCachedAttributeValue(PrismObject shadowRepo, String attrName, T... attrValues) { @@ -1543,7 +1446,7 @@ protected void assertRepoShadowCacheActivation(PrismObject shadowRep return; } ActivationStatusType administrativeStatus = activationType.getAdministrativeStatus(); - assertNull("Unexpected activation administrativeStatus in repo shadow "+shadowRepo+": "+administrativeStatus, administrativeStatus); + assertNull("Unexpected activation administrativeStatus in repo shadow " + shadowRepo + ": " + administrativeStatus, administrativeStatus); } protected void assertRepoShadowCredentials(PrismObject shadowRepo, String expectedPassword) throws SchemaException, EncryptionException { @@ -1551,12 +1454,12 @@ protected void assertRepoShadowCredentials(PrismObject shadowRepo, S if (expectedPassword == null && credentials == null) { return; } - assertNotNull("Missing credentendials in repo shadow "+shadowRepo, credentials); + assertNotNull("Missing credentendials in repo shadow " + shadowRepo, credentials); PasswordType passwordType = credentials.getPassword(); if (expectedPassword == null && passwordType == null) { return; } - assertNotNull("Missing password credential in repo shadow "+shadowRepo, passwordType); + assertNotNull("Missing password credential in repo shadow " + shadowRepo, passwordType); // TODO: assert password meta-data assertRepoShadowPasswordValue(shadowRepo, passwordType, expectedPassword); } @@ -1564,8 +1467,7 @@ protected void assertRepoShadowCredentials(PrismObject shadowRepo, S protected void assertRepoShadowPasswordValue(PrismObject shadowRepo, PasswordType passwordType, String expectedPassword) throws SchemaException, EncryptionException { ProtectedStringType passwordValue = passwordType.getValue(); - assertNull("Unexpected password value in repo shadow "+shadowRepo, passwordValue); + assertNull("Unexpected password value in repo shadow " + shadowRepo, passwordValue); } - } diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummy.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummy.java index 4e0eadd4da7..d744cae6d98 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummy.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummy.java @@ -223,7 +223,7 @@ public void test107AGetModifiedAccountFromCacheMax() throws Exception { XMLGregorianCalendar startTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); try { @@ -232,7 +232,7 @@ public void test107AGetModifiedAccountFromCacheMax() throws Exception { assertNotReached(); } catch (ConfigurationException e) { // Caching is disabled, this is expected. - then(TEST_NAME); + then(); display("Expected exception", e); assertFailure(result); } @@ -276,12 +276,12 @@ public void test107BGetModifiedAccountFromCacheHighStaleness() throws Exception XMLGregorianCalendar startTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); PrismObject shadow = provisioningService.getObject(ShadowType.class, ACCOUNT_WILL_OID, options, null, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); display("getObject result", result); TestUtil.assertSuccess(result); @@ -322,11 +322,11 @@ public void test108GetAccountLowStaleness() throws Exception { XMLGregorianCalendar startTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); PrismObject shadow = provisioningService.getObject(ShadowType.class, ACCOUNT_WILL_OID, options, null, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); display("getObject result", result); TestUtil.assertSuccess(result); @@ -338,7 +338,7 @@ public void test108GetAccountLowStaleness() throws Exception { assertNotNull("No dummy account", shadow); - checkAccountShadow(shadow, result, true, startTs, endTs); + checkAccountShadow(shadow, result, true); assertAttribute(shadow, DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_TITLE_NAME, "Very Nice Pirate"); assertAttribute(shadow, DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_SHIP_NAME, "Interceptor"); assertAttribute(shadow, DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_WEAPON_NAME, "Sword", "LOVE"); @@ -443,7 +443,7 @@ public boolean handle(PrismObject object, OperationResult parentResu assertTrue(object.canRepresent(ShadowType.class)); try { - checkAccountShadow(object, parentResult, true, startTs, endTs); + checkAccountShadow(object, parentResult, true); } catch (SchemaException e) { throw new SystemException(e.getMessage(), e); } @@ -693,11 +693,11 @@ public void test115CountAllAccounts() throws Exception { display("All shadows query", query); // WHEN - when(TEST_NAME); + when(); Integer count = provisioningService.countObjects(ShadowType.class, query, null, null, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Found " + count + " shadows"); @@ -866,12 +866,12 @@ public void test120ModifyWillReplaceFullname() throws Exception { delta.checkConsistence(); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); delta.checkConsistence(); @@ -899,12 +899,12 @@ public void test121ModifyObjectAddPirate() throws Exception { delta.checkConsistence(); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); delta.checkConsistence(); @@ -933,12 +933,12 @@ public void test122ModifyObjectAddCaptain() throws Exception { delta.checkConsistence(); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); delta.checkConsistence(); @@ -966,12 +966,12 @@ public void test123ModifyObjectDeletePirate() throws Exception { delta.checkConsistence(); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); delta.checkConsistence(); @@ -1003,12 +1003,12 @@ public void test124ModifyAccountWillAddCaptainAgain() throws Exception { delta.checkConsistence(); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); delta.checkConsistence(); @@ -1049,12 +1049,12 @@ public void test126ModifyAccountWillPassword() throws Exception { display("ObjectDelta", delta); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertDummyAccount(transformNameFromResource(ACCOUNT_WILL_USERNAME), willIcfUid) @@ -1096,12 +1096,12 @@ protected void testComparePassword(final String TEST_NAME, String tag, String sh syncServiceMock.reset(); // WHEN (match) - when(TEST_NAME); + when(); ItemComparisonResult comparisonResult = provisioningService.compare(ShadowType.class, shadowOid, SchemaConstants.PATH_PASSWORD_VALUE, expectedPassword, task, result); // THEN (match) - then(TEST_NAME); + then(); assertSuccess(result); display("Comparison result (" + tag + ")", comparisonResult); @@ -1125,11 +1125,11 @@ public void test129NullAttributeValue() throws Exception { willDummyAccount.replaceAttributeValue(DUMMY_ACCOUNT_ATTRIBUTE_TITLE_NAME, null); // WHEN - when(TEST_NAME); + when(); PrismObject accountWill = provisioningService.getObject(ShadowType.class, ACCOUNT_WILL_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); ResourceAttributeContainer attributesContainer = ShadowUtil.getAttributesContainer(accountWill); @@ -1447,12 +1447,12 @@ public void test152ActivationStatusUndefinedAccount() throws Exception { delta.checkConsistence(); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); display("modifyObject result", result); TestUtil.assertSuccess(result); @@ -1609,12 +1609,12 @@ public void test157SetValidTo() throws Exception { delta.checkConsistence(); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); display("modifyObject result", result); TestUtil.assertSuccess(result); @@ -1664,12 +1664,12 @@ public void test158DeleteValidToValidFrom() throws Exception { delta.checkConsistence(); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); display("modifyObject result", result); TestUtil.assertSuccess(result); @@ -1699,11 +1699,11 @@ public void test159GetLockedoutAccount() throws Exception { XMLGregorianCalendar startTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); PrismObject shadow = provisioningService.getObject(ShadowType.class, ACCOUNT_WILL_OID, null, null, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); display("getObject result", result); TestUtil.assertSuccess(result); @@ -1785,12 +1785,12 @@ public void test162UnlockAccount() throws Exception { delta.checkConsistence(); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); display("modifyObject result", result); TestUtil.assertSuccess(result); @@ -2202,7 +2202,7 @@ public boolean handle(PrismObject shadow, OperationResult parentResu assertTrue(shadow.canRepresent(ShadowType.class)); if (!useRepo) { try { - checkAccountShadow(shadow, parentResult, fullShadow, startTs, endTs); + checkAccountShadow(shadow, parentResult, fullShadow); } catch (SchemaException e) { throw new SystemException(e.getMessage(), e); } @@ -2281,7 +2281,7 @@ public boolean handle(PrismObject shadow, OperationResult parentResu assertTrue(shadow.canRepresent(ShadowType.class)); try { - checkAccountShadow(shadow, parentResult, true, startTs, endTs); + checkAccountShadow(shadow, parentResult, true); } catch (SchemaException e) { throw new SystemException(e.getMessage(), e); } @@ -2292,11 +2292,11 @@ public boolean handle(PrismObject shadow, OperationResult parentResu Collection> options = SelectorOptions.createCollection(rootOptions); // WHEN - when(TEST_NAME); + when(); SearchResultMetadata searchMetadata = provisioningService.searchObjectsIterative(ShadowType.class, query, options, handler, null, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); display("searchObjectsIterative result", result); TestUtil.assertSuccess(result); @@ -2674,12 +2674,12 @@ public void test220EntitleAccountWillPirates() throws Exception { delta.checkConsistence(); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); display("modifyObject result", result); TestUtil.assertSuccess(result); @@ -3029,12 +3029,12 @@ public void test230DetitleAccountWillPirates() throws Exception { delta.checkConsistence(); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); delta.checkConsistence(); assertAccountPiratesDetitled(); @@ -3061,12 +3061,12 @@ public void test232EntitleAccountWillPiratesIdentifiersName() throws Exception { delta.checkConsistence(); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); delta.checkConsistence(); assertAccountPiratesEntitled(); @@ -3093,12 +3093,12 @@ public void test233DetitleAccountWillPiratesIdentifiersName() throws Exception { delta.checkConsistence(); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); delta.checkConsistence(); assertAccountPiratesDetitled(); @@ -3125,12 +3125,12 @@ public void test234EntitleAccountWillPiratesIdentifiersUid() throws Exception { delta.checkConsistence(); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); delta.checkConsistence(); assertAccountPiratesEntitled(); @@ -3157,12 +3157,12 @@ public void test235DetitleAccountWillPiratesIdentifiersUid() throws Exception { delta.checkConsistence(); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); delta.checkConsistence(); assertAccountPiratesDetitled(); @@ -3556,12 +3556,12 @@ public void test300AccountRename() throws Exception { delta.checkConsistence(); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); delta.checkConsistence(); @@ -3609,12 +3609,12 @@ public void test310ModifyMorganEnlistTimestamp() throws Exception { delta.checkConsistence(); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); delta.checkConsistence(); @@ -3647,12 +3647,12 @@ public void test330ModifyAccountWillPasswordSelfService() throws Exception { ProvisioningOperationOptions options = ProvisioningOperationOptions.createRunAsAccountOid(ACCOUNT_WILL_OID); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), options, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); // Check if the account was created in the dummy resource @@ -3697,11 +3697,11 @@ public void test340ModifyWillReplaceGossipBloodAvast() throws Exception { List> mods = getGossipDelta(PlusMinusZero.ZERO, WILL_GOSSIP_BLOOD_OF_A_PIRATE, WILL_GOSSIP_AVAST); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, ACCOUNT_WILL_OID, mods, null, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertAccountWillGossip(WILL_GOSSIP_BLOOD_OF_A_PIRATE, WILL_GOSSIP_AVAST); @@ -3729,11 +3729,11 @@ public void test342ModifyWillAddGossipEunuch() throws Exception { List> mods = getGossipDelta(PlusMinusZero.PLUS, WILL_GOSSIP_EUNUCH); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, ACCOUNT_WILL_OID, mods, null, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertAccountWillGossip(WILL_GOSSIP_BLOOD_OF_A_PIRATE, WILL_GOSSIP_AVAST, WILL_GOSSIP_EUNUCH); @@ -3761,11 +3761,11 @@ public void test344ModifyWillDeleteGossipAvast() throws Exception { List> mods = getGossipDelta(PlusMinusZero.MINUS, WILL_GOSSIP_AVAST); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, ACCOUNT_WILL_OID, mods, null, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertAccountWillGossip(WILL_GOSSIP_BLOOD_OF_A_PIRATE, WILL_GOSSIP_EUNUCH); @@ -3928,14 +3928,14 @@ public void test509DeleteProtectedAccountShadow() throws Exception { try { // WHEN - when(TEST_NAME); + when(); provisioningService.deleteObject(ShadowType.class, ACCOUNT_DAEMON_OID, null, null, task, result); AssertJUnit.fail("Expected security exception while deleting 'daemon' account"); } catch (SecurityViolationException e) { // This is expected - then(TEST_NAME); + then(); display("Expected exception", e); } @@ -4044,11 +4044,11 @@ public void test520MigrationPrimaryIdentifierValueRefresh() throws Exception { repositoryService.addObject(shadowBefore, null, result); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowBefore, null, task, result); - then(TEST_NAME); + then(); assertSuccess(result); assertRepoShadow(ACCOUNT_RELIC_OID) @@ -4080,14 +4080,14 @@ public void test600AddAccountAlreadyExist() throws Exception { display("Adding shadow", account); // WHEN - when(TEST_NAME); + when(); try { provisioningService.addObject(account, null, null, task, result); assertNotReached(); } catch (ObjectAlreadyExistsException e) { // This is expected - then(TEST_NAME); + then(); display("Expected exception", e); } @@ -4128,7 +4128,7 @@ public void test800LiveSyncInit() throws Exception { ProvisioningTestUtil.getDefaultAccountObjectClass(resourceType)); // WHEN - when(TEST_NAME); + when(); provisioningService.synchronize(coords, syncTokenTask, null, result); // THEN @@ -4168,7 +4168,7 @@ public void test801LiveSyncAddBlackbeard() throws Exception { ProvisioningTestUtil.getDefaultAccountObjectClass(resourceType)); // WHEN - when(TEST_NAME); + when(); provisioningService.synchronize(coords, syncTokenTask, null, result); // THEN @@ -4230,7 +4230,7 @@ public void test802LiveSyncModifyBlackbeard() throws Exception { ProvisioningTestUtil.getDefaultAccountObjectClass(resourceType)); // WHEN - when(TEST_NAME); + when(); provisioningService.synchronize(coords, syncTokenTask, null, result); // THEN @@ -4393,11 +4393,11 @@ public void testLiveSyncAddDrake(final String TEST_NAME, DummySyncStyle syncStyl objectClass); // WHEN - when(TEST_NAME); + when(); provisioningService.synchronize(coords, syncTokenTask, null, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); display("Synchronization result", result); TestUtil.assertSuccess("Synchronization result is not OK", result); @@ -4464,11 +4464,11 @@ public void testLiveSyncModifyDrake(final String TEST_NAME, DummySyncStyle syncS objectClass); // WHEN - when(TEST_NAME); + when(); provisioningService.synchronize(coords, syncTokenTask, null, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); display("Synchronization result", result); TestUtil.assertSuccess("Synchronization result is not OK", result); @@ -4524,11 +4524,11 @@ public void testLiveSyncAddCorsairs(final String TEST_NAME, DummySyncStyle syncS objectClass); // WHEN - when(TEST_NAME); + when(); provisioningService.synchronize(coords, syncTokenTask, null, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); display("Synchronization result", result); TestUtil.assertSuccess("Synchronization result is not OK", result); @@ -4600,11 +4600,11 @@ public void testLiveSyncDeleteCorsairs(final String TEST_NAME, DummySyncStyle sy objectClass); // WHEN - when(TEST_NAME); + when(); provisioningService.synchronize(coords, syncTokenTask, null, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); display("Synchronization result", result); TestUtil.assertSuccess("Synchronization result is not OK", result); @@ -4666,11 +4666,11 @@ public void testLiveSyncDeleteDrake(final String TEST_NAME, DummySyncStyle syncS objectClass); // WHEN - when(TEST_NAME); + when(); provisioningService.synchronize(coords, syncTokenTask, null, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); display("Synchronization result", result); TestUtil.assertSuccess("Synchronization result is not OK", result); @@ -4721,11 +4721,11 @@ public void test890LiveSyncModifyProtectedAccount() throws Exception { ProvisioningTestUtil.getDefaultAccountObjectClass(resourceType)); // WHEN - when(TEST_NAME); + when(); provisioningService.synchronize(coords, syncTokenTask, null, result); // THEN - then(TEST_NAME); + then(); display("Synchronization result", result); assertSuccess(result); @@ -4767,7 +4767,7 @@ public void test901FailResourceNotFound() throws Exception { protected void checkCachedAccountShadow(PrismObject shadowType, OperationResult parentResult, boolean fullShadow, XMLGregorianCalendar startTs, XMLGregorianCalendar endTs) throws SchemaException { - checkAccountShadow(shadowType, parentResult, fullShadow, startTs, endTs); + checkAccountShadow(shadowType, parentResult, fullShadow); } private void checkGroupShadow(PrismObject shadow, OperationResult parentResult) throws SchemaException { diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyCaching.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyCaching.java index 46b00d64509..7d1a9fc67c0 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyCaching.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyCaching.java @@ -176,12 +176,12 @@ public void test107BGetModifiedAccountFromCacheHighStaleness() throws Exception XMLGregorianCalendar startTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); PrismObject shadow = provisioningService.getObject(ShadowType.class, ACCOUNT_WILL_OID, options, null, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 0); @@ -237,13 +237,13 @@ public void test107CSkipCachingForIncompleteAttributes() throws Exception { XMLGregorianCalendar startTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); PrismObject shadow = provisioningService .getObject(ShadowType.class, ACCOUNT_WILL_OID, null, null, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 1); @@ -374,18 +374,6 @@ protected void assertRepoShadowPasswordValue(PrismObject shadowRepo, assertProtectedString("Wrong password value in repo shadow "+shadowRepo, expectedPassword, protectedStringType, CredentialsStorageTypeType.HASHING); } - /** - * We do not know what the timestamp should be. But some timestamp should be there. - */ - @Override - protected void assertRepoCachingMetadata(PrismObject shadowFromRepo) { - CachingMetadataType cachingMetadata = shadowFromRepo.asObjectable().getCachingMetadata(); - assertNotNull("No caching metadata in "+shadowFromRepo, cachingMetadata); - - assertNotNull("Missing retrieval timestamp in caching metadata in "+shadowFromRepo, - cachingMetadata.getRetrievalTimestamp()); - } - @Override protected void assertRepoCachingMetadata(PrismObject shadowFromRepo, XMLGregorianCalendar start, XMLGregorianCalendar end) { CachingMetadataType cachingMetadata = shadowFromRepo.asObjectable().getCachingMetadata(); @@ -437,7 +425,7 @@ protected void assertRepoShadowCachedAttributeValue(PrismObject @Override protected void checkCachedAccountShadow(PrismObject shadow, OperationResult parentResult, boolean fullShadow, XMLGregorianCalendar startTs, XMLGregorianCalendar endTs) throws SchemaException { - super.checkAccountShadow(shadow, parentResult, fullShadow, startTs, endTs); + super.checkAccountShadow(shadow, parentResult, fullShadow); if (fullShadow) { assertCachingMetadata(shadow, true, startTs, endTs); } diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyConsistency.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyConsistency.java index 2e31f398d06..efc65c67e37 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyConsistency.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyConsistency.java @@ -116,11 +116,11 @@ public void test050AddAccountWill() throws Exception { display("Adding shadow", account); // WHEN - when(TEST_NAME); + when(); String addedObjectOid = provisioningService.addObject(account, null, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertEquals(ACCOUNT_WILL_OID, addedObjectOid); syncServiceMock.assertNotifySuccessOnly(); @@ -179,11 +179,11 @@ public void test100AddAccountMorganCommunicationFailure() throws Exception { lastRequestStartTs = lastAttemptStartTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); String addedObjectOid = provisioningService.addObject(account, null, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); assertInProgress(result); assertEquals(ACCOUNT_MORGAN_OID, addedObjectOid); @@ -240,11 +240,11 @@ public void test104RefreshAccountMorganCommunicationFailure() throws Exception { PrismObject shadowRepoBefore = getShadowRepo(ACCOUNT_MORGAN_OID); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); assertSuccess(result); syncServiceMock.assertNoNotifcations(); @@ -272,7 +272,7 @@ public void test105GetForceRefreshAccountMorganCommunicationFailure() throws Exc try { // WHEN - when(TEST_NAME); + when(); provisioningService.getObject(ShadowType.class, ACCOUNT_MORGAN_OID, options, task, result); @@ -283,7 +283,7 @@ public void test105GetForceRefreshAccountMorganCommunicationFailure() throws Exc } // THEN - then(TEST_NAME); + then(); display("Result", result); assertFailure(result); syncServiceMock.assertNoNotifcations(); @@ -315,11 +315,11 @@ public void test106RefreshAccountMorganCommunicationFailureRetry() throws Except lastAttemptStartTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); result.computeStatus(); TestUtil.assertResultStatus(result, OperationResultStatus.HANDLED_ERROR); @@ -354,11 +354,11 @@ public void test108RefreshAccountMorganCommunicationFailureRetryAgain() throws E lastAttemptStartTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); result.computeStatus(); TestUtil.assertResultStatus(result, OperationResultStatus.HANDLED_ERROR); @@ -479,11 +479,11 @@ public void test109RefreshAccountMorganDead() throws Exception { PrismObject shadowRepoBefore = getShadowRepo(ACCOUNT_MORGAN_OID); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); assertSuccess(result); syncServiceMock.assertNoNotifcations(); @@ -514,11 +514,11 @@ public void test110AddAccountMorganAgainCommunicationFailure() throws Exception lastRequestStartTs = lastAttemptStartTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); shadowMorganOid = provisioningService.addObject(account, null, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); assertInProgress(result); account.checkConsistence(); @@ -549,11 +549,11 @@ public void test114RefreshAccountMorganCommunicationFailure() throws Exception { PrismObject shadowRepoBefore = getShadowRepo(shadowMorganOid); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); assertSuccess(result); syncServiceMock.assertNoNotifcations(); @@ -585,11 +585,11 @@ public void test116RefreshAccountMorganRetrySuccess() throws Exception { lastAttemptStartTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); assertSuccess(result); lastAttemptEndTs = clock.currentTimeXMLGregorianCalendar(); @@ -618,12 +618,12 @@ public void test120ModifyMorganFullNameCommunicationFailure() throws Exception { display("ObjectDelta", delta); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), null, null, task, result); // THEN - then(TEST_NAME); + then(); assertInProgress(result); lastRequestEndTs = lastAttemptEndTs = clock.currentTimeXMLGregorianCalendar(); syncServiceMock.assertNotifyInProgressOnly(); @@ -652,11 +652,11 @@ public void test124RefreshAccountMorganCommunicationFailure() throws Exception { PrismObject shadowRepoBefore = getShadowRepo(shadowMorganOid); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); assertSuccess(result); syncServiceMock.assertNoNotifcations(); @@ -688,11 +688,11 @@ public void test126RefreshAccountMorganCommunicationFailureRetry() throws Except lastAttemptStartTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); result.computeStatus(); TestUtil.assertResultStatus(result, OperationResultStatus.HANDLED_ERROR); @@ -727,11 +727,11 @@ public void test128RefreshAccountMorganCommunicationFailureRetryAgain() throws E lastAttemptStartTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); result.computeStatus(); TestUtil.assertResultStatus(result, OperationResultStatus.HANDLED_ERROR); @@ -761,11 +761,11 @@ public void test129RefreshAccountMorganFailed() throws Exception { PrismObject shadowRepoBefore = getShadowRepo(shadowMorganOid); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); assertSuccess(result); syncServiceMock.assertNoNotifcations(); @@ -789,12 +789,12 @@ public void test130ModifyMorganFullNameAgainCommunicationFailure() throws Except display("ObjectDelta", delta); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), null, null, task, result); // THEN - then(TEST_NAME); + then(); assertInProgress(result); lastRequestEndTs = lastAttemptEndTs = clock.currentTimeXMLGregorianCalendar(); syncServiceMock.assertNotifyInProgressOnly(); @@ -824,12 +824,12 @@ public void test132GetAccountMorganCommunicationFailure() throws Exception { dummyResource.setBreakMode(BreakMode.NETWORK); // WHEN - when(TEST_NAME); + when(); provisioningService.getObject(ShadowType.class, shadowMorganOid, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); assertPartialError(result); syncServiceMock.assertNoNotifcations(); @@ -860,7 +860,7 @@ public void test133GetAccountMorganStalenessZeroCommunicationFailure() throws Ex try { // WHEN - when(TEST_NAME); + when(); provisioningService.getObject(ShadowType.class, shadowMorganOid, options, task, result); @@ -871,7 +871,7 @@ public void test133GetAccountMorganStalenessZeroCommunicationFailure() throws Ex } // THEN - then(TEST_NAME); + then(); display("Result", result); assertFailure(result); syncServiceMock.assertNoNotifcations(); @@ -901,11 +901,11 @@ public void test134GetAccountMorganForceRefreshRetryCommunicationFailure() throw Collection> options = SelectorOptions.createCollection(GetOperationOptions.createForceRefresh()); // WHEN - when(TEST_NAME); + when(); provisioningService.getObject(ShadowType.class, shadowMorganOid, options, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); assertPartialError(result); lastAttemptEndTs = clock.currentTimeXMLGregorianCalendar(); @@ -938,11 +938,11 @@ public void test136RefreshAccountMorganRetrySuccess() throws Exception { lastAttemptStartTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); assertSuccess(result); lastAttemptEndTs = clock.currentTimeXMLGregorianCalendar(); @@ -971,11 +971,11 @@ public void test170DeleteMorganCommunicationFailure() throws Exception { display("ObjectDelta", delta); // WHEN - when(TEST_NAME); + when(); provisioningService.deleteObject(ShadowType.class, shadowMorganOid, null, null, task, result); // THEN - then(TEST_NAME); + then(); assertInProgress(result); lastRequestEndTs = lastAttemptEndTs = clock.currentTimeXMLGregorianCalendar(); syncServiceMock.assertNotifyInProgressOnly(); @@ -1004,11 +1004,11 @@ public void test174RefreshAccountMorganCommunicationFailure() throws Exception { PrismObject shadowRepoBefore = getShadowRepo(shadowMorganOid); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); assertSuccess(result); syncServiceMock.assertNoNotifcations(); @@ -1040,11 +1040,11 @@ public void test176RefreshAccountMorganCommunicationFailureRetry() throws Except lastAttemptStartTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); result.computeStatus(); TestUtil.assertResultStatus(result, OperationResultStatus.HANDLED_ERROR); @@ -1079,11 +1079,11 @@ public void test178RefreshAccountMorganCommunicationFailureRetryAgain() throws E lastAttemptStartTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); result.computeStatus(); TestUtil.assertResultStatus(result, OperationResultStatus.HANDLED_ERROR); @@ -1112,11 +1112,11 @@ public void test179RefreshAccountMorganFailed() throws Exception { PrismObject shadowRepoBefore = getShadowRepo(shadowMorganOid); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); assertSuccess(result); syncServiceMock.assertNoNotifcations(); @@ -1140,11 +1140,11 @@ public void test180DeleteMorganCommunicationFailureAgain() throws Exception { display("ObjectDelta", delta); // WHEN - when(TEST_NAME); + when(); PrismObject returnedShadow = provisioningService.deleteObject(ShadowType.class, shadowMorganOid, null, null, task, result); // THEN - then(TEST_NAME); + then(); assertInProgress(result); lastRequestEndTs = lastAttemptEndTs = clock.currentTimeXMLGregorianCalendar(); syncServiceMock.assertNotifyInProgressOnly(); @@ -1179,11 +1179,11 @@ public void test186RefreshAccountMorganRetrySuccess() throws Exception { lastAttemptStartTs = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); assertSuccess(result); lastAttemptEndTs = clock.currentTimeXMLGregorianCalendar(); @@ -1219,11 +1219,11 @@ public void test190AccountMorganDeadExpireOperation() throws Exception { PrismObject shadowRepoBefore = getShadowRepo(ACCOUNT_MORGAN_OID); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); assertSuccess(result); syncServiceMock.assertNoNotifcations(); @@ -1304,11 +1304,11 @@ public void test192AccountMorganSecondDeadExpireOperation() throws Exception { PrismObject shadowRepoBefore = getShadowRepo(shadowMorganOid); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); assertSuccess(result); syncServiceMock.assertNoNotifcations(); @@ -1373,11 +1373,11 @@ public void test194AccountMorganDeadExpireShadow() throws Exception { PrismObject shadowRepoBefore = getShadowRepo(ACCOUNT_MORGAN_OID); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); assertSuccess(result); syncServiceMock.assertNotifySuccessOnly(); @@ -1409,11 +1409,11 @@ public void test196AccountMorganSecondDeadExpireShadow() throws Exception { PrismObject shadowRepoBefore = getShadowRepo(shadowMorganOid); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowRepoBefore, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); assertSuccess(result); syncServiceMock.assertNotifySuccessOnly(); @@ -1447,12 +1447,12 @@ public void test800AddAccountMorganAlreadyExists() throws Exception { display("Adding shadow", account); // WHEN - when(TEST_NAME); + when(); try { provisioningService.addObject(account, null, null, task, result); assertNotReached(); } catch (ObjectAlreadyExistsException e) { - then(TEST_NAME); + then(); display("expected exception", e); } @@ -1526,12 +1526,12 @@ public void test802AddAccountMorganAlreadyExistsAgain() throws Exception { display("Adding shadow", account); // WHEN - when(TEST_NAME); + when(); try { provisioningService.addObject(account, null, null, task, result); assertNotReached(); } catch (ObjectAlreadyExistsException e) { - then(TEST_NAME); + then(); display("expected exception", e); } @@ -1612,11 +1612,11 @@ public void test804AddAccountElizabeth() throws Exception { display("Adding shadow", account); // WHEN - when(TEST_NAME); + when(); provisioningService.addObject(account, null, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); account.checkConsistence(); @@ -1647,17 +1647,17 @@ public void test806RenameAccountElizabethAlreadyExists() throws Exception { ACCOUNT_BETTY_USERNAME); // WHEN - when(TEST_NAME); + when(); try { provisioningService.modifyObject(ShadowType.class, ACCOUNT_ELIZABETH_OID, delta.getModifications(), null, null, task, result); assertNotReached(); } catch (ObjectAlreadyExistsException e) { - then(TEST_NAME); + then(); display("expected exception", e); } // THEN - then(TEST_NAME); + then(); assertFailure(result); PrismObject conflictingShadowRepo = findAccountShadowByUsername(ACCOUNT_BETTY_USERNAME, getResource(), result); @@ -1726,17 +1726,17 @@ public void test808RenameAccountElizabethAlreadyExistsAgain() throws Exception { ACCOUNT_BETTY_USERNAME); // WHEN - when(TEST_NAME); + when(); try { provisioningService.modifyObject(ShadowType.class, ACCOUNT_ELIZABETH_OID, delta.getModifications(), null, null, task, result); assertNotReached(); } catch (ObjectAlreadyExistsException e) { - then(TEST_NAME); + then(); display("expected exception", e); } // THEN - then(TEST_NAME); + then(); assertFailure(result); PrismObject conflictingShadowRepo = findAccountShadowByUsername(ACCOUNT_BETTY_USERNAME, getResource(), result); @@ -1817,11 +1817,11 @@ public void test810GetAccountMorganNotFound() throws Exception { dummyResourceCtl.deleteAccount(ACCOUNT_MORGAN_NAME); // WHEN - when(TEST_NAME); + when(); PrismObject provisioningShadow = provisioningService.getObject(ShadowType.class, shadowMorganOid, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); // @formatter:off @@ -1888,12 +1888,12 @@ public void test812ModifyAccountWillNotFound() throws Exception { ACCOUNT_WILL_OID, dummyResourceCtl.getAttributeFullnamePath(), "Pirate Will Turner"); // WHEN - when(TEST_NAME); + when(); try { provisioningService.modifyObject(ShadowType.class, ACCOUNT_WILL_OID, delta.getModifications(), null, null, task, result); assertNotReached(); } catch (ObjectNotFoundException e) { - then(TEST_NAME); + then(); display("expected exception", e); } @@ -1959,11 +1959,11 @@ public void test814DeleteAccountElizabethNotFound() throws Exception { dummyResourceCtl.deleteAccount(ACCOUNT_ELIZABETH_USERNAME); // WHEN - when(TEST_NAME); + when(); provisioningService.deleteObject(ShadowType.class, ACCOUNT_ELIZABETH_OID, null, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); assertHadnledError(result); @@ -2030,16 +2030,16 @@ public void test816AddAccountElizabethAfterDeathAlreadyExists() throws Exception display("Adding shadow", account); // WHEN - when(TEST_NAME); + when(); try { provisioningService.addObject(account, null, null, task, result); } catch (ObjectAlreadyExistsException e) { - then(TEST_NAME); + then(); display("expected exception", e); } // THEN - then(TEST_NAME); + then(); assertFailure(result); // @formatter:off @@ -2094,11 +2094,11 @@ public void test900GetAccountMurrayPending() throws Exception { repoAddObjectFromFile(ACCOUNT_SHADOW_MURRAY_PENDING_FILE, result); // WHEN - when(TEST_NAME); + when(); PrismObject accountMurray = provisioningService.getObject(ShadowType.class, ACCOUNT_SHADOW_MURRAY_PENDING_OID, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); assertSuccess(result); accountMurray.checkConsistence(); diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyExtra.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyExtra.java index 7ce0396340a..60e2e3e4daf 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyExtra.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyExtra.java @@ -118,11 +118,11 @@ public void test400AddAccountElizabeth() throws Exception { XMLGregorianCalendar start = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); String addedObjectOid = provisioningService.addObject(account, null, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); XMLGregorianCalendar end = clock.currentTimeXMLGregorianCalendar(); @@ -245,11 +245,11 @@ public void test499DeleteAccountElizabeth() throws Exception { syncServiceMock.reset(); // WHEN - when(TEST_NAME); + when(); provisioningService.deleteObject(ShadowType.class, ACCOUNT_ELIZABETH_OID, null, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); syncServiceMock.assertNotifySuccessOnly(); diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyNegative.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyNegative.java index 89189cf44db..d75acc9e32e 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyNegative.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyNegative.java @@ -106,10 +106,10 @@ public void test190GetResource() throws Exception { syncServiceMock.reset(); // WHEN - when(TEST_NAME); + when(); PrismObject resource = provisioningService.getObject(ResourceType.class, RESOURCE_DUMMY_OID, null, task, result); - then(TEST_NAME); + then(); assertSuccess(result); display("Resource after", resource); @@ -133,7 +133,7 @@ public void test200AddAccountNullAttributes() throws Exception { try { // WHEN - when(TEST_NAME); + when(); provisioningService.addObject(account, null, null, task, result); assertNotReached(); @@ -142,7 +142,7 @@ public void test200AddAccountNullAttributes() throws Exception { display("Expected exception", e); } - then(TEST_NAME); + then(); syncServiceMock.assertNotifyFailureOnly(); } diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyParallelism.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyParallelism.java index c4af929d39e..b0a269c8174 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyParallelism.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyParallelism.java @@ -123,8 +123,6 @@ protected void assertWillRepoShadowAfterCreate(PrismObject repoShado @Test public void test120ModifyWillReplaceFullname() throws Exception { - final String TEST_NAME = "test120ModifyWillReplaceFullname"; - Task task = getTestTask(); OperationResult result = task.getResult(); syncServiceMock.reset(); @@ -135,12 +133,12 @@ public void test120ModifyWillReplaceFullname() throws Exception { delta.checkConsistence(); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertDummyAccount(transformNameFromResource(ACCOUNT_WILL_USERNAME), willIcfUid) @@ -162,18 +160,16 @@ public void test120ModifyWillReplaceFullname() throws Exception { @Test public void test190DeleteWill() throws Exception { - final String TEST_NAME = "test190DeleteWill"; - Task task = getTestTask(); OperationResult result = task.getResult(); syncServiceMock.reset(); // WHEN - when(TEST_NAME); + when(); provisioningService.deleteObject(ShadowType.class, ACCOUNT_WILL_OID, null, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); syncServiceMock.assertNotifySuccessOnly(); @@ -201,7 +197,6 @@ public void test190DeleteWill() throws Exception { */ @Test public void test200ParallelCreate() throws Exception { - final String TEST_NAME = "test200ParallelCreate"; // GIVEN Task task = getTestTask(); OperationResult result = task.getResult(); @@ -210,7 +205,7 @@ public void test200ParallelCreate() throws Exception { rememberDummyResourceWriteOperationCount(null); // WHEN - when(TEST_NAME); + when(); accountMorganOid = null; @@ -240,7 +235,7 @@ public void test200ParallelCreate() throws Exception { }, CONCURRENT_TEST_THREAD_COUNT_HIGH, CONCURRENT_TEST_MAX_START_DELAY_FAST); // THEN - then(TEST_NAME); + then(); waitForThreads(threads, WAIT_TIMEOUT); successCounter.assertCount("Wrong number of successful operations", 1); @@ -265,9 +260,7 @@ public void test200ParallelCreate() throws Exception { */ @Test public void test202ParallelModifyCaptainMorgan() throws Exception { - final String TEST_NAME = "test202ParallelModifyCaptainMorgan"; - - PrismObject shadowAfter = parallelModifyTest(TEST_NAME, + PrismObject shadowAfter = parallelModifyTest( () -> prismContext.deltaFactory().object().createModificationReplaceProperty(ShadowType.class, accountMorganOid, dummyResourceCtl.getAttributeFullnamePath(), "Captain Morgan")); @@ -284,9 +277,7 @@ public void test202ParallelModifyCaptainMorgan() throws Exception { */ @Test public void test204ParallelModifyDisable() throws Exception { - final String TEST_NAME = "test204ParallelModifyDisable"; - - PrismObject shadowAfter = parallelModifyTest(TEST_NAME, + PrismObject shadowAfter = parallelModifyTest( () -> prismContext.deltaFactory().object().createModificationReplaceProperty(ShadowType.class, accountMorganOid, SchemaConstants.PATH_ACTIVATION_ADMINISTRATIVE_STATUS, ActivationStatusType.DISABLED)); @@ -294,7 +285,8 @@ public void test204ParallelModifyDisable() throws Exception { assertActivationAdministrativeStatus(shadowAfter, ActivationStatusType.DISABLED); } - private PrismObject parallelModifyTest(final String TEST_NAME, FailableProducer> deltaProducer) throws Exception { + private PrismObject parallelModifyTest( + FailableProducer> deltaProducer) throws Exception { // GIVEN Task task = getTestTask(); @@ -304,7 +296,7 @@ private PrismObject parallelModifyTest(final String TEST_NAME, Faila rememberDummyResourceWriteOperationCount(null); // WHEN - when(TEST_NAME); + when(); ParallelTestThread[] threads = multithread( (i) -> { @@ -337,7 +329,7 @@ private PrismObject parallelModifyTest(final String TEST_NAME, Faila }, CONCURRENT_TEST_THREAD_COUNT, CONCURRENT_TEST_MAX_START_DELAY_FAST); // THEN - then(TEST_NAME); + then(); waitForThreads(threads, WAIT_TIMEOUT); PrismObject shadowAfter = provisioningService.getObject(ShadowType.class, accountMorganOid, null, task, result); @@ -354,14 +346,12 @@ private PrismObject parallelModifyTest(final String TEST_NAME, Faila @Test public void test209ParallelDelete() throws Exception { - final String TEST_NAME = "test209ParallelDelete"; - // GIVEN final Counter successCounter = new Counter(); rememberDummyResourceWriteOperationCount(null); // WHEN - when(TEST_NAME); + when(); Task task = getTestTask(); ParallelTestThread[] threads = multithread( @@ -394,7 +384,7 @@ public void test209ParallelDelete() throws Exception { }, CONCURRENT_TEST_THREAD_COUNT, CONCURRENT_TEST_MAX_START_DELAY_FAST); // THEN - then(TEST_NAME); + then(); waitForThreads(threads, WAIT_TIMEOUT); successCounter.assertCount("Wrong number of successful operations", 1); @@ -412,7 +402,6 @@ public void test209ParallelDelete() throws Exception { @Test public void test210ParallelCreateSlow() throws Exception { - final String TEST_NAME = "test210ParallelCreateSlow"; // GIVEN Task task = getTestTask(); OperationResult result = task.getResult(); @@ -421,7 +410,7 @@ public void test210ParallelCreateSlow() throws Exception { rememberDummyResourceWriteOperationCount(null); // WHEN - when(TEST_NAME); + when(); ParallelTestThread[] threads = multithread( (i) -> { @@ -447,7 +436,7 @@ public void test210ParallelCreateSlow() throws Exception { }, CONCURRENT_TEST_THREAD_COUNT, null); // THEN - then(TEST_NAME); + then(); waitForThreads(threads, WAIT_TIMEOUT); successCounter.assertCount("Wrong number of successful operations", 1); @@ -470,9 +459,7 @@ public void test210ParallelCreateSlow() throws Exception { */ @Test public void test212ParallelModifyElizabethSlow() throws Exception { - final String TEST_NAME = "test212ParallelModifyElizabethSlow"; - - PrismObject shadowAfter = parallelModifyTestSlow(TEST_NAME, + PrismObject shadowAfter = parallelModifyTestSlow( () -> prismContext.deltaFactory().object().createModificationReplaceProperty(ShadowType.class, accountElizabethOid, dummyResourceCtl.getAttributeFullnamePath(), "Miss Swan")); @@ -489,9 +476,7 @@ public void test212ParallelModifyElizabethSlow() throws Exception { */ @Test public void test214ParallelModifyDisableSlow() throws Exception { - final String TEST_NAME = "test214ParallelModifyDisableSlow"; - - PrismObject shadowAfter = parallelModifyTestSlow(TEST_NAME, + PrismObject shadowAfter = parallelModifyTestSlow( () -> prismContext.deltaFactory().object().createModificationReplaceProperty(ShadowType.class, accountElizabethOid, SchemaConstants.PATH_ACTIVATION_ADMINISTRATIVE_STATUS, ActivationStatusType.DISABLED)); @@ -499,18 +484,17 @@ public void test214ParallelModifyDisableSlow() throws Exception { assertActivationAdministrativeStatus(shadowAfter, ActivationStatusType.DISABLED); } - private PrismObject parallelModifyTestSlow(final String TEST_NAME, FailableProducer> deltaProducer) throws Exception { + private PrismObject parallelModifyTestSlow( + FailableProducer> deltaProducer) throws Exception { - // GIVEN + given(); Task task = getTestTask(); OperationResult result = task.getResult(); final Counter successCounter = new Counter(); rememberDummyResourceWriteOperationCount(null); - // WHEN - when(TEST_NAME); - + when(); ParallelTestThread[] threads = multithread( (i) -> { OperationResult localResult = task.getResult().createSubresult("thread-" + i); @@ -542,7 +526,7 @@ private PrismObject parallelModifyTestSlow(final String TEST_NAME, F }, CONCURRENT_TEST_THREAD_COUNT, null); // THEN - then(TEST_NAME); + then(); waitForThreads(threads, WAIT_TIMEOUT); PrismObject shadowAfter = provisioningService.getObject(ShadowType.class, accountElizabethOid, null, task, result); @@ -559,14 +543,12 @@ private PrismObject parallelModifyTestSlow(final String TEST_NAME, F @Test public void test229ParallelDeleteSlow() throws Exception { - final String TEST_NAME = "test229ParallelDeleteSlow"; - // GIVEN final Counter successCounter = new Counter(); rememberDummyResourceWriteOperationCount(null); // WHEN - when(TEST_NAME); + when(); Task task = getTestTask(); ParallelTestThread[] threads = multithread( @@ -602,7 +584,7 @@ public void test229ParallelDeleteSlow() throws Exception { }, CONCURRENT_TEST_THREAD_COUNT, null); // THEN - then(TEST_NAME); + then(); waitForThreads(threads, WAIT_TIMEOUT); successCounter.assertCount("Wrong number of successful operations", 1); @@ -628,7 +610,6 @@ public void test229ParallelDeleteSlow() throws Exception { */ @Test public void test230ParallelGroupSearch() throws Exception { - final String TEST_NAME = "test230ParallelGroupSearch"; // GIVEN Task task = getTestTask(); OperationResult result = task.getResult(); @@ -669,13 +650,13 @@ public void test230ParallelGroupSearch() throws Exception { Thread.sleep(100); // WHEN - when(TEST_NAME); + when(); // Unblock the handlers. And here we go! dummyResource.unblockAll(); // THEN - then(TEST_NAME); + then(); waitForThreads(threads, WAIT_TIMEOUT); dummyResource.setSyncSearchHandlerStart(false); @@ -716,8 +697,6 @@ private ObjectQuery createGroupNameQuery(String groupName) throws SchemaExceptio */ @Test public void test800ParallelReadAndModifyResource() throws Exception { - final String TEST_NAME = "test800ParallelReadAndModifyResource"; - Task task = getTestTask(); OperationResult result = task.getResult(); @@ -739,7 +718,7 @@ public void test800ParallelReadAndModifyResource() throws Exception { } // WHEN - when(TEST_NAME); + when(); long t0 = System.currentTimeMillis(); MutableBoolean readFinished = new MutableBoolean(); @@ -814,7 +793,7 @@ public void test800ParallelReadAndModifyResource() throws Exception { }, CONCURRENT_TEST_THREAD_COUNT_HIGH, CONCURRENT_TEST_MAX_START_DELAY_FAST); // THEN - then(TEST_NAME); + then(); waitForThreads(threads, WAIT_TIMEOUT); PrismObject resourceAfter = provisioningService.getObject(ResourceType.class, RESOURCE_DUMMY_OID, null, task, result); diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyResourceAndSchemaCaching.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyResourceAndSchemaCaching.java index 20726ce0d4b..adb7fa38a6e 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyResourceAndSchemaCaching.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummyResourceAndSchemaCaching.java @@ -87,11 +87,11 @@ public void test010GetResource() throws Exception { rememberResourceCacheStats(); // WHEN - when(TEST_NAME); + when(); PrismObject resourceProvisioning = provisioningService.getObject(ResourceType.class, RESOURCE_DUMMY_OID, null, null, result); // THEN - then(TEST_NAME); + then(); display("Resource", resource); assertSuccess(result); diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummySchemaless.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummySchemaless.java index 6c0f979944c..9776c3ffeb7 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummySchemaless.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/dummy/TestDummySchemaless.java @@ -368,12 +368,12 @@ public void resourceStatciSchemaResourceAndConnectorCaching(final String TEST_NA assertStaticSchemaSanity(resourceSchemaBefore); // WHEN - when(TEST_NAME); + when(); PrismObject resourceAgain = provisioningService.getObject(ResourceType.class, RESOURCE_DUMMY_STATIC_SCHEMA_OID, null, null, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); ResourceType resourceTypeAgain = resourceAgain.asObjectable(); @@ -445,11 +445,11 @@ public void test040ReAddResourceStaticSchema() throws Exception { fillInConnectorRef(resourceNew, IntegrationTestTools.DUMMY_CONNECTOR_TYPE, result); // WHEN - when(TEST_NAME); + when(); provisioningService.addObject(resourceNew, null, ProvisioningOperationOptions.createOverwrite(true), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertCounterIncrement(InternalCounters.RESOURCE_SCHEMA_FETCH_COUNT, 0); @@ -677,12 +677,12 @@ public void test107Capabilities() throws Exception { OperationResult result = new OperationResult(TestDummy.class.getName() + "." + TEST_NAME); // WHEN - when(TEST_NAME); + when(); ResourceType resourceType = provisioningService.getObject(ResourceType.class, RESOURCE_DUMMY_STATIC_SCHEMA_OID, null, null, result) .asObjectable(); // THEN - then(TEST_NAME); + then(); assertSuccess(result); // Check native capabilities diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/manual/AbstractManualResourceTest.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/manual/AbstractManualResourceTest.java index d4799794fc7..3e7d4c05d47 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/manual/AbstractManualResourceTest.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/manual/AbstractManualResourceTest.java @@ -348,11 +348,11 @@ public void test100AddAccountWill() throws Exception { accountWillReqestTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); String addedObjectOid = provisioningService.addObject(account, null, null, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); willLastCaseOid = assertInProgress(result); @@ -415,11 +415,11 @@ public void test102GetAccountWillFuture() throws Exception { Collection> options = SelectorOptions.createCollection(GetOperationOptions.createPointInTimeType(PointInTimeType.FUTURE)); // WHEN - when(TEST_NAME); + when(); PrismObject shadowProvisioning = provisioningService.getObject(ShadowType.class, ACCOUNT_WILL_OID, options, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Provisioning shadow", shadowProvisioning); @@ -450,11 +450,11 @@ public void test104RefreshAccountWill() throws Exception { display("Shadow before", shadowBefore); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowBefore, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject shadowRepo = getShadowRepo(ACCOUNT_WILL_OID); @@ -504,11 +504,11 @@ public void test106AddToBackingStoreAndGetAccountWill() throws Exception { syncServiceMock.reset(); // WHEN - when(TEST_NAME); + when(); PrismObject shadowProvisioning = provisioningService.getObject(ShadowType.class, ACCOUNT_WILL_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Provisioning shadow", shadowProvisioning); @@ -545,11 +545,11 @@ public void test108GetAccountWillFuture() throws Exception { Collection> options = SelectorOptions.createCollection(GetOperationOptions.createPointInTimeType(PointInTimeType.FUTURE)); // WHEN - when(TEST_NAME); + when(); PrismObject shadowProvisioning = provisioningService.getObject(ShadowType.class, ACCOUNT_WILL_OID, options, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Provisioning shadow", shadowProvisioning); @@ -587,7 +587,7 @@ public void test109GetAccountWillFutureNoFetch() throws Exception { options.setNoFetch(true); // WHEN - when(TEST_NAME); + when(); PrismObject shadowProvisioningFuture = provisioningService.getObject(ShadowType.class, ACCOUNT_WILL_OID, SelectorOptions.createCollection(options), @@ -595,7 +595,7 @@ public void test109GetAccountWillFutureNoFetch() throws Exception { // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Provisioning shadow (future,noFetch)", shadowProvisioningFuture); @@ -633,11 +633,11 @@ public void test110CloseCaseAndRefreshAccountWill() throws Exception { accountWillCompletionTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowBefore, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); accountWillCompletionTimestampEnd = clock.currentTimeXMLGregorianCalendar(); @@ -693,11 +693,11 @@ public void test120RefreshAccountWillAfter5min() throws Exception { display("Shadow before", shadowBefore); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowBefore, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject shadowRepo = getShadowRepo(ACCOUNT_WILL_OID); @@ -745,11 +745,11 @@ public void test130RefreshAccountWillAfter16min() throws Exception { display("Shadow before", shadowBefore); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowBefore, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject shadowRepo = getShadowRepo(ACCOUNT_WILL_OID); @@ -797,11 +797,11 @@ public void test132RefreshAccountWillAfter27min() throws Exception { display("Shadow before", shadowBefore); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowBefore, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject shadowRepo = getShadowRepo(ACCOUNT_WILL_OID); @@ -838,12 +838,12 @@ public void test200ModifyAccountWillFullname() throws Exception { accountWillReqestTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), null, null, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); willLastCaseOid = assertInProgress(result); @@ -916,11 +916,11 @@ public void test202RefreshAccountWill() throws Exception { display("Shadow before", shadowBefore); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowBefore, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject shadowRepo = getShadowRepo(ACCOUNT_WILL_OID); @@ -1000,11 +1000,11 @@ public void test204CloseCaseAndRefreshAccountWill() throws Exception { accountWillCompletionTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowBefore, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); accountWillCompletionTimestampEnd = clock.currentTimeXMLGregorianCalendar(); @@ -1091,11 +1091,11 @@ public void test210RefreshAccountWillAfter5min() throws Exception { display("Shadow before", shadowBefore); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowBefore, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject shadowRepo = getShadowRepo(ACCOUNT_WILL_OID); @@ -1159,11 +1159,11 @@ public void test212UpdateBackingStoreAndGetAccountWill() throws Exception { backingStoreUpdateWill(ACCOUNT_WILL_FULLNAME_PIRATE, ActivationStatusType.ENABLED, ACCOUNT_WILL_PASSWORD_OLD); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowBefore, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject shadowRepo = getShadowRepo(ACCOUNT_WILL_OID); @@ -1225,12 +1225,12 @@ public void test220ModifyAccountWillDisable() throws Exception { accountWillReqestTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), null, null, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); willLastCaseOid = assertInProgress(result); @@ -1311,12 +1311,12 @@ public void test230ModifyAccountWillChangePasswordAndEnable() throws Exception { accountWillSecondReqestTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), null, null, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); willSecondLastCaseOid = assertInProgress(result); @@ -1395,12 +1395,12 @@ public void test240CloseDisableCaseAndReadAccountWill() throws Exception { accountWillCompletionTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); PrismObject shadowProvisioning = provisioningService.getObject(ShadowType.class, ACCOUNT_WILL_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); accountWillCompletionTimestampEnd = clock.currentTimeXMLGregorianCalendar(); @@ -1507,11 +1507,11 @@ public void test250RefreshAccountWillAfter5min() throws Exception { display("Shadow before", shadowBefore); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowBefore, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject shadowRepo = getShadowRepo(ACCOUNT_WILL_OID); @@ -1594,11 +1594,11 @@ public void test252UpdateBackingStoreAndGetAccountWill() throws Exception { backingStoreUpdateWill(ACCOUNT_WILL_FULLNAME_PIRATE, ActivationStatusType.DISABLED, ACCOUNT_WILL_PASSWORD_OLD); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowBefore, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject shadowRepo = getShadowRepo(ACCOUNT_WILL_OID); @@ -1663,11 +1663,11 @@ public void test260ClosePasswordChangeCaseAndRefreshAccountWill() throws Excepti accountWillSecondCompletionTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowBefore, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); accountWillSecondCompletionTimestampEnd = clock.currentTimeXMLGregorianCalendar(); @@ -1758,11 +1758,11 @@ public void test270RefreshAccountWillAfter7min() throws Exception { display("Shadow before", shadowBefore); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowBefore, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject shadowRepo = getShadowRepo(ACCOUNT_WILL_OID); @@ -1856,11 +1856,11 @@ public void test271RefreshAccountWillAfter12min() throws Exception { display("Shadow before", shadowBefore); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowBefore, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject shadowRepo = getShadowRepo(ACCOUNT_WILL_OID); @@ -1951,11 +1951,11 @@ public void test272UpdateBackingStoreAndGetAccountWill() throws Exception { backingStoreUpdateWill(ACCOUNT_WILL_FULLNAME_PIRATE, ActivationStatusType.ENABLED, ACCOUNT_WILL_PASSWORD_NEW); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowBefore, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject shadowRepo = getShadowRepo(ACCOUNT_WILL_OID); @@ -2015,11 +2015,11 @@ public void test280RefreshAccountWillAfter5min() throws Exception { display("Shadow before", shadowBefore); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowBefore, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject shadowRepo = getShadowRepo(ACCOUNT_WILL_OID); @@ -2103,11 +2103,11 @@ public void test290RefreshAccountWillAfter5min() throws Exception { display("Shadow before", shadowBefore); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowBefore, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject shadowRepo = getShadowRepo(ACCOUNT_WILL_OID); @@ -2165,11 +2165,11 @@ public void test300DeleteAccountWill() throws Exception { accountWillReqestTimestampStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); provisioningService.deleteObject(ShadowType.class, ACCOUNT_WILL_OID, null, null, task, result); // THEN - then(TEST_NAME); + then(); display("result", result); willLastCaseOid = assertInProgress(result); @@ -2231,7 +2231,7 @@ public void test302GetAccountWillFuture() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); PrismObject shadowProvisioningFuture = provisioningService.getObject(ShadowType.class, ACCOUNT_WILL_OID, SelectorOptions.createCollection(GetOperationOptions.createPointInTimeType(PointInTimeType.FUTURE)), @@ -2239,7 +2239,7 @@ public void test302GetAccountWillFuture() throws Exception { // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Provisioning shadow (future)", shadowProvisioningFuture); @@ -2259,7 +2259,7 @@ public void test303GetAccountWillFutureNoFetch() throws Exception { options.setNoFetch(true); // WHEN - when(TEST_NAME); + when(); PrismObject shadowProvisioningFuture = provisioningService.getObject(ShadowType.class, ACCOUNT_WILL_OID, SelectorOptions.createCollection(options), @@ -2267,7 +2267,7 @@ public void test303GetAccountWillFutureNoFetch() throws Exception { // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Provisioning shadow (future,noFetch)", shadowProvisioningFuture); @@ -2296,11 +2296,11 @@ public void test310CloseCaseAndRefreshAccountWill() throws Exception { display("Shadow before", shadowBefore); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowBefore, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); accountWillCompletionTimestampEnd = clock.currentTimeXMLGregorianCalendar(); @@ -2360,11 +2360,11 @@ public void test320RefreshAccountWillAfter5min() throws Exception { display("Shadow before", shadowBefore); // WHEN - when(TEST_NAME); + when(); provisioningService.refreshShadow(shadowBefore, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject shadowRepo = getShadowRepo(ACCOUNT_WILL_OID); diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/opendj/TestOpenDj.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/opendj/TestOpenDj.java index d74e11b05b3..ac1590ab088 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/opendj/TestOpenDj.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/opendj/TestOpenDj.java @@ -677,11 +677,11 @@ public void test110GetObject() throws Exception { PropertyReferenceListType resolve = new PropertyReferenceListType(); // WHEN - when(TEST_NAME); + when(); ShadowType provisioningShadow = provisioningService.getObject(ShadowType.class, ACCOUNT_JBOND_OID, null, task, result).asObjectable(); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertNotNull(provisioningShadow); @@ -793,11 +793,11 @@ public void test112GetObjectNotFoundResource() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); PrismObject shadow = provisioningService.getObject(ShadowType.class, ACCOUNT_BAD_OID, null, task, result); // THEN - when(TEST_NAME); + when(); ShadowAsserter.forShadow(shadow, "provisioning") .assertTombstone(); @@ -828,11 +828,11 @@ public void test120AddAccountWill() throws Exception { display("Account before", accountBefore); // WHEN - when(TEST_NAME); + when(); String addedObjectOid = provisioningService.addObject(accountBefore, null, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertEquals(ACCOUNT_WILL_OID, addedObjectOid); @@ -914,11 +914,11 @@ public void test130AddDeleteAccountSparrow() throws Exception { assertEquals(ACCOUNT_SPARROW_OID, addedObjectOid); // WHEN - when(TEST_NAME); + when(); provisioningService.deleteObject(ShadowType.class, ACCOUNT_SPARROW_OID, null, null, task, result); // THEN - then(TEST_NAME); + then(); ShadowType objType = null; try { @@ -971,12 +971,12 @@ public void test140AddAndModifyAccountJack() throws Exception { display("Object change",delta); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, objectChange.getOid(), delta.getModifications(), null, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1033,12 +1033,12 @@ public void test145ModifyAccountJackJpegPhoto() throws Exception { display("Modifications",modifications); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, ACCOUNT_JACK_OID, modifications, null, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); Entry entry = openDJController.searchByUid("rename"); @@ -1093,12 +1093,12 @@ public void test147ModifyAccountJackGivenNameDuplicit() throws Exception { display("Modifications",modifications); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, ACCOUNT_JACK_OID, modifications, null, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1154,11 +1154,11 @@ public void test150ChangePassword() throws Exception { display("Object change",delta); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), null, null, task, result); // THEN - then(TEST_NAME); + then(); // Check if object was modified in LDAP Entry entryAfter = openDJController.searchAndAssertByEntryUuid(uid); @@ -1267,11 +1267,11 @@ public boolean handle(PrismObject prismObject, OperationResult paren }; // WHEN - when(TEST_NAME); + when(); SearchResultMetadata searchMetadata = provisioningService.searchObjectsIterative(ShadowType.class, query, null, handler, task, result); // THEN - then(TEST_NAME); + then(); display("Count", objects.size()); assertEquals("Unexpected number of shadows", 9, objects.size()); @@ -1314,11 +1314,11 @@ public boolean handle(PrismObject prismObject, OperationResult paren }; // WHEN - when(TEST_NAME); + when(); SearchResultMetadata searchMetadata = provisioningService.searchObjectsIterative(ShadowType.class, query, null, handler, task, result); // THEN - then(TEST_NAME); + then(); display("Count", objects.size()); assertEquals("Unexpected number of shadows", 3, objects.size()); @@ -1361,11 +1361,11 @@ public boolean handle(PrismObject prismObject, OperationResult paren }; // WHEN - when(TEST_NAME); + when(); SearchResultMetadata searchMetadata = provisioningService.searchObjectsIterative(ShadowType.class, query, null, handler, task, result); // THEN - then(TEST_NAME); + then(); display("Count", objects.size()); assertEquals("Unexpected number of shadows", 3, objects.size()); @@ -1413,12 +1413,12 @@ public void test170DisableAccount() throws Exception{ display("Object change",delta); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, objectChange.getOid(), delta.getModifications(), null, null, task, result); // THEN - then(TEST_NAME); + then(); ShadowType accountType = provisioningService.getObject(ShadowType.class, ACCOUNT_DISABLE_SIMULATED_OID, null, taskManager.createTaskInstance(), result).asObjectable(); @@ -1713,12 +1713,12 @@ public void test202SearchObjectsCompexFilter() throws Exception { rememberCounter(InternalCounters.CONNECTOR_SIMULATED_PAGING_SEARCH_COUNT); // WHEN - when(TEST_NAME); + when(); List> objListType = provisioningService.searchObjects(ShadowType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1746,12 +1746,12 @@ public void test203SearchObjectsByDnExists() throws Exception { rememberCounter(InternalCounters.CONNECTOR_SIMULATED_PAGING_SEARCH_COUNT); // WHEN - when(TEST_NAME); + when(); List> objListType = provisioningService.searchObjects(ShadowType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); for (PrismObject objType : objListType) { @@ -1787,12 +1787,12 @@ public void test205SearchObjectsByDnNotExists() throws Exception { rememberCounter(InternalCounters.CONNECTOR_SIMULATED_PAGING_SEARCH_COUNT); // WHEN - when(TEST_NAME); + when(); List> objListType = provisioningService.searchObjects(ShadowType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); for (PrismObject objType : objListType) { @@ -1824,12 +1824,12 @@ public void test206SearchObjectsCompexFilterStartsWith() throws Exception { rememberCounter(InternalCounters.CONNECTOR_SIMULATED_PAGING_SEARCH_COUNT); // WHEN - when(TEST_NAME); + when(); List> objListType = provisioningService.searchObjects(ShadowType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); for (PrismObject objType : objListType) { @@ -1861,12 +1861,12 @@ public void test230SearchObjectsPagedNoOffset() throws Exception { rememberCounter(InternalCounters.CONNECTOR_SIMULATED_PAGING_SEARCH_COUNT); // WHEN - when(TEST_NAME); + when(); SearchResultList> searchResults = provisioningService.searchObjects(ShadowType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Search resutls", searchResults); @@ -1896,12 +1896,12 @@ public void test231SearchObjectsPagedOffsetZero() throws Exception { rememberCounter(InternalCounters.CONNECTOR_SIMULATED_PAGING_SEARCH_COUNT); // WHEN - when(TEST_NAME); + when(); SearchResultList> searchResults = provisioningService.searchObjects(ShadowType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Search resutls", searchResults); @@ -1931,11 +1931,11 @@ public void test232SearchObjectsPagedOffset() throws Exception { rememberCounter(InternalCounters.CONNECTOR_SIMULATED_PAGING_SEARCH_COUNT); // WHEN - when(TEST_NAME); + when(); SearchResultList> searchResults = provisioningService.searchObjects(ShadowType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); assertSuccess(result); display("Search resutls", searchResults); @@ -1969,12 +1969,12 @@ public void test233SearchObjectsPagedNoOffsetSortSn() throws Exception { rememberCounter(InternalCounters.CONNECTOR_SIMULATED_PAGING_SEARCH_COUNT); // WHEN - when(TEST_NAME); + when(); SearchResultList> searchResults = provisioningService.searchObjects(ShadowType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); assertSuccess(result); display("Search resutls", searchResults); @@ -2007,12 +2007,12 @@ public void test234SearchObjectsPagedOffsetSortSn() throws Exception { rememberCounter(InternalCounters.CONNECTOR_SIMULATED_PAGING_SEARCH_COUNT); // WHEN - when(TEST_NAME); + when(); List> searchResults = provisioningService.searchObjects(ShadowType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); assertSuccess(result); display("Search resutls", searchResults); @@ -2051,11 +2051,11 @@ public void test250CountAccounts() throws Exception { ObjectQuery query = getQueryConverter().createObjectQuery(ShadowType.class, queryType); // WHEN - when(TEST_NAME); + when(); Integer count = provisioningService.countObjects(ShadowType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("All accounts count", count); @@ -2077,11 +2077,11 @@ public void test252CountLdapGroups() throws Exception { ObjectQuery query = getQueryConverter().createObjectQuery(ShadowType.class, queryType); // WHEN - when(TEST_NAME); + when(); Integer count = provisioningService.countObjects(ShadowType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("All LDAP groups count", count); @@ -2166,11 +2166,11 @@ public void test320AddAccountPosix() throws Exception { display("Adding account", object); // WHEN - when(TEST_NAME); + when(); String addedObjectOid = provisioningService.addObject(object.asPrismObject(), null, null, task, result); // THEN - then(TEST_NAME); + then(); assertEquals(ACCOUNT_POSIX_MCMUTTON_OID, addedObjectOid); ShadowType repoShadowType = getShadowRepo(ACCOUNT_POSIX_MCMUTTON_OID).asObjectable(); @@ -2218,12 +2218,12 @@ public void test322ModifyAccountPosix() throws Exception { display("Object change",delta); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, objectChange.getOid(), delta.getModifications(), null, null, taskManager.createTaskInstance(), result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2258,11 +2258,11 @@ public void test329DeleteAccountPosix() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); provisioningService.deleteObject(ShadowType.class, ACCOUNT_POSIX_MCMUTTON_OID, null, null, task, result); // THEN - then(TEST_NAME); + then(); try { provisioningService.getObject(ShadowType.class, ACCOUNT_POSIX_MCMUTTON_OID, null, task, result); @@ -2306,12 +2306,12 @@ public void test330SearchForPosixAccount() throws Exception { rememberCounter(InternalCounters.CONNECTOR_SIMULATED_PAGING_SEARCH_COUNT); // WHEN - when(TEST_NAME); + when(); List> objListType = provisioningService.searchObjects(ShadowType.class, query, null, null, result); // THEN - then(TEST_NAME); + then(); for (PrismObject objType : objListType) { assertNotNull("Null search result", objType); display("found object", objType); @@ -2345,11 +2345,11 @@ public void test400AddGroupSwashbucklers() throws Exception { display("Adding object", object); // WHEN - when(TEST_NAME); + when(); String addedObjectOid = provisioningService.addObject(object.asPrismObject(), null, null, task, result); // THEN - then(TEST_NAME); + then(); assertEquals(GROUP_SWASHBUCKLERS_OID, addedObjectOid); ShadowType shadowType = getShadowRepo(GROUP_SWASHBUCKLERS_OID).asObjectable(); @@ -2386,11 +2386,11 @@ public void test402AddAccountMorganWithAssociation() throws Exception { IntegrationTestTools.display("Adding object", object); // WHEN - when(TEST_NAME); + when(); String addedObjectOid = provisioningService.addObject(object.asPrismObject(), null, null, task, result); // THEN - then(TEST_NAME); + then(); assertEquals(ACCOUNT_MORGAN_OID, addedObjectOid); assertRepoShadow(ACCOUNT_MORGAN_OID) @@ -2437,7 +2437,7 @@ public void test403modifyMorganReplaceAssociation() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); ObjectModificationType modification = prismContext.parserFor(FILE_MODIFY_ASSOCIATION_REPLACE).parseRealValue(ObjectModificationType.class); ObjectDelta delta = DeltaConvertor.createObjectDelta(modification, ShadowType.class, prismContext); try { @@ -2448,7 +2448,7 @@ public void test403modifyMorganReplaceAssociation() throws Exception { } // THEN - then(TEST_NAME); + then(); assertRepoShadow(ACCOUNT_MORGAN_OID) .assertName(ACCOUNT_MORGAN_DN); @@ -2490,12 +2490,12 @@ public void test405GetGroupSwashbucklers() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); PrismObject provisioningShadow = provisioningService.getObject(ShadowType.class, GROUP_SWASHBUCKLERS_OID, null, task, result); // THEN - then(TEST_NAME); + then(); ShadowType provisioningShadowType = provisioningShadow.asObjectable(); assertEquals("Wrong ICF name (provisioning)", dnMatchingRule.normalize(GROUP_SWASHBUCKLERS_DN), dnMatchingRule.normalize(provisioningShadowType.getName().getOrig())); @@ -2530,11 +2530,11 @@ public void test410CreateLdapGroupAndSearchGroups() throws Exception { RESOURCE_OPENDJ_GROUP_OBJECTCLASS, prismContext); // WHEN - when(TEST_NAME); + when(); SearchResultList> resultList = provisioningService.searchObjects(ShadowType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); assertSuccess(result); display("Search result", resultList); @@ -2564,11 +2564,11 @@ public void test412CreateLdapGroupWithMemberAndGet() throws Exception { RESOURCE_OPENDJ_GROUP_OBJECTCLASS, prismContext); // WHEN - when(TEST_NAME); + when(); PrismObject shadow = provisioningService.getObject(ShadowType.class, ACCOUNT_MORGAN_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Account shadow after", shadow); @@ -2595,11 +2595,11 @@ public void test414AddGroupCorsairsAssociateUser() throws Exception { IntegrationTestTools.display("Adding object", object); // WHEN - when(TEST_NAME); + when(); String addedObjectOid = provisioningService.addObject(object.asPrismObject(), null, null, task, result); // THEN - then(TEST_NAME); + then(); assertEquals(GROUP_CORSAIRS_OID, addedObjectOid); ShadowType shadowType = getShadowRepo(GROUP_CORSAIRS_OID).asObjectable(); @@ -2623,12 +2623,12 @@ public void test416AssociateUserToCorsairs() throws Exception { delta.checkConsistence(); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, delta.getOid(), delta.getModifications(), new OperationProvisioningScriptsType(), null, task, result); // THEN - then(TEST_NAME); + then(); Entry groupEntry = openDJController.fetchEntry(GROUP_CORSAIRS_DN); display("LDAP group", groupEntry); @@ -2646,11 +2646,11 @@ public void test418GetMorgan() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); PrismObject shadow = provisioningService.getObject(ShadowType.class, ACCOUNT_MORGAN_OID, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); assertSuccess(result); display("Shadow", shadow); @@ -2716,11 +2716,11 @@ public void test450ListGroupsObjectclass() throws Exception { display("query", query); // WHEN - when(TEST_NAME); + when(); SearchResultList> objects = provisioningService.searchObjects(ShadowType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); display("found objects", objects); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2742,11 +2742,11 @@ public void test452ListLdapGroupsKindIntent() throws Exception { display("query", query); // WHEN - when(TEST_NAME); + when(); SearchResultList> objects = provisioningService.searchObjects(ShadowType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); display("found objects", objects); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2768,11 +2768,11 @@ public void test454ListSpecialGroupsKindIntent() throws Exception { display("query", query); // WHEN - when(TEST_NAME); + when(); SearchResultList> objects = provisioningService.searchObjects(ShadowType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); display("found objects", objects); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2795,11 +2795,11 @@ public void test456AddGroupSpecialists() throws Exception { display("Adding object", object); // WHEN - when(TEST_NAME); + when(); String addedObjectOid = provisioningService.addObject(object.asPrismObject(), null, null, task, result); // THEN - then(TEST_NAME); + then(); assertEquals(GROUP_SPECIALISTS_OID, addedObjectOid); ShadowType shadowType = getShadowRepo(GROUP_SPECIALISTS_OID).asObjectable(); @@ -2837,11 +2837,11 @@ public void test457ListLdapGroupsKindIntent() throws Exception { display("query", query); // WHEN - when(TEST_NAME); + when(); SearchResultList> objects = provisioningService.searchObjects(ShadowType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); display("found objects", objects); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2863,11 +2863,11 @@ public void test458ListSpecialGroupsKindIntent() throws Exception { display("query", query); // WHEN - when(TEST_NAME); + when(); SearchResultList> objects = provisioningService.searchObjects(ShadowType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); display("found objects", objects); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2897,11 +2897,11 @@ public void test460ListOrganizationalUnitPeopleKindIntent() throws Exception { display("query", query); // WHEN - when(TEST_NAME); + when(); SearchResultList> objects = provisioningService.searchObjects(ShadowType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); display("found objects", objects); result.computeStatus(); TestUtil.assertSuccess(result); @@ -2928,11 +2928,11 @@ public void test470AddAccountPolyDescription() throws Exception { display("Account before", accountBefore); // WHEN - when(TEST_NAME); + when(); String addedObjectOid = provisioningService.addObject(accountBefore, null, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); Entry entry = openDJController.fetchEntry(ACCOUNT_POLY_DN); @@ -2981,12 +2981,12 @@ public void test472ModifyAccountJackDescriptionOrig() throws Exception { display("Modifications",modifications); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, ACCOUNT_JACK_OID, modifications, null, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); Entry entry = openDJController.searchByUid("rename"); @@ -3032,12 +3032,12 @@ public void test474ModifyAccountJackDescriptionLangEnSk() throws Exception { display("Modifications", modifications); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, ACCOUNT_JACK_OID, modifications, null, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); Entry entry = openDJController.searchByUid("rename"); @@ -3084,12 +3084,12 @@ public void test476ModifyAccountJackDescriptionLangEnSkRuHr() throws Exception { display("Modifications",modifications); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, ACCOUNT_JACK_OID, modifications, null, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); Entry entry = openDJController.searchByUid("rename"); @@ -3136,12 +3136,12 @@ public void test478ModifyAccountJackDescriptionLangEnSkRuHr() throws Exception { display("Modifications",modifications); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, ACCOUNT_JACK_OID, modifications, null, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); Entry entry = openDJController.searchByUid("rename"); @@ -3187,12 +3187,12 @@ public void test478bModifyAccountJackDeleteDescription() throws Exception { display("Modifications", modifications); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, ACCOUNT_JACK_OID, modifications, null, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); Entry entry = openDJController.searchByUid("rename"); @@ -3239,12 +3239,12 @@ public void test479ModifyAccountJackDescriptionJack() throws Exception { display("Modifications",modifications); // WHEN - when(TEST_NAME); + when(); provisioningService.modifyObject(ShadowType.class, ACCOUNT_JACK_OID, modifications, null, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); Entry entry = openDJController.searchByUid("rename"); @@ -3277,11 +3277,11 @@ public void test480AddOuSuper() throws Exception { display("Adding object", object); // WHEN - when(TEST_NAME); + when(); String addedObjectOid = provisioningService.addObject(object.asPrismObject(), null, null, task, result); // THEN - then(TEST_NAME); + then(); assertEquals(OU_SUPER_OID, addedObjectOid); ShadowType shadowType = getShadowRepo(OU_SUPER_OID).asObjectable(); @@ -3323,11 +3323,11 @@ public void test489DeleteOuSuperWithSub() throws Exception { createSubOrg(); // WHEN - when(TEST_NAME); + when(); provisioningService.deleteObject(ShadowType.class, OU_SUPER_OID, null, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertNoRepoShadow(OU_SUPER_OID); diff --git a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/opendj/TestOpenDjDumber.java b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/opendj/TestOpenDjDumber.java index fbfe2d48ed5..46cc1db8b42 100644 --- a/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/opendj/TestOpenDjDumber.java +++ b/provisioning/provisioning-impl/src/test/java/com/evolveum/midpoint/provisioning/impl/opendj/TestOpenDjDumber.java @@ -88,7 +88,7 @@ public void test489DeleteOuSuperWithSub() throws Exception { try { // WHEN - when(TEST_NAME); + when(); provisioningService.deleteObject(ShadowType.class, OU_SUPER_OID, null, null, task, result); assertNotReached(); @@ -97,7 +97,7 @@ public void test489DeleteOuSuperWithSub() throws Exception { } // THEN - then(TEST_NAME); + then(); assertFailure(result); } diff --git a/repo/repo-common/src/test/java/com/evolveum/midpoint/repo/common/commandline/TestCommandLine.java b/repo/repo-common/src/test/java/com/evolveum/midpoint/repo/common/commandline/TestCommandLine.java index 89d76bf2c45..2a1bc6bf71d 100644 --- a/repo/repo-common/src/test/java/com/evolveum/midpoint/repo/common/commandline/TestCommandLine.java +++ b/repo/repo-common/src/test/java/com/evolveum/midpoint/repo/common/commandline/TestCommandLine.java @@ -68,11 +68,11 @@ public void test100PlainExecuteEcho() throws Exception { CommandLineScriptType scriptType = getScript(REPORT_PLAIN_ECHO_FILE); // WHEN - when(TEST_NAME); + when(); commandLineScriptExecutor.executeScript(scriptType, null, "test", task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); } @@ -95,11 +95,11 @@ public void test110RedirExecuteEcho() throws Exception { VAR_HELLOTEXT, "Hello World", PrimitiveType.STRING); // WHEN - when(TEST_NAME); + when(); commandLineScriptExecutor.executeScript(scriptType, variables, "test", task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); File targetFile = new File(MidPointTestConstants.TARGET_DIR_PATH, "echo-out"); 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 f5e60823f6b..6e8f0d44cbb 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 @@ -396,6 +396,13 @@ protected OperationResult createResult() { return new OperationResult(contextName()); } + /** + * Creates new {@link OperationResult} with name prefixed by {@link #contextName()}. + */ + protected OperationResult createResult(String nameSuffix) { + return new OperationResult(contextName() + "." + nameSuffix); + } + /** * Returns default {@link OperationResult} for pre-created test-method-scoped {@link Task}. * This result can be freely used in test for some "main scope", it is not asserted in any diff --git a/testing/longtest/src/test/java/com/evolveum/midpoint/testing/longtest/TestLdap.java b/testing/longtest/src/test/java/com/evolveum/midpoint/testing/longtest/TestLdap.java index 7b1635fa197..c22cb9645a0 100644 --- a/testing/longtest/src/test/java/com/evolveum/midpoint/testing/longtest/TestLdap.java +++ b/testing/longtest/src/test/java/com/evolveum/midpoint/testing/longtest/TestLdap.java @@ -167,11 +167,11 @@ public void test200AssignRolePiratesToBarbossa() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_BARBOSSA_OID, ROLE_PIRATE_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -208,11 +208,11 @@ public void test202AssignLdapAccountToGuybrush() throws Exception { assertTrue("Photo bytes do not match (user before)", Arrays.equals(photoIn, userJpegPhotoBefore)); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_GUYBRUSH_OID, RESOURCE_OPENDJ_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); Entry entry = assertOpenDjAccount(USER_GUYBRUSH_USERNAME, USER_GUYBRUSH_FULL_NAME, true); @@ -258,11 +258,11 @@ public void test204AssignRolePiratesToGuybrush() throws Exception { ); // WHEN - when(TEST_NAME); + when(); assignRole(USER_GUYBRUSH_OID, ROLE_PIRATE_OID, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -297,12 +297,12 @@ public void test400RenameLeChuckConflicting() throws Exception { assertOpenDjAccount(ACCOUNT_CHARLES_NAME, "Charles L. Charles", true); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(userLechuckOid, UserType.F_NAME, task, result, PrismTestUtil.createPolyString(ACCOUNT_CHARLES_NAME)); // THEN - then(TEST_NAME); + then(); assertOpenDjAccount(ACCOUNT_CHARLES_NAME, "Charles L. Charles", true); assertOpenDjAccount(ACCOUNT_CHARLES_NAME + "1", "LeChuck", true); assertNoOpenDjAccount(ACCOUNT_LECHUCK_NAME); @@ -338,16 +338,16 @@ public boolean handle(PrismObject shadow, OperationResult parentResu }; // WHEN - when(TEST_NAME); + when(); modelService.searchObjectsIterative(ShadowType.class, query, handler, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); // THEN - then(TEST_NAME); + then(); assertEquals("Unexpected number of search results", NUM_LDAP_ENTRIES + 8, count.getValue()); @@ -369,20 +369,20 @@ public void test810BigImport() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); //task.setExtensionPropertyValue(SchemaConstants.MODEL_EXTENSION_WORKER_THREADS, 2); modelService.importFromResource(RESOURCE_OPENDJ_OID, new QName(RESOURCE_OPENDJ_NAMESPACE, "inetOrgPerson"), task, result); // THEN - then(TEST_NAME); + then(); OperationResult subresult = result.getLastSubresult(); TestUtil.assertInProgress("importAccountsFromResource result", subresult); waitForTaskFinish(task, true, 20000 + NUM_LDAP_ENTRIES*2000); // THEN - then(TEST_NAME); + then(); int userCount = modelService.countObjects(UserType.class, null, null, task, result); display("Users", userCount); @@ -407,19 +407,19 @@ public void test820BigReconciliation() throws Exception { ResourceType resource = modelService.getObject(ResourceType.class, RESOURCE_OPENDJ_OID, null, task, result).asObjectable(); // WHEN - when(TEST_NAME); + when(); reconciliationTaskHandler.launch(resource, new QName(RESOURCE_OPENDJ_NAMESPACE, "inetOrgPerson"), task, result); // THEN - then(TEST_NAME); + then(); // OperationResult subresult = result.getLastSubresult(); // TestUtil.assertInProgress("reconciliation launch result", subresult); waitForTaskFinish(task, true, 20000 + NUM_LDAP_ENTRIES*2000); // THEN - then(TEST_NAME); + then(); int userCount = modelService.countObjects(UserType.class, null, null, task, result); display("Users", userCount); @@ -439,16 +439,16 @@ public void test900DeleteShadows() throws Exception { rememberCounter(InternalCounters.SHADOW_FETCH_OPERATION_COUNT); // WHEN - when(TEST_NAME); + when(); importObjectFromFile(TASK_DELETE_OPENDJ_SHADOWS_FILE); // THEN - then(TEST_NAME); + then(); waitForTaskFinish(TASK_DELETE_OPENDJ_SHADOWS_OID, true, 20000 + NUM_LDAP_ENTRIES*2000); // THEN - then(TEST_NAME); + then(); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, 0); @@ -486,16 +486,16 @@ public void test910DeleteAccounts() throws Exception { rememberCounter(InternalCounters.SHADOW_FETCH_OPERATION_COUNT); // WHEN - when(TEST_NAME); + when(); importObjectFromFile(TASK_DELETE_OPENDJ_ACCOUNTS_FILE); // THEN - then(TEST_NAME); + then(); waitForTaskFinish(TASK_DELETE_OPENDJ_ACCOUNTS_OID, true, 20000 + NUM_LDAP_ENTRIES*3000); // THEN - then(TEST_NAME); + then(); assertCounterIncrement(InternalCounters.SHADOW_FETCH_OPERATION_COUNT, (2*NUM_LDAP_ENTRIES)/100+2); diff --git a/testing/longtest/src/test/java/com/evolveum/midpoint/testing/longtest/TestLdapComplex.java b/testing/longtest/src/test/java/com/evolveum/midpoint/testing/longtest/TestLdapComplex.java index 53e78733a37..c5a89119d0f 100644 --- a/testing/longtest/src/test/java/com/evolveum/midpoint/testing/longtest/TestLdapComplex.java +++ b/testing/longtest/src/test/java/com/evolveum/midpoint/testing/longtest/TestLdapComplex.java @@ -140,20 +140,20 @@ public void test100BigImport() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); //task.setExtensionPropertyValue(SchemaConstants.MODEL_EXTENSION_WORKER_THREADS, 2); modelService.importFromResource(RESOURCE_OPENDJ_OID, new QName(RESOURCE_OPENDJ_NAMESPACE, "inetOrgPerson"), task, result); // THEN - then(TEST_NAME); + then(); OperationResult subresult = result.getLastSubresult(); TestUtil.assertInProgress("importAccountsFromResource result", subresult); waitForTaskFinish(task, true, 20000 + NUM_LDAP_ENTRIES*2000); // THEN - then(TEST_NAME); + then(); int userCount = modelService.countObjects(UserType.class, null, null, task, result); display("Users", userCount); @@ -179,7 +179,7 @@ public void test120BigReconciliation() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); //task.setExtensionPropertyValue(SchemaConstants.MODEL_EXTENSION_WORKER_THREADS, 2); ResourceType resource = modelService.getObject(ResourceType.class, RESOURCE_OPENDJ_OID, null, task, result).asObjectable(); @@ -187,7 +187,7 @@ public void test120BigReconciliation() throws Exception { new QName(RESOURCE_OPENDJ_NAMESPACE, "AccountObjectClass"), task, result); // THEN - then(TEST_NAME); + then(); // TODO // OperationResult subresult = result.getLastSubresult(); // TestUtil.assertInProgress("reconciliation launch result", subresult); @@ -195,7 +195,7 @@ public void test120BigReconciliation() throws Exception { waitForTaskFinish(task, true, 20000 + NUM_LDAP_ENTRIES*2000); // THEN - then(TEST_NAME); + then(); int userCount = modelService.countObjects(UserType.class, null, null, task, result); display("Users", userCount); @@ -218,11 +218,11 @@ public void test500GuybrushAssignSecurity() throws Exception { addObject(USER_GUYBRUSH_FILE); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_GUYBRUSH_OID, RESOURCE_OPENDJ_OID, INTENT_SECURITY, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); @@ -252,11 +252,11 @@ public void test502RuinGuybrushAccountAndReconcile() throws Exception { openDJController.assertHasNoObjectClass(entryBefore, OBJECTCLASS_USER_SECURITY_INFORMATION); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_GUYBRUSH_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_GUYBRUSH_OID); diff --git a/testing/longtest/src/test/java/com/evolveum/midpoint/testing/longtest/TestRunAs.java b/testing/longtest/src/test/java/com/evolveum/midpoint/testing/longtest/TestRunAs.java index 15f0bbb61d5..edf7c67c3e4 100644 --- a/testing/longtest/src/test/java/com/evolveum/midpoint/testing/longtest/TestRunAs.java +++ b/testing/longtest/src/test/java/com/evolveum/midpoint/testing/longtest/TestRunAs.java @@ -118,11 +118,11 @@ public void test100AssignAccountDummyToBarbossa() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_BARBOSSA_OID, RESOURCE_DUMMY_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_BARBOSSA_OID); @@ -149,11 +149,11 @@ public void test109UnassignAccountDummyFromBarbossa() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignAccountFromUser(USER_BARBOSSA_OID, RESOURCE_DUMMY_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_BARBOSSA_OID); @@ -172,12 +172,12 @@ public void test200CleanupPlain() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_BARBOSSA_OID, UserType.F_ORGANIZATION, task, result /* no value */); modifyUserReplace(USER_BARBOSSA_OID, UserType.F_ORGANIZATIONAL_UNIT, task, result /* no value */); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_BARBOSSA_OID); @@ -213,13 +213,13 @@ public void test210BarbossaSetOrganizationPlain() throws Exception { rememberCounter(InternalCounters.REPOSITORY_READ_COUNT); // WHEN - when(TEST_NAME); + when(); long starMillis = System.currentTimeMillis(); modifyUserReplace(USER_BARBOSSA_OID, UserType.F_ORGANIZATION, task, result, createPolyString(ORG_PIRATES)); long endMillis = System.currentTimeMillis(); // THEN - then(TEST_NAME); + then(); assertSuccess(result); long readCountIncremenet = getCounterIncrement(InternalCounters.REPOSITORY_READ_COUNT); @@ -243,12 +243,12 @@ public void test300CleanupRunAs() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_BARBOSSA_OID, UserType.F_ORGANIZATION, task, result /* no value */); modifyUserReplace(USER_BARBOSSA_OID, UserType.F_ORGANIZATIONAL_UNIT, task, result /* no value */); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_BARBOSSA_OID); @@ -284,13 +284,13 @@ public void test310BarbossaSetOrganizationRunAs() throws Exception { rememberCounter(InternalCounters.REPOSITORY_READ_COUNT); // WHEN - when(TEST_NAME); + when(); long starMillis = System.currentTimeMillis(); modifyUserReplace(USER_BARBOSSA_OID, UserType.F_ORGANIZATION, task, result, createPolyString(ORG_PIRATES)); long endMillis = System.currentTimeMillis(); // THEN - then(TEST_NAME); + then(); assertSuccess(result); long readCountIncrement = getCounterIncrement(InternalCounters.REPOSITORY_READ_COUNT); @@ -325,7 +325,7 @@ private void warmUp(final String TEST_NAME) throws Exception { rememberCounter(InternalCounters.REPOSITORY_READ_COUNT); // WHEN - when(TEST_NAME); + when(); long firstTime = warmUpRound(0, task, result); long lastTime = 0; long sumTime = firstTime; @@ -335,7 +335,7 @@ private void warmUp(final String TEST_NAME) throws Exception { } // THEN - then(TEST_NAME); + then(); assertSuccess(result); long readCountIncremenet = getCounterIncrement(InternalCounters.REPOSITORY_READ_COUNT); diff --git a/testing/rest/src/test/java/com/evolveum/midpoint/testing/rest/TestAbstractRestService.java b/testing/rest/src/test/java/com/evolveum/midpoint/testing/rest/TestAbstractRestService.java index bec83ffed9c..222f11d87f7 100644 --- a/testing/rest/src/test/java/com/evolveum/midpoint/testing/rest/TestAbstractRestService.java +++ b/testing/rest/src/test/java/com/evolveum/midpoint/testing/rest/TestAbstractRestService.java @@ -145,10 +145,10 @@ public void test001GetUserAdministrator() { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.get(); - then(TEST_NAME); + then(); assertStatus(response, 200); UserType userType = response.readEntity(UserType.class); assertNotNull("Returned entity in body must not be null.", userType); @@ -168,10 +168,10 @@ public void test002GetNonExistingUser() { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.get(); - then(TEST_NAME); + then(); assertStatus(response, 404); OperationResultType result = response.readEntity(OperationResultType.class); assertNotNull("Error response must contain operation result", result); @@ -192,10 +192,10 @@ public void test003GetNoAuthHeaders() { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.get(); - then(TEST_NAME); + then(); assertStatus(response, 401); display("Audit", getDummyAuditService()); @@ -212,10 +212,10 @@ public void test004GetAuthBadUsernameNullPassword() { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.get(); - then(TEST_NAME); + then(); assertStatus(response, 401); display("Audit", getDummyAuditService()); @@ -232,10 +232,10 @@ public void test005GetAuthBadUsernameEmptyPassword() { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.get(); - then(TEST_NAME); + then(); assertStatus(response, 401); display("Audit", getDummyAuditService()); @@ -252,10 +252,10 @@ public void test006GetAuthBadUsernameBadPassword() { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.get(); - then(TEST_NAME); + then(); assertStatus(response, 401); display("Audit", getDummyAuditService()); @@ -272,10 +272,10 @@ public void test007GetAuthNoPassword() { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.get(); - then(TEST_NAME); + then(); assertStatus(response, 401); display("Audit", getDummyAuditService()); @@ -292,10 +292,10 @@ public void test016GetAuthBadPassword() { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.get(); - then(TEST_NAME); + then(); assertStatus(response, 401); display("Audit", getDummyAuditService()); @@ -312,10 +312,10 @@ public void test017GetUnauthorizedUser() { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.get(); - then(TEST_NAME); + then(); assertStatus(response, 401); display("Audit", getDummyAuditService()); @@ -332,10 +332,10 @@ public void test018GetUserAdministratorByCyclops() { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.get(); - then(TEST_NAME); + then(); assertStatus(response, 403); display("Audit", getDummyAuditService()); @@ -352,10 +352,10 @@ public void test019GetUserAdministratorBySomebody() { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.get(); - then(TEST_NAME); + then(); assertStatus(response, 200); @@ -377,10 +377,10 @@ public void test102AddUserTemplate() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(USER_TEMPLATE_FILE)); - then(TEST_NAME); + then(); displayResponse(response); assertStatus(response, 201); @@ -400,10 +400,10 @@ public void test103AddUserBadTargetCollection() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(USER_DARTHADDER_FILE)); - then(TEST_NAME); + then(); displayResponse(response); assertStatus(response, 400); @@ -427,10 +427,10 @@ public void test104AddAccountRawResourceDoesNotExist() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(ACCOUT_CHUCK_FILE)); - then(TEST_NAME); + then(); displayResponse(response); // expecting hadnled error because resource doesn't exist.. it is OK, but let's say admin about that @@ -466,10 +466,10 @@ public void test120AddRoleAdder() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(ROLE_ADDER_FILE)); - then(TEST_NAME); + then(); displayResponse(response); assertStatus(response, 201); @@ -488,10 +488,10 @@ public void test121AddUserDarthAdder() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(USER_DARTHADDER_FILE)); - then(TEST_NAME); + then(); displayResponse(response); assertStatus(response, 201); @@ -510,10 +510,10 @@ public void test122AddRoleModifierAsDarthAdder() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(ROLE_MODIFIER_FILE)); - then(TEST_NAME); + then(); displayResponse(response); assertStatus(response, 201); @@ -532,10 +532,10 @@ public void test123DarthAdderAssignModifierHimself() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(MiscUtil.readFile(getRequestFile(MODIFICATION_ASSIGN_ROLE_MODIFIER))); - then(TEST_NAME); + then(); displayResponse(response); assertStatus(response, 403); OperationResultType result = response.readEntity(OperationResultType.class); @@ -558,10 +558,10 @@ public void test124DarthAdderAssignModifierByAdministrator() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(MiscUtil.readFile(getRequestFile(MODIFICATION_ASSIGN_ROLE_MODIFIER))); - then(TEST_NAME); + then(); displayResponse(response); assertStatus(response, 204); @@ -584,10 +584,10 @@ public void test130DarthAdderDisableHimself() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(MiscUtil.readFile(getRequestFile(MODIFICATION_DISABLE))); - then(TEST_NAME); + then(); displayResponse(response); assertStatus(response, 204); @@ -610,10 +610,10 @@ public void test131GetUserAdministratorByDarthAdder() { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.get(); - then(TEST_NAME); + then(); assertStatus(response, 401); // assertNoEmptyResponse(response); @@ -631,10 +631,10 @@ public void test132DarthAdderEnableByAdministrator() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(MiscUtil.readFile(getRequestFile(MODIFICATION_ENABLE))); - then(TEST_NAME); + then(); displayResponse(response); assertStatus(response, 204); @@ -657,10 +657,10 @@ public void test133GetUserAdministratorByDarthAdder() { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.get(); - then(TEST_NAME); + then(); assertStatus(response, 200); UserType userType = response.readEntity(UserType.class); assertNotNull("Returned entity in body must not be null.", userType); @@ -680,10 +680,10 @@ public void test135AddUserNopasswordAsDarthAdder() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(USER_NOPASSWORD_FILE)); - then(TEST_NAME); + then(); displayResponse(response); assertStatus(response, 201); @@ -702,10 +702,10 @@ public void test140GetUserAdministratorByNopassword() { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.get(); - then(TEST_NAME); + then(); assertStatus(response, 401); // assertNoEmptyResponse(response); @@ -723,10 +723,10 @@ public void test141GetUserAdministratorByNopasswordBadPassword() { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.get(); - then(TEST_NAME); + then(); assertStatus(response, 401); // assertNoEmptyResponse(response); @@ -744,10 +744,10 @@ public void test200searchAllUsers() { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(new QueryType()); - then(TEST_NAME); + then(); displayResponse(response); assertStatus(response, 200); @@ -768,11 +768,11 @@ public void test401AddUserTemplateOverwrite() throws Exception { getDummyAuditService().clear(); // WHEN - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(USER_TEMPLATE_FILE)); // THEN - then(TEST_NAME); + then(); displayResponse(response); assertEquals("Expected 201 but got " + response.getStatus(), 201, response.getStatus()); @@ -802,11 +802,11 @@ public void test410AddFunctionLibraryHello() throws Exception { getDummyAuditService().clear(); // WHEN - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(FUNCTION_LIBRARY_HELLO_FILE)); // THEN - then(TEST_NAME); + then(); displayResponse(response); assertEquals("Expected 201 but got " + response.getStatus(), 201, response.getStatus()); @@ -831,10 +831,10 @@ public void test412GetFunctionLibraryHello() { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.get(); - then(TEST_NAME); + then(); assertStatus(response, 200); FunctionLibraryType libType = response.readEntity(FunctionLibraryType.class); assertNotNull("Returned entity in body must not be null.", libType); @@ -860,10 +860,10 @@ public void test501generateValue() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(POLICY_ITEM_DEFINITION_GENERATE)); - then(TEST_NAME); + then(); displayResponse(response); traceResponse(response); @@ -884,10 +884,10 @@ public void test502generateValueBadPath() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(POLICY_ITEM_DEFINITION_GENERATE_BAD_PATH)); - then(TEST_NAME); + then(); displayResponse(response); assertEquals("Expected 400 but got " + response.getStatus(), 400, response.getStatus()); @@ -906,10 +906,10 @@ public void test503generateValueExecute() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(POLICY_ITEM_DEFINITION_GENERATE_EXECUTE)); - then(TEST_NAME); + then(); displayResponse(response); traceResponse(response); @@ -933,10 +933,10 @@ public void test504checkGeneratedValue() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.get(); - then(TEST_NAME); + then(); displayResponse(response); assertEquals("Expected 200 but got " + response.getStatus(), 200, response.getStatus()); @@ -954,10 +954,10 @@ public void test505generatePasswordExecute() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(POLICY_ITEM_DEFINITION_GENERATE_PASSWORD_EXECUTE)); - then(TEST_NAME); + then(); displayResponse(response); assertEquals("Expected 200 but got " + response.getStatus(), 200, response.getStatus()); @@ -980,10 +980,10 @@ public void test506generateHonorificPrefixNameExecute() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(POLICY_ITEM_DEFINITION_GENERATE_HONORIFIC_PREFIX_EXECUTE)); - then(TEST_NAME); + then(); displayResponse(response); traceResponse(response); @@ -1046,10 +1046,10 @@ public void test510validateValueExplicit() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(POLICY_ITEM_DEFINITION_VALIDATE_EXPLICIT)); - then(TEST_NAME); + then(); displayResponse(response); traceResponse(response); @@ -1070,10 +1070,10 @@ public void test511validateValueExplicitConflict() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(POLICY_ITEM_DEFINITION_VALIDATE_EXPLICIT_CONFLICT)); - then(TEST_NAME); + then(); displayResponse(response); traceResponse(response, true); @@ -1094,10 +1094,10 @@ public void test512validateValueImplicitSingle() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(POLICY_ITEM_DEFINITION_VALIDATE_IMPLICIT_SINGLE)); - then(TEST_NAME); + then(); displayResponse(response); assertEquals("Expected 200 but got " + response.getStatus(), 200, response.getStatus()); @@ -1117,10 +1117,10 @@ public void test513validateValueImplicitMulti() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(POLICY_ITEM_DEFINITION_VALIDATE_IMPLICIT_MULTI)); - then(TEST_NAME); + then(); displayResponse(response); traceResponse(response); @@ -1140,10 +1140,10 @@ public void test514validateValueImplicitMultiConflict() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(POLICY_ITEM_DEFINITION_VALIDATE_IMPLICIT_MULTI_CONFLICT)); - then(TEST_NAME); + then(); displayResponse(response); traceResponse(response); @@ -1164,10 +1164,10 @@ public void test515validatePasswordHistoryConflict() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(POLICY_ITEM_DEFINITION_VALIDATE_PASSWORD_PASSWORD_HISTORY_CONFLICT)); - then(TEST_NAME); + then(); displayResponse(response); traceResponse(response, true); @@ -1188,10 +1188,10 @@ public void test516validateValueExplicitNoValuePolicy() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(POLICY_ITEM_DEFINITION_VALIDATE_EXPLICIT_NO_VALUE_POLICY)); - then(TEST_NAME); + then(); displayResponse(response); traceResponse(response); @@ -1212,10 +1212,10 @@ public void test517generateValueExplicit() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(POLICY_ITEM_DEFINITION_GENERATE_EXPLICIT)); - then(TEST_NAME); + then(); displayResponse(response); traceResponse(response); @@ -1241,10 +1241,10 @@ public void test518validateValueImplicitPassword() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(POLICY_ITEM_DEFINITION_VALIDATE_IMPLICIT_PASSWORD)); - then(TEST_NAME); + then(); displayResponse(response); traceResponse(response); @@ -1270,10 +1270,10 @@ public void test520GeneratePasswordsUsingScripting() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(SCRIPT_GENERATE_PASSWORDS)); - then(TEST_NAME); + then(); displayResponse(response); traceResponse(response); @@ -1324,10 +1324,10 @@ public void test530ModifyValidToUsingScripting() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(SCRIPT_MODIFY_VALID_TO)); - then(TEST_NAME); + then(); displayResponse(response); traceResponse(response); @@ -1457,11 +1457,11 @@ public void test600ModifySecurityQuestionReplaceAnswerId1Existing() throws Excep getDummyAuditService().clear(); // WHEN - when(TEST_NAME); + when(); Response response = client.post(getRequestFile(MODIFICATION_REPLACE_ANSWER_ID_1_VALUE)); // THEN - then(TEST_NAME); + then(); displayResponse(response); traceResponse(response); @@ -1501,11 +1501,11 @@ public void test602ModifySecurityQuestionReplaceTwoAnswersExisting() throws Exce getDummyAuditService().clear(); // WHEN - when(TEST_NAME); + when(); Response response = client.post(getRequestFile(MODIFICATION_REPLACE_TWO_ANSWERS)); // THEN - then(TEST_NAME); + then(); displayResponse(response); traceResponse(response); @@ -1537,11 +1537,11 @@ public void test604ModifySecurityQuestionReplaceNoAnswer() throws Exception { getDummyAuditService().clear(); // WHEN - when(TEST_NAME); + when(); Response response = client.post(getRequestFile(MODIFICATION_REPLACE_NO_ANSWER)); // THEN - then(TEST_NAME); + then(); displayResponse(response); traceResponse(response); @@ -1573,11 +1573,11 @@ public void test606ModifySecurityQuestionReplaceAnswer() throws Exception { getDummyAuditService().clear(); // WHEN - when(TEST_NAME); + when(); Response response = client.post(getRequestFile(MODIFICATION_REPLACE_ANSWER)); // THEN - then(TEST_NAME); + then(); displayResponse(response); traceResponse(response); @@ -1605,10 +1605,10 @@ public void test607validateSecurityAnswerCheckExpressionFail() throws Exception getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(POLICY_ITEM_DEFINITION_VALIDATE_SECURITY_ANSWER_CHECK_EXPRESSION_FAIL)); - then(TEST_NAME); + then(); displayResponse(response); traceResponse(response); @@ -1629,10 +1629,10 @@ public void test608validateSecurityAnswerCheckExpression() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRepoFile(POLICY_ITEM_DEFINITION_VALIDATE_SECURITY_ANSWER_CHECK_EXPRESSION)); - then(TEST_NAME); + then(); displayResponse(response); assertEquals("Expected 200 but got " + response.getStatus(), 200, response.getStatus()); @@ -1702,10 +1702,10 @@ public void test610ModifyPasswordForceChange() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); Response response = client.post(getRequestFile(MODIFICATION_FORCE_PASSWORD_CHANGE)); - then(TEST_NAME); + then(); displayResponse(response); traceResponse(response); @@ -1717,10 +1717,10 @@ public void test610ModifyPasswordForceChange() throws Exception { getDummyAuditService().assertLoginLogout(SchemaConstants.CHANNEL_REST_URI); getDummyAuditService().assertHasDelta(1, ChangeType.MODIFY, UserType.class); - when(TEST_NAME); + when(); response = client.get(); - then(TEST_NAME); + then(); displayResponse(response); assertEquals("Expected 200 but got " + response.getStatus(), 200, response.getStatus()); @@ -1742,13 +1742,13 @@ public void test612ResetPassword() throws Exception { getDummyAuditService().clear(); - when(TEST_NAME); + when(); // ExecuteCredentialResetRequestType executeCredentialResetRequest = new ExecuteCredentialResetRequestType(); // executeCredentialResetRequest.setResetMethod("passwordReset"); // executeCredentialResetRequest.setUserEntry("123passwd456"); Response response = client.post(getRequestFile(EXECUTE_CREDENTIAL_RESET)); - then(TEST_NAME); + then(); displayResponse(response); traceResponse(response); @@ -1760,11 +1760,11 @@ public void test612ResetPassword() throws Exception { getDummyAuditService().assertLoginLogout(SchemaConstants.CHANNEL_REST_URI); getDummyAuditService().assertHasDelta(1, ChangeType.MODIFY, UserType.class); - when(TEST_NAME); + when(); client = prepareClient(); response = client.path("/users/" + USER_DARTHADDER_OID).get(); - then(TEST_NAME); + then(); displayResponse(response); assertEquals("Expected 200 but got " + response.getStatus(), 200, response.getStatus()); @@ -1787,10 +1787,10 @@ public void test650SuspendNonExistingTask() { WebClient client = prepareClient(); client.path("/tasks/123456/suspend"); - when(TEST_NAME); + when(); Response response = client.post(null); - then(TEST_NAME); + then(); displayResponse(response); assertEquals("Expected 404 but got " + response.getStatus(), 404, response.getStatus()); @@ -1803,10 +1803,10 @@ public void test652SuspendWrongObject() { WebClient client = prepareClient(); client.path("/tasks/00000000-0000-0000-0000-000000000002/suspend"); - when(TEST_NAME); + when(); Response response = client.post(null); - then(TEST_NAME); + then(); displayResponse(response); assertEquals("Expected 400 but got " + response.getStatus(), 400, response.getStatus()); @@ -1819,10 +1819,10 @@ public void test660ResumeNonExistingTask() { WebClient client = prepareClient(); client.path("/tasks/123456/resume"); - when(TEST_NAME); + when(); Response response = client.post(null); - then(TEST_NAME); + then(); displayResponse(response); assertEquals("Expected 404 but got " + response.getStatus(), 404, response.getStatus()); @@ -1835,10 +1835,10 @@ public void test662ResumeWrongObject() { WebClient client = prepareClient(); client.path("/tasks/00000000-0000-0000-0000-000000000002/resume"); - when(TEST_NAME); + when(); Response response = client.post(null); - then(TEST_NAME); + then(); displayResponse(response); assertEquals("Expected 400 but got " + response.getStatus(), 400, response.getStatus()); @@ -1851,10 +1851,10 @@ public void test670ScheduleNonExistingTask() { WebClient client = prepareClient(); client.path("/tasks/123456/run"); - when(TEST_NAME); + when(); Response response = client.post(null); - then(TEST_NAME); + then(); displayResponse(response); assertEquals("Expected 404 but got " + response.getStatus(), 404, response.getStatus()); @@ -1867,10 +1867,10 @@ public void test672ScheduleWrongObject() { WebClient client = prepareClient(); client.path("/tasks/00000000-0000-0000-0000-000000000002/run"); - when(TEST_NAME); + when(); Response response = client.post(null); - then(TEST_NAME); + then(); displayResponse(response); assertEquals("Expected 400 but got " + response.getStatus(), 400, response.getStatus()); @@ -1883,10 +1883,10 @@ public void test680DeleteNonExistingTask() { WebClient client = prepareClient(); client.path("/tasks/123456"); - when(TEST_NAME); + when(); Response response = client.delete(); - then(TEST_NAME); + then(); displayResponse(response); assertEquals("Expected 404 but got " + response.getStatus(), 404, response.getStatus()); @@ -1899,10 +1899,10 @@ public void test682DeleteWrongObject() { WebClient client = prepareClient(); client.path("/tasks/00000000-0000-0000-0000-000000000002"); - when(TEST_NAME); + when(); Response response = client.delete(); - then(TEST_NAME); + then(); displayResponse(response); assertEquals("Expected 400 but got " + response.getStatus(), 400, response.getStatus()); diff --git a/testing/sanity/src/test/java/com/evolveum/midpoint/testing/sanity/TestSanity.java b/testing/sanity/src/test/java/com/evolveum/midpoint/testing/sanity/TestSanity.java index 3fc3469e137..b3d1da1607f 100644 --- a/testing/sanity/src/test/java/com/evolveum/midpoint/testing/sanity/TestSanity.java +++ b/testing/sanity/src/test/java/com/evolveum/midpoint/testing/sanity/TestSanity.java @@ -984,11 +984,11 @@ public void test013AddOpenDjAccountToUser() throws Exception { REQUEST_USER_MODIFY_ADD_ACCOUNT_OPENDJ_FILENAME, ObjectDeltaType.class); // WHEN - when(TEST_NAME); + when(); OperationResultType result = modifyObjectViaModelWS(objectChange); // THEN - then(TEST_NAME); + then(); assertNoRepoCache(); displayJaxb("modifyObject result", result, SchemaConstants.C_RESULT); TestUtil.assertSuccess("modifyObject has failed", result); @@ -1608,11 +1608,11 @@ public void test030DisableUser() throws Exception { assertNoRepoCache(); // WHEN - when(TEST_NAME); + when(); OperationResultType result = modifyObjectViaModelWS(objectChange); // THEN - then(TEST_NAME); + then(); assertNoRepoCache(); displayJaxb("modifyObject result:", result, SchemaConstants.C_RESULT); TestUtil.assertSuccess("modifyObject has failed", result); @@ -1669,12 +1669,12 @@ public void test030DisableUser() throws Exception { assertNoRepoCache(); // WHEN - when(TEST_NAME); + when(); modelWeb.getObject(ObjectTypes.SHADOW.getTypeQName(), accountShadowOidOpendj, options, objectHolder, resultHolder); // THEN - then(TEST_NAME); + then(); assertNoRepoCache(); displayJaxb("getObject result", resultHolder.value, SchemaConstants.C_RESULT); TestUtil.assertSuccess("getObject has failed", resultHolder.value); @@ -2837,7 +2837,7 @@ public void test301LiveSyncCreate() throws Exception { display("Sync token before", tokenBefore.toString()); // WHEN - when(TEST_NAME); + when(); Entry entry = openDJController.addEntryFromLdifFile(LDIF_WILL_FILENAME); display("Entry from LDIF", entry); @@ -2846,7 +2846,7 @@ public void test301LiveSyncCreate() throws Exception { basicWaitForSyncChangeDetection(syncCycle, tokenBefore, 2, result); // THEN - then(TEST_NAME); + then(); // Search for the user that should be created now UserType user = searchUserByName(WILL_NAME); @@ -2917,7 +2917,7 @@ public void test303LiveSyncLink() throws Exception { // AssertJUnit.assertEquals(userOid, oidHolder.value); //WHEN - when(TEST_NAME); + when(); //create account for e which should be correlated final OperationResult result = new OperationResult(TestSanity.class.getName() @@ -2935,7 +2935,7 @@ public void test303LiveSyncLink() throws Exception { basicWaitForSyncChangeDetection(syncCycle, tokenBefore, 1, result); // THEN - then(TEST_NAME); + then(); //check user and account ref userType = searchUserByName("e"); @@ -3061,11 +3061,11 @@ public void test400ImportFromResource() throws Exception { display("Entry from LDIF", addEntry); // WHEN - when(TEST_NAME); + when(); TaskType taskType = modelWeb.importFromResource(RESOURCE_OPENDJ_OID, RESOURCE_OPENDJ_ACCOUNT_OBJECTCLASS); // THEN - then(TEST_NAME); + then(); assertNoRepoCache(); displayJaxb("importFromResource result", taskType.getResult(), SchemaConstants.C_RESULT); AssertJUnit.assertEquals("importFromResource has failed", OperationResultStatusType.IN_PROGRESS, taskType.getResult().getStatus()); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestConfiguredCapabilitiesActivation.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestConfiguredCapabilitiesActivation.java index 79fa02276d9..65a2d3a6cd0 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestConfiguredCapabilitiesActivation.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestConfiguredCapabilitiesActivation.java @@ -86,12 +86,12 @@ public void test100ImportAccount() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modelService.importFromResource(SHADOW_SAMPLE_ACTIVATION_SIMULATED_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); /* List configuredCapabilities = resourceNoAAD.asObjectable().getCapabilities().getConfigured().getAny(); @@ -122,7 +122,7 @@ public void test110AssignJackPirate() throws Exception { //THEN - then(TEST_NAME); + then(); UserAsserter userAfterAsserter = assertUserAfter(USER_JACK_OID); userAfterAsserter .activation() @@ -176,7 +176,7 @@ public void test112ModifyActivationJack() throws Exception { modifyUserReplace(USER_JACK_OID, SchemaConstants.PATH_ACTIVATION_ADMINISTRATIVE_STATUS, task, result, ActivationStatusType.DISABLED); //THEN - then(TEST_NAME); + then(); UserAsserter userAfterAsserter = assertUserAfter(USER_JACK_OID); userAfterAsserter diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestConsistencyMechanism.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestConsistencyMechanism.java index 1a959d3fd8e..515a3e934c3 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestConsistencyMechanism.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestConsistencyMechanism.java @@ -417,11 +417,11 @@ public void test100AddUser() throws Exception { OperationResult repoResult = new OperationResult("getObject"); // WHEN - when(TEST_NAME); + when(); PrismObject uObject = repositoryService.getObject(UserType.class, USER_JACK_OID, null, repoResult); // THEN - then(TEST_NAME); + then(); assertSuccess(repoResult); assertUser(uObject,"repo") @@ -754,7 +754,7 @@ public void test130DeleteObjectNotFound() throws Exception { clockForward("PT20M"); - then(TEST_NAME); + then(); provisioningService.refreshShadow(shadowRepo, null, task, parentResult); try { @@ -813,7 +813,7 @@ public void test140ModifyObjectNotFoundLinkedAccount() throws Exception { // requestToExecuteChanges(REQUEST_ACCOUNT_MODIFY_NOT_FOUND_DELETE_ACCOUNT_FILE, ACCOUNT_GUYBRUSH_OID, ShadowType.class, task, null, result); // THEN - then(TEST_NAME); + then(); PrismObject shadowAfter = getShadowRepo(ACCOUNT_GUYBRUSH_OID); ShadowAsserter.forShadow(shadowAfter) .assertTombstone() @@ -2160,11 +2160,11 @@ public void test283GetObjectNoFetchShadowAndRecompute() throws Exception { .assertNoModification(createAttributePath(LDAP_ATTRIBUTE_EMPLOYEE_TYPE)); //WHEN - when(TEST_NAME); + when(); recomputeUser(USER_DONALD_OID, ModelExecuteOptions.createReconcile(), task, parentResult); //THEN - then(TEST_NAME); + then(); assertModelShadow(shadowOid) .attributes() .assertValue(LDAP_ATTRIBUTE_GIVENNAME, "don") @@ -2196,7 +2196,7 @@ public void test284ModifyObjectAssignToGroupCommunicationProblem() throws Except String shadowOid = getLinkRefOid(USER_DONALD_OID, RESOURCE_OPENDJ_OID); // WHEN - when(TEST_NAME); + when(); AssignmentType adminRoleAssignment = new AssignmentType(prismContext); adminRoleAssignment.setTargetRef(ObjectTypeUtil.createObjectRef(ROLE_LDAP_ADMINS_OID, ObjectTypes.ROLE)); @@ -2305,11 +2305,11 @@ public void test500AddUserMorganWithAssignment() throws Exception { // WHEN - when(TEST_NAME); + when(); addObject(USER_MORGAN_FILE, task, result); // THEN - then(TEST_NAME); + then(); PrismObject userMorgan = modelService.getObject(UserType.class, USER_MORGAN_OID, null, task, result); display("User morgan after", userMorgan); @@ -2416,7 +2416,7 @@ public void test502AssignAccountToHerman() throws Exception { //REQUEST_USER_MODIFY_ADD_ACCOUNT_COMMUNICATION_PROBLEM //WHEN - when(TEST_NAME); + when(); assignAccount(UserType.class, USER_HERMAN_OID, RESOURCE_OPENDJ_OID, "internal", task, result); // THEN diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestDelayedEnable.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestDelayedEnable.java index 46d2e20b741..298f1898120 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestDelayedEnable.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestDelayedEnable.java @@ -117,12 +117,12 @@ public void test100AddUserMancomb() throws Exception { hrCreateTsStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); addObject(USER_MANCOMB_FILE, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); hrCreateTsEnd = clock.currentTimeXMLGregorianCalendar(); @@ -143,12 +143,12 @@ public void test102UserMancombTriggerScannerAgain() throws Exception { displayCurrentTime(); // WHEN - when(TEST_NAME); + when(); runTriggerScanner(); // THEN - then(TEST_NAME); + then(); assertMancombCreated(); @@ -168,12 +168,12 @@ public void test104UserMancombRecompute() throws Exception { displayCurrentTime(); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_MANCOMB_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertMancombCreated(); @@ -210,12 +210,12 @@ public void test110UserMancombRunTriggerScannerDay1() throws Exception { clockForward("P1D"); // WHEN - when(TEST_NAME); + when(); runTriggerScanner(); // THEN - then(TEST_NAME); + then(); assertMancombEnabled(); @@ -236,12 +236,12 @@ public void test112UserMancombRecomputeDay1() throws Exception { clockForward("P1D"); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_MANCOMB_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertMancombEnabled(); @@ -270,12 +270,12 @@ public void test114UserMancombRunTriggerScannerDay1Again() throws Exception { final String TEST_NAME = "test114UserMancombRunTriggerScannerDay1Again"; // WHEN - when(TEST_NAME); + when(); runTriggerScanner(); // THEN - then(TEST_NAME); + then(); assertMancombEnabled(); @@ -293,12 +293,12 @@ public void test116UserMancombRecomputeDay1Again() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_MANCOMB_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertMancombEnabled(); @@ -320,12 +320,12 @@ public void test120UserMancombHrDisable() throws Exception { hrModifyTsStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_MANCOMB_OID, getExtensionPath(EXT_HR_STATUS_QNAME), task, result, EXT_HR_STATUS_DISABLED); // THEN - then(TEST_NAME); + then(); assertSuccess(result); hrModifyTsEnd = clock.currentTimeXMLGregorianCalendar(); @@ -359,12 +359,12 @@ public void test122UserMancombRecompute() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_MANCOMB_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertMancombHalfDisabled(); @@ -380,12 +380,12 @@ public void test124UserMancombDay1TriggerScanner() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); runTriggerScanner(); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertMancombHalfDisabled(); @@ -407,12 +407,12 @@ public void test130UserMancombTriggerScannerDay2() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); runTriggerScanner(); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertMancombDisabled(); @@ -445,12 +445,12 @@ public void test132UserMancombRecomputeDay2() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_MANCOMB_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertMancombDisabled(); @@ -466,12 +466,12 @@ public void test132UserMancombRecomputeDay2Again() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_MANCOMB_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertMancombDisabled(); @@ -493,12 +493,12 @@ public void test140UserMancombRecomputeDay3() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_MANCOMB_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertMancombDisabled(); @@ -516,12 +516,12 @@ public void test200HrLivesyncTask() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); addObject(TASK_DUMMY_HR_FILE, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); waitForTaskStart(TASK_DUMMY_HR_OID, true); @@ -546,12 +546,12 @@ public void test210HrAddUserGuybrush() throws Exception { hrCreateTsStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); syncWithHr(); // THEN - then(TEST_NAME); + then(); assertSuccess(result); hrCreateTsEnd = clock.currentTimeXMLGregorianCalendar(); @@ -572,12 +572,12 @@ public void test212HrUserGuybrushSyncAgain() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); syncWithHr(); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertGuybrushCreated(assertUserAfter(userGuybrushOid)); @@ -595,12 +595,12 @@ public void test214HrUserGuybrushRunTriggers() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); runTriggerScanner(); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertGuybrushCreated(assertUserAfter(userGuybrushOid)); @@ -618,12 +618,12 @@ public void test216HrUserGuybrushRecompute() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); recomputeUser(userGuybrushOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertGuybrushCreated(assertUserAfter(userGuybrushOid)); @@ -641,12 +641,12 @@ public void test218HrUserGuybrushReconcile() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); reconcileUser(userGuybrushOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertGuybrushCreated(assertUserAfter(userGuybrushOid)); @@ -680,12 +680,12 @@ public void test220HrUserGuybrushDay1() throws Exception { clockForward("P1D"); // WHEN - when(TEST_NAME); + when(); runTriggerScanner(); // THEN - then(TEST_NAME); + then(); assertGuybrushEnabled(); @@ -700,12 +700,12 @@ public void test222HrUserGuybrushDay1SyncAgain() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); syncWithHr(); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertGuybrushEnabled(); @@ -723,12 +723,12 @@ public void test224HrUserGuybrushDay1TriggerScanAgain() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); runTriggerScanner(); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertGuybrushEnabled(); @@ -744,12 +744,12 @@ public void test226HrUserGuybrushDay1Recompute() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); recomputeUser(userGuybrushOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertGuybrushEnabled(); @@ -765,12 +765,12 @@ public void test228HrUserGuybrushDay1Reconcile() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); reconcileUser(userGuybrushOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertGuybrushEnabled(); @@ -804,12 +804,12 @@ public void test230HrDisableGuybrush() throws Exception { hrModifyTsStart = clock.currentTimeXMLGregorianCalendar(); // WHEN - when(TEST_NAME); + when(); syncWithHr(); // THEN - then(TEST_NAME); + then(); hrModifyTsEnd = clock.currentTimeXMLGregorianCalendar(); @@ -823,12 +823,12 @@ public void test232GuybrushHrSyncAgain() throws Exception { final String TEST_NAME = "test232GuybrushHrSyncAgain"; // WHEN - when(TEST_NAME); + when(); syncWithHr(); // THEN - then(TEST_NAME); + then(); assertGuybrushHalfDisabled(); @@ -843,12 +843,12 @@ public void test234GuybrushRecompute() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); recomputeUser(userGuybrushOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertGuybrushHalfDisabled(); @@ -864,12 +864,12 @@ public void test236GuybrushReconcile() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); reconcileUser(userGuybrushOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertGuybrushHalfDisabled(); @@ -884,12 +884,12 @@ public void test238GuybrushrunTriggersAgain() throws Exception { clockForward("PT1H"); // WHEN - when(TEST_NAME); + when(); runTriggerScanner(); // THEN - then(TEST_NAME); + then(); assertGuybrushHalfDisabled(); @@ -920,12 +920,12 @@ public void test240HrUserGuybrushDay2() throws Exception { clockForward("P1D"); // WHEN - when(TEST_NAME); + when(); runTriggerScanner(); // THEN - then(TEST_NAME); + then(); assertGuybrushDisabled(); @@ -940,12 +940,12 @@ public void test242GuybrushRecompute() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); recomputeUser(userGuybrushOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertGuybrushDisabled(); @@ -958,12 +958,12 @@ public void test244GuybrushHrSyncAgain() throws Exception { final String TEST_NAME = "test244GuybrushHrSyncAgain"; // WHEN - when(TEST_NAME); + when(); syncWithHr(); // THEN - then(TEST_NAME); + then(); assertGuybrushDisabled(); @@ -978,12 +978,12 @@ public void test246GuybrushReconcile() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); reconcileUser(userGuybrushOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertGuybrushDisabled(); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestExistentialIssues.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestExistentialIssues.java index a7dadceac97..da29dec8b14 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestExistentialIssues.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestExistentialIssues.java @@ -64,12 +64,12 @@ public void test100DisableUserDescartes() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_DESCARTES_OID, ACTIVATION_ADMINISTRATIVE_STATUS_PATH, task, result, ActivationStatusType.DISABLED); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUserFromRepo(USER_DESCARTES_OID); @@ -92,12 +92,12 @@ public void test110DescartesAssignLazyAccount() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_DESCARTES_OID, RESOURCE_DUMMY_LAZY_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUserFromRepo(USER_DESCARTES_OID); @@ -120,12 +120,12 @@ public void test112EnableDescartes() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_DESCARTES_OID, ACTIVATION_ADMINISTRATIVE_STATUS_PATH, task, result, ActivationStatusType.ENABLED); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUserFromRepo(USER_DESCARTES_OID); @@ -148,12 +148,12 @@ public void test114DisableDescartes() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_DESCARTES_OID, ACTIVATION_ADMINISTRATIVE_STATUS_PATH, task, result, ActivationStatusType.DISABLED); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUserFromRepo(USER_DESCARTES_OID); @@ -176,12 +176,12 @@ public void test116ReenableDescartes() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_DESCARTES_OID, ACTIVATION_ADMINISTRATIVE_STATUS_PATH, task, result, ActivationStatusType.ENABLED); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUserFromRepo(USER_DESCARTES_OID); @@ -204,12 +204,12 @@ public void test120DescartesUnassignLazyAccount() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignAccountFromUser(USER_DESCARTES_OID, RESOURCE_DUMMY_LAZY_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUserFromRepo(USER_DESCARTES_OID); @@ -232,12 +232,12 @@ public void test129DeleteDescartes() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); deleteObject(UserType.class, USER_DESCARTES_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertNoObject(UserType.class, USER_DESCARTES_OID); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestInboundOutboundAssociation.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestInboundOutboundAssociation.java index dc2397998b5..caee18d43ec 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestInboundOutboundAssociation.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestInboundOutboundAssociation.java @@ -103,12 +103,12 @@ public void test100ImportGroupPirates() throws Exception { getDummyResourceDir().addGroup(group); // WHEN - when(TEST_NAME); + when(); liveSyncDir(); // THEN - then(TEST_NAME); + then(); display("dir after", getDummyResourceDir()); @@ -137,11 +137,11 @@ public void test110AssignJackDirAccount() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignAccount(UserType.class, USER_JACK_OID, RESOURCE_DUMMY_DIR_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("dir after", getDummyResourceDir()); @@ -165,11 +165,11 @@ public void test115Stability() throws Exception { final String TEST_NAME = "test110AssignJackDirAccount"; // WHEN - when(TEST_NAME); + when(); liveSyncDir(); // THEN - then(TEST_NAME); + then(); display("dir after", getDummyResourceDir()); @@ -196,12 +196,12 @@ public void test120AddJackToGroupPirates() throws Exception { .replaceAttributeValue(DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_DRINK_NAME, "rum"); // WHEN - when(TEST_NAME); + when(); liveSyncDir(); // THEN - then(TEST_NAME); + then(); display("dir after", getDummyResourceDir()); @@ -228,11 +228,11 @@ public void test130JackUnassignRolePirates() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, rolePiratesOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("dir after", getDummyResourceDir()); @@ -257,11 +257,11 @@ public void test140JackAssignRolePirates() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, rolePiratesOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("dir after", getDummyResourceDir()); @@ -294,11 +294,11 @@ public void test142JackUnAssignDirAccount() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignAccount(UserType.class, USER_JACK_OID, RESOURCE_DUMMY_DIR_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("dir after", getDummyResourceDir()); @@ -329,11 +329,11 @@ public void test149JackUnassignRolePirates() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, rolePiratesOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("dir after", getDummyResourceDir()); @@ -356,11 +356,11 @@ public void test150AssignJackDirAccount() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignAccount(UserType.class, USER_JACK_OID, RESOURCE_DUMMY_DIR_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("dir after", getDummyResourceDir()); @@ -384,11 +384,11 @@ public void test152JackAssignRolePirates() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, rolePiratesOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("dir after", getDummyResourceDir()); @@ -425,11 +425,11 @@ public void test153JackUnassignRolePiratesPreview() throws Exception { null, (Consumer)null, false); // WHEN - when(TEST_NAME); + when(); ModelContext previewContext = previewChanges(focusDelta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertPreviewContext(previewContext) @@ -467,11 +467,11 @@ public void test154JackUnassignRolePirates() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, rolePiratesOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("dir after", getDummyResourceDir()); @@ -499,11 +499,11 @@ public void test159JackUnassignDirAccount() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignAccount(UserType.class, USER_JACK_OID, RESOURCE_DUMMY_DIR_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("dir after", getDummyResourceDir()); @@ -529,11 +529,11 @@ public void test200MancombAssignAccount() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_MANCOMB_OID, RESOURCE_DUMMY_DIR_OID, "default", task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("dir after", getDummyResourceDir()); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestLimitedResources.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestLimitedResources.java index 791da411293..c03a84eec7f 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestLimitedResources.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestLimitedResources.java @@ -73,12 +73,12 @@ public void test000Sanity() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); PrismObject resourceNoAAD = modelService.getObject(ResourceType.class, RESOURCE_DUMMY_NO_ATTRIBUTE_ADD_DELETE_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); List configuredCapabilities = resourceNoAAD.asObjectable().getCapabilities().getConfigured().getAny(); @@ -96,11 +96,11 @@ public void test100AssignJackAccountNoAttributeAddDelete() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_JACK_OID, RESOURCE_DUMMY_NO_ATTRIBUTE_ADD_DELETE_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) @@ -118,12 +118,12 @@ public void test102AddJackOrganizationalUnitTreasureHunt() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserAdd(USER_JACK_OID, UserType.F_ORGANIZATIONAL_UNIT, task, result, createPolyString(OU_TREASURE_HUNT)); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -141,12 +141,12 @@ public void test104AddJackOrganizationalUnitLootingSailing() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserAdd(USER_JACK_OID, UserType.F_ORGANIZATIONAL_UNIT, task, result, createPolyString(OU_LOOTING), createPolyString(OU_SAILING)); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -164,12 +164,12 @@ public void test106DeleteJackOrganizationalUnitLooting() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserDelete(USER_JACK_OID, UserType.F_ORGANIZATIONAL_UNIT, task, result, createPolyString(OU_LOOTING)); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -190,12 +190,12 @@ public void test108DeleteJackOrganizationalUnitTreasureHuntSailing() throws Exce OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserDelete(USER_JACK_OID, UserType.F_ORGANIZATIONAL_UNIT, task, result, createPolyString(OU_TREASURE_HUNT), createPolyString(OU_SAILING)); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_JACK_OID); @@ -213,11 +213,11 @@ public void test109UnassignJackAccountNoAttributeAddDelete() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignAccountFromUser(USER_JACK_OID, RESOURCE_DUMMY_NO_ATTRIBUTE_ADD_DELETE_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) @@ -239,11 +239,11 @@ public void test110AssignJackAccountNoCreate() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_JACK_OID, RESOURCE_DUMMY_NO_CREATE_OID, null, task, result); // THEN - then(TEST_NAME); + then(); display("Result", result); assertSuccess(result, 2); @@ -262,11 +262,11 @@ public void test119UnassignJackAccountNoCreate() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignAccountFromUser(USER_JACK_OID, RESOURCE_DUMMY_NO_CREATE_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestLiveSyncMadness.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestLiveSyncMadness.java index 0ddf08f3d0c..d00dec1ef17 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestLiveSyncMadness.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestLiveSyncMadness.java @@ -122,12 +122,12 @@ public void test100AddHrAccountHerman() throws Exception { dummyResourceHr.addAccount(newAccount); // WHEN - when(TEST_NAME); + when(); restartTask(TASK_LIVE_SYNC_DUMMY_HR_OID); waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_HR_OID, true); // THEN - then(TEST_NAME); + then(); assertUserAfterByUsername(ACCOUNT_HERMAN_USERNAME) .assertFullName(ACCOUNT_HERMAN_FIST_NAME + " " + ACCOUNT_HERMAN_LAST_NAME) .assertTitle("Mr. " + ACCOUNT_HERMAN_LAST_NAME) @@ -160,12 +160,12 @@ public void test110RenameHrAccountHerman() throws Exception { account.replaceAttributeValue(DUMMY_ACCOUNT_ATTRIBUTE_HR_LAST_NAME, ACCOUNT_HT_LAST_NAME); // WHEN - when(TEST_NAME); + when(); restartTask(TASK_LIVE_SYNC_DUMMY_HR_OID); waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_HR_OID, true); // THEN - then(TEST_NAME); + then(); assertUserAfterByUsername(ACCOUNT_HERMAN_USERNAME) .assertFullName(ACCOUNT_HT_FIST_NAME + " " + ACCOUNT_HT_LAST_NAME) .assertTitle("Mr. " + ACCOUNT_HT_LAST_NAME) @@ -199,12 +199,12 @@ public void test112HrAccountHermanEmptyDelta() throws Exception { dummyResourceHr.recordEmptyDeltaForAccountByUsername(ACCOUNT_HERMAN_USERNAME, DummyDeltaType.MODIFY); // WHEN - when(TEST_NAME); + when(); restartTask(TASK_LIVE_SYNC_DUMMY_HR_OID); waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_HR_OID, true); // THEN - then(TEST_NAME); + then(); assertUserAfterByUsername(ACCOUNT_HERMAN_USERNAME) .assertFullName(ACCOUNT_HT_FIST_NAME + " " + ACCOUNT_HT_LAST_NAME) .assertTitle("Mr. " + ACCOUNT_HT_LAST_NAME) diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestMapleLeaf.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestMapleLeaf.java index 2948e4ae570..2282610f438 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestMapleLeaf.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestMapleLeaf.java @@ -158,11 +158,11 @@ public void test001addUser() throws Exception { final String TEST_NAME = "test001addUser"; //when - when(TEST_NAME); + when(); assignAccountToUser(USER_JACK_OID, RESOURCE_OPENDJ_OID, "default"); //then - then(TEST_NAME); + then(); PrismObject user = getUser(USER_JACK_OID); assertNotNull("User is null", user); @@ -189,11 +189,11 @@ public void test002assignRoleSquirrel() throws Exception { final String TEST_NAME = "test002assignRoleSquirrel"; //when - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_SQUIRREL_OID); //then - then(TEST_NAME); + then(); PrismObject user = getUser(USER_JACK_OID); assertNotNull("User is null", user); @@ -220,11 +220,11 @@ public void test003unassignRoleSquirrel() throws Exception { final String TEST_NAME = "test003unassignRoleSquirrel"; //when - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_SQUIRREL_OID); //then - then(TEST_NAME); + then(); PrismObject user = getUser(USER_JACK_OID); assertNotNull("User is null", user); @@ -252,11 +252,11 @@ public void test004assignRoleMapleLeafFaculty() throws Exception { final String TEST_NAME = "test004assignRoleMapleLeafFaculty"; //when - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_MAPLE_LEAF_FACULTY_OID); //then - then(TEST_NAME); + then(); PrismObject user = getUser(USER_JACK_OID); assertNotNull("User is null", user); @@ -292,11 +292,11 @@ public void test005assignRoleMapleLeafGraduate() throws Exception { final String TEST_NAME = "test005assignRoleMapleLeafGraduate"; //when - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_MAPLE_LEAF_GRADUATE_OID); //then - then(TEST_NAME); + then(); PrismObject user = getUser(USER_JACK_OID); assertNotNull("User is null", user); @@ -324,11 +324,11 @@ public void test006unassignRoleMapleLeafFaculty() throws Exception { final String TEST_NAME = "test006unassignRoleMapleLeafFaculty"; //when - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, ROLE_MAPLE_LEAF_FACULTY_OID); //then - then(TEST_NAME); + then(); PrismObject user = getUser(USER_JACK_OID); assertNotNull("User is null", user); @@ -374,7 +374,7 @@ public void test100changePasswordForceChange() throws Exception { AssertJUnit.assertNotNull("Unexpected value in car license: " + carLicenseBefore.getRealValue(), carLicenseBefore.getRealValue()); //when - when(TEST_NAME); + when(); passwd = new ProtectedStringType(); passwd.setClearValue("somenewValue"); userDelta = createModifyUserReplaceDelta(USER_JACK_OID, SchemaConstants.PATH_PASSWORD_VALUE, passwd); @@ -384,7 +384,7 @@ public void test100changePasswordForceChange() throws Exception { //THEN - then(TEST_NAME); + then(); PrismObject userAfter = getUser(USER_JACK_OID); UserType userTypeAfter = userAfter.asObjectable(); @@ -416,7 +416,7 @@ public void test101resetPassword() throws Exception { openDJController.assertPassword("uid=jack,ou=People,dc=example,dc=com", "oldValue"); //when - when(TEST_NAME); + when(); PrismObject user = getUser(USER_JACK_OID); ExecuteCredentialResetRequestType executeCredentialResetRequest = new ExecuteCredentialResetRequestType(); executeCredentialResetRequest.setResetMethod("passwordReset"); @@ -424,7 +424,7 @@ public void test101resetPassword() throws Exception { modelInteractionService.executeCredentialsReset(user, executeCredentialResetRequest, task, result); //THEN - then(TEST_NAME); + then(); PrismObject userAfter = getUser(USER_JACK_OID); UserType userTypeAfter = userAfter.asObjectable(); @@ -476,7 +476,7 @@ public void test201SetUndefinedAdministrativeStatus() throws Exception { assertNotLinked(USER_JACK_OID, accountOid); //THEN - then(TEST_NAME); + then(); modelService.importFromResource(accountOid, task, result); PrismObject userAfter = getUser(USER_JACK_OID); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestMappingMadness.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestMappingMadness.java index 21479a6e6ed..3498d4e043d 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestMappingMadness.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestMappingMadness.java @@ -88,7 +88,7 @@ public void test100AssignJackDummyAccounts() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_JACK_OID, RESOURCE_DUMMY_TOLERANT_OID, null, task, result); assignAccountToUser(USER_JACK_OID, RESOURCE_DUMMY_TOLERANT_RANGE_OID, null, task, result); @@ -96,7 +96,7 @@ public void test100AssignJackDummyAccounts() throws Exception { assignAccountToUser(USER_JACK_OID, RESOURCE_DUMMY_NONTOLERANT_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertJackPirateAccount(RESOURCE_DUMMY_TOLERANT_NAME); @@ -119,12 +119,12 @@ public void test105ModifyJackTitleCaptain() throws Exception { setAccountQuotes(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_TITLE, task, result, createPolyString(JACK_TITLE_CAPTAIN)); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertDummyAccountByUsername(RESOURCE_DUMMY_TOLERANT_NAME, USER_JACK_USERNAME) @@ -189,12 +189,12 @@ public void test110ModifyJackTitleWhatever() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_TITLE, task, result, createPolyString(JACK_TITLE_WHATEVER_UPPER)); // THEN - then(TEST_NAME); + then(); assertSuccess(result); // Mappings return null, which means no value. @@ -262,12 +262,12 @@ public void test112ReconcileJackWhatever() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertDummyAccountByUsername(RESOURCE_DUMMY_TOLERANT_NAME, USER_JACK_USERNAME) @@ -324,12 +324,12 @@ public void test120MadJack() throws Exception { setAccountMad(getDummyAccount(RESOURCE_DUMMY_SMART_RANGE_NAME, USER_JACK_USERNAME)); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertJackMadAccount(RESOURCE_DUMMY_TOLERANT_NAME); @@ -355,12 +355,12 @@ public void test130ModifyJackTitleWhateverLower() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_TITLE, task, result, createPolyString(JACK_TITLE_WHATEVER_LOWER)); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertJackMadAccount(RESOURCE_DUMMY_TOLERANT_NAME); @@ -385,12 +385,12 @@ public void test140ModifyJackTitleEmpty() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_TITLE, task, result /* no value */); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertJackMadAccount(RESOURCE_DUMMY_TOLERANT_NAME); @@ -420,7 +420,7 @@ public void test199UnassignJackDummyAccount() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignAccountFromUser(USER_JACK_OID, RESOURCE_DUMMY_TOLERANT_OID, null, task, result); unassignAccountFromUser(USER_JACK_OID, RESOURCE_DUMMY_TOLERANT_RANGE_OID, null, task, result); @@ -428,7 +428,7 @@ public void test199UnassignJackDummyAccount() throws Exception { unassignAccountFromUser(USER_JACK_OID, RESOURCE_DUMMY_NONTOLERANT_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertNoDummyAccount(RESOURCE_DUMMY_TOLERANT_NAME, USER_JACK_USERNAME); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestMisbehavingResources.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestMisbehavingResources.java index be297c34378..ebc1092b601 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestMisbehavingResources.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestMisbehavingResources.java @@ -58,12 +58,12 @@ public void test010SanityAssignJackDummyAccount() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_JACK_OID, RESOURCE_DUMMY_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertDummyAccountByUsername(null, USER_JACK_USERNAME) @@ -78,12 +78,12 @@ public void test019SanityUnassignJackDummyAccount() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignAccountFromUser(USER_JACK_OID, RESOURCE_DUMMY_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertNoDummyAccount(USER_JACK_USERNAME); @@ -102,12 +102,12 @@ public void test100AssignJackDummyAccountTimeout() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_JACK_OID, RESOURCE_DUMMY_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertInProgress(result); assertNoDummyAccount(USER_JACK_USERNAME); @@ -124,12 +124,12 @@ public void test102AssignJackDummyAccounRetry() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertDummyAccountByUsername(null, USER_JACK_USERNAME) @@ -149,12 +149,12 @@ public void test110ModifyJackDummyAccountTimeout() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_FULL_NAME, task, result, createPolyString(USER_JACK_FULL_NAME_CAPTAIN)); // THEN - then(TEST_NAME); + then(); assertInProgress(result); assertDummyAccountByUsername(null, USER_JACK_USERNAME) @@ -173,12 +173,12 @@ public void test112ModifyJackDummyAccounRetry() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertDummyAccountByUsername(null, USER_JACK_USERNAME) diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestNormalizers.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestNormalizers.java index 580aff0d27a..1b2ffc68d07 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestNormalizers.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestNormalizers.java @@ -91,12 +91,12 @@ public void test100AddUserJack() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); addObject(AbstractStoryTest.USER_JACK_FILE, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUserFromRepo(AbstractStoryTest.USER_JACK_OID); @@ -111,12 +111,12 @@ public void test110AddUserTeleke() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); addObject(USER_TELEKE_FILE, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUserFromRepo(USER_TELEKE_OID); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestNullAttribute.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestNullAttribute.java index efb79ced34e..3dc48c61c9f 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestNullAttribute.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestNullAttribute.java @@ -263,12 +263,12 @@ public void test030UserSmackRemoveAttribute() throws Exception { Collection> deltas = MiscSchemaUtil.createCollection(delta); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getUser(USER_SMACK_OID); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestOperationPerf.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestOperationPerf.java index 4c0fabaff69..47276fc6d25 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestOperationPerf.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestOperationPerf.java @@ -127,12 +127,12 @@ public void testAddUser(final String TEST_NAME, File userFile, String userOid, i long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); addObject(userBefore, task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestOrgSync.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestOrgSync.java index d6ab0a71b0c..4c6145ede8f 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestOrgSync.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestOrgSync.java @@ -481,12 +481,12 @@ public void test108RedskullGoesVegetarian() throws Exception { DummyAccount account = dummyResourceHr.getAccountByUsername(ACCOUNT_REDSKULL_USERNAME); // WHEN - when(TEST_NAME); + when(); account.removeAttributeValue(DUMMY_ACCOUNT_ATTRIBUTE_HR_RESPONSIBILITIES, RESP_CANIBALISM); waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_HR_OID, true); // THEN - then(TEST_NAME); + then(); PrismObject user = findUserByUsername(ACCOUNT_REDSKULL_USERNAME); assertNotNull("No redskull user", user); display("User", user); @@ -519,12 +519,12 @@ public void test109HrDeleteRedskull() throws Exception { Task task = taskManager.createTaskInstance(TestOrgSync.class.getName() + "." + TEST_NAME); // WHEN - when(TEST_NAME); + when(); dummyResourceHr.deleteAccountByName(ACCOUNT_REDSKULL_USERNAME); waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_HR_OID, true); // THEN - then(TEST_NAME); + then(); PrismObject user = findUserByUsername(ACCOUNT_REDSKULL_USERNAME); display("User", user); assertNull("Redskull user not gone", user); @@ -1012,17 +1012,17 @@ public void test500ReconcileOpenDJDefault() throws Exception { reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); importObjectFromFile(TASK_RECON_OPENDJ_DEFAULT_SINGLE_FILE); // THEN - then(TEST_NAME); + then(); waitForTaskFinish(TASK_RECON_OPENDJ_DEFAULT_SINGLE_OID, false, TASK_WAIT_TIMEOUT); waitForTaskCloseOrSuspend(TASK_RECON_OPENDJ_DEFAULT_SINGLE_OID); // THEN - then(TEST_NAME); + then(); reconciliationTaskResultListener.assertResult(RESOURCE_OPENDJ_OID, 0, 17, 0, 0); @@ -1052,17 +1052,17 @@ public void test502ReconcileOpenDJDefaultAgain() throws Exception { reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); restartTask(TASK_RECON_OPENDJ_DEFAULT_SINGLE_OID); // THEN - then(TEST_NAME); + then(); waitForTaskFinish(TASK_RECON_OPENDJ_DEFAULT_SINGLE_OID, false, TASK_WAIT_TIMEOUT); waitForTaskCloseOrSuspend(TASK_RECON_OPENDJ_DEFAULT_SINGLE_OID); // THEN - then(TEST_NAME); + then(); reconciliationTaskResultListener.assertResult(RESOURCE_OPENDJ_OID, 0, 17, 0, 0); @@ -1092,17 +1092,17 @@ public void test510ReconcileOpenDJLdapGroup() throws Exception { reconciliationTaskResultListener.clear(); // WHEN - when(TEST_NAME); + when(); importObjectFromFile(TASK_RECON_OPENDJ_LDAPGROUP_SINGLE_FILE); // THEN - then(TEST_NAME); + then(); waitForTaskFinish(TASK_RECON_OPENDJ_LDAPGROUP_SINGLE_OID, false); waitForTaskCloseOrSuspend(TASK_RECON_OPENDJ_DEFAULT_SINGLE_OID); // THEN - then(TEST_NAME); + then(); reconciliationTaskResultListener.assertResult(RESOURCE_OPENDJ_OID, 0, 2, 0, 0); @@ -1143,17 +1143,17 @@ public void test550ReconcileOpenDJAfterMembershipChange() throws Exception { openDJController.assertNoUniqueMember(RESP_CANIBALISM_DN, ACCOUNT_LEMONHEAD_DN); // WHEN - when(TEST_NAME); + when(); restartTask(TASK_RECON_OPENDJ_DEFAULT_SINGLE_OID); // THEN - then(TEST_NAME); + then(); waitForTaskFinish(TASK_RECON_OPENDJ_DEFAULT_SINGLE_OID, false, TASK_WAIT_TIMEOUT); waitForTaskCloseOrSuspend(TASK_RECON_OPENDJ_DEFAULT_SINGLE_OID); // THEN - then(TEST_NAME); + then(); // Task result PrismObject reconTaskAfter = getTask(TASK_RECON_OPENDJ_DEFAULT_SINGLE_OID); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestPlentyOfAssignments.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestPlentyOfAssignments.java index 9680a9833fe..cdc4d95ee19 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestPlentyOfAssignments.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestPlentyOfAssignments.java @@ -185,12 +185,12 @@ public void test100AddCheese() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); addObject(cheeseBefore, task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -228,12 +228,12 @@ public void test110RecomputeCheese() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_CHEESE_OID, task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -272,12 +272,12 @@ public void test120CheesePreviewChanges() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); ModelContext modelContext = modelInteractionService.previewChanges(MiscSchemaUtil.createCollection(delta), null, task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -329,7 +329,7 @@ public void test200DummyGroups() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); PrismObjectDefinition shadowDef = prismContext.getSchemaRegistry().findObjectDefinitionByCompileTimeClass(ShadowType.class); PrismObjectDefinition roleDef = prismContext.getSchemaRegistry().findObjectDefinitionByCompileTimeClass(RoleType.class); @@ -382,7 +382,7 @@ public void test200DummyGroups() throws Exception { } // THEN - then(TEST_NAME); + then(); assertSuccess(result); Collection dummyGroups = getDummyResource().listGroups(); @@ -412,12 +412,12 @@ public void test210AddBob() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); addObject(userBefore, task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -456,12 +456,12 @@ public void test212RecomputeBob() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_BOB_OID, task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -500,12 +500,12 @@ public void test2124ReconcileBob() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_BOB_OID, task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -567,12 +567,12 @@ public void test220AddAlice() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); addObject(userBefore, task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -612,12 +612,12 @@ public void test222RecomputeAlice() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_ALICE_OID, task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -656,12 +656,12 @@ public void test224ReconcileAlice() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); reconcileUser(USER_ALICE_OID, task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestReconNullValue.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestReconNullValue.java index 689096a3fab..f8b782b990d 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestReconNullValue.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestReconNullValue.java @@ -201,12 +201,12 @@ public void test130AddHonorificPrefix() throws Exception { Collection> deltas = MiscSchemaUtil.createCollection(delta); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getObjectByName(UserType.class, USER_0_NAME); @@ -258,12 +258,12 @@ public void test140dDeleteHonorificPrefixGivenName() throws Exception { Collection> deltas = MiscSchemaUtil.createCollection(delta); // WHEN - when(TEST_NAME); + when(); modelService.executeChanges(deltas, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getObjectByName(UserType.class, USER_0_NAME); @@ -316,14 +316,14 @@ public void test150RemoveTitleRA() throws Exception { dumpLdap(); // WHEN - when(TEST_NAME); + when(); modelService.recompute(UserType.class, userBefore.getOid(), null, task, result); display("LDAP after reconcile"); dumpLdap(); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getObjectByName(UserType.class, USER_0_NAME); @@ -375,14 +375,14 @@ public void test160SetGivenNameAttributeAndReconcile() throws Exception { dumpLdap(); // WHEN - when(TEST_NAME); + when(); modelService.recompute(UserType.class, userBefore.getOid(), null, task, result); display("LDAP after reconcile"); dumpLdap(); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getObjectByName(UserType.class, USER_0_NAME); @@ -427,14 +427,14 @@ public void test170ReplaceGivenNameEmpty() throws Exception { dumpLdap(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(userBefore.getOid(), UserType.F_GIVEN_NAME, task, result /* no value */); display("LDAP after reconcile"); dumpLdap(); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = getObjectByName(UserType.class, USER_0_NAME); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestScience.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestScience.java index b97552521b4..f2a5018b26a 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestScience.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestScience.java @@ -178,11 +178,11 @@ public void test100JackAssignRoleStatistics() throws Exception { display("User before", userBefore); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_STATISTICS_OID, task, result); // WHEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = repositoryService.getObject(UserType.class, USER_JACK_OID, null, result); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestServiceAccounts.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestServiceAccounts.java index 23bdbdcd2d5..faadfa0a273 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestServiceAccounts.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestServiceAccounts.java @@ -89,12 +89,12 @@ public void test100StartSyncTask() throws Exception { assertServices(0); // WHEN - when(TEST_NAME); + when(); importObjectFromFile(TASK_LIVE_SYNC_DUMMY_FILE); // THEN - then(TEST_NAME); + then(); waitForTaskStart(TASK_LIVE_SYNC_DUMMY_OID, true); @@ -115,14 +115,14 @@ public void test101AddServiceAccountSync() throws Exception { ACCOUNT_RUM_STORAGE_DUMMY_FULLNAME); // WHEN - when(TEST_NAME); + when(); getDummyResource().addAccount(account); waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_OID, true); // THEN - then(TEST_NAME); + then(); assertServices(1); @@ -158,7 +158,7 @@ serviceAccountShadowOid, getDummyResourceController().getAttributeFullnamePath() try { // WHEN - when(TEST_NAME); + when(); executeChanges(delta, null, task, result); @@ -166,7 +166,7 @@ serviceAccountShadowOid, getDummyResourceController().getAttributeFullnamePath() } catch (UnsupportedOperationException e) { // THEN - then(TEST_NAME); + then(); display("expected exception", e); } @@ -205,7 +205,7 @@ public void test104DeleteServiceAccount() throws Exception { try { // WHEN - when(TEST_NAME); + when(); executeChanges(delta, null, task, result); @@ -213,7 +213,7 @@ public void test104DeleteServiceAccount() throws Exception { } catch (UnsupportedOperationException e) { // THEN - then(TEST_NAME); + then(); display("expected exception", e); } @@ -248,14 +248,14 @@ public void test108DeleteServiceAccountSync() throws Exception { assertServices(1); // WHEN - when(TEST_NAME); + when(); getDummyResource().deleteAccountByName(ACCOUNT_RUM_STORAGE_DUMMY_USERNAME); waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_DUMMY_OID, true); // THEN - then(TEST_NAME); + then(); assertNoServiceByName(ACCOUNT_RUM_STORAGE_DUMMY_USERNAME); assertServices(0); @@ -269,12 +269,12 @@ public void test109StopLivesyncTask() throws Exception { assertServices(0); // WHEN - when(TEST_NAME); + when(); suspendTask(TASK_LIVE_SYNC_DUMMY_OID); // THEN - then(TEST_NAME); + then(); assertTaskExecutionStatus(TASK_LIVE_SYNC_DUMMY_OID, TaskExecutionStatus.SUSPENDED); } @@ -286,12 +286,12 @@ public void test120StartReconTask() throws Exception { assertServices(0); // WHEN - when(TEST_NAME); + when(); importObjectFromFile(TASK_RECONCILE_DUMMY_FILE); // THEN - then(TEST_NAME); + then(); waitForTaskStart(TASK_RECONCILE_DUMMY_OID, true); @@ -312,14 +312,14 @@ public void test121AddServiceAccountRecon() throws Exception { ACCOUNT_MAGAZINE_DUMMY_FULLNAME); // WHEN - when(TEST_NAME); + when(); getDummyResource().addAccount(account); waitForTaskNextRunAssertSuccess(TASK_RECONCILE_DUMMY_OID, true); // THEN - then(TEST_NAME); + then(); assertServices(1); @@ -338,14 +338,14 @@ public void test128DeleteServiceAccountRecon() throws Exception { assertServices(1); // WHEN - when(TEST_NAME); + when(); getDummyResource().deleteAccountByName(ACCOUNT_MAGAZINE_DUMMY_USERNAME); waitForTaskNextRunAssertSuccess(TASK_RECONCILE_DUMMY_OID, true); // THEN - then(TEST_NAME); + then(); assertNoServiceByName(ACCOUNT_MAGAZINE_DUMMY_USERNAME); assertServices(0); @@ -358,12 +358,12 @@ public void test129StopReconTask() throws Exception { assertServices(1); // WHEN - when(TEST_NAME); + when(); suspendTask(TASK_RECONCILE_DUMMY_OID); // THEN - then(TEST_NAME); + then(); assertTaskExecutionStatus(TASK_RECONCILE_DUMMY_OID, TaskExecutionStatus.SUSPENDED); } @@ -393,7 +393,7 @@ public void test140CreateServiceAccount() throws Exception { try { // WHEN - when(TEST_NAME); + when(); executeChanges(delta, null, task, result); @@ -401,7 +401,7 @@ public void test140CreateServiceAccount() throws Exception { } catch (UnsupportedOperationException e) { // THEN - then(TEST_NAME); + then(); display("expected exception", e); } diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestServiceAccountsClassifier.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestServiceAccountsClassifier.java index 9a274c1ce23..ed369f339ef 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestServiceAccountsClassifier.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestServiceAccountsClassifier.java @@ -81,7 +81,7 @@ public void test001assigneJackEmployeeRole() throws Exception { final String TEST_NAME = "test001assigneJackEmployeeRole"; //WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, ROLE_EMPLOYEE_OID); //THEN @@ -99,7 +99,7 @@ public void test100createServiceJira() throws Exception { addObject(SERVICE_JIRA_FILE); //THEN - then(TEST_NAME); + then(); PrismObject service = getObject(ServiceType.class, SERVICE_JIRA_OID); display("Service magazine after", service); assertNotNull("No magazine service", service); @@ -116,11 +116,11 @@ public void test101jiraAssignResourceNoneEnforcement() throws Exception { //GIVEN //WHEN - when(TEST_NAME); + when(); assignAccount(ServiceType.class, SERVICE_JIRA_OID, RESOURCE_DUMMY_CLASSIFIER_OID, "service"); //THEN - then(TEST_NAME); + then(); PrismObject service = getObject(ServiceType.class, SERVICE_JIRA_OID); display("Service magazine after", service); assertNotNull("No magazine service", service); @@ -137,12 +137,12 @@ public void test150StartReconTask() throws Exception { assertServices(1); // WHEN - when(TEST_NAME); + when(); importObjectFromFile(TASK_RECONCILE_DUMMY_CLASSIFIER_FILE); // THEN - then(TEST_NAME); + then(); waitForTaskStart(TASK_RECONCILE_DUMMY_CLASSIFIER_OID, true); @@ -161,14 +161,14 @@ public void test151LinkServiceAccountRecon() throws Exception { account.setEnabled(true); // WHEN - when(TEST_NAME); + when(); getDummyResource().addAccount(account); waitForTaskNextRunAssertSuccess(TASK_RECONCILE_DUMMY_CLASSIFIER_OID, true); // THEN - then(TEST_NAME); + then(); assertServices(1); PrismObject serviceJirafter = getObject(ServiceType.class, SERVICE_JIRA_OID); @@ -190,14 +190,14 @@ public void test152InactivateUnmatchedAccountRecon() throws Exception { account.setEnabled(true); // WHEN - when(TEST_NAME); + when(); getDummyResource().addAccount(account); waitForTaskNextRunAssertSuccess(TASK_RECONCILE_DUMMY_CLASSIFIER_OID, true); // THEN - then(TEST_NAME); + then(); assertServices(1); @@ -213,7 +213,7 @@ public void test200createServiceGithub() throws Exception { addObject(SERVICE_GITHUB_FILE); //THEN - then(TEST_NAME); + then(); PrismObject service = getObject(ServiceType.class, SERVICE_GITHUB_OID); display("Service github after", service); assertNotNull("No github service", service); @@ -226,11 +226,11 @@ public void test210createAccountGithub() throws Exception { final String TEST_NAME = "test210createAccountGithub"; //WHEN - when(TEST_NAME); + when(); addObject(SHADOW_GITHUB_FILE); // THEN - then(TEST_NAME); + then(); PrismObject shadowGithub = getShadowModel(SHADOW_GITHUB_OID); display("Shadow github after", shadowGithub); @@ -249,11 +249,11 @@ public void test215githubAssignResourceNoneEnforcement() throws Exception { //GIVEN //WHEN - when(TEST_NAME); + when(); assignAccount(ServiceType.class, SERVICE_GITHUB_OID, RESOURCE_DUMMY_CLASSIFIER_OID, "service"); //THEN - then(TEST_NAME); + then(); PrismObject service = getObject(ServiceType.class, SERVICE_GITHUB_OID); display("Service github after", service); assertNotNull("No github service", service); @@ -275,11 +275,11 @@ public void test220linkAccountGithubAndFixIntent() throws Exception { assertNoLinkedAccount(serviceGithubBefore); // WHEN - when(TEST_NAME); + when(); waitForTaskNextRunAssertSuccess(TASK_RECONCILE_DUMMY_CLASSIFIER_OID, true); // THEN - then(TEST_NAME); + then(); assertServices(2); PrismObject serviceGithubAfter = getObject(ServiceType.class, SERVICE_GITHUB_OID); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestShadowsPerformance.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestShadowsPerformance.java index a87c1ed2071..c4d16a6485b 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestShadowsPerformance.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestShadowsPerformance.java @@ -102,11 +102,11 @@ public void test010Sanity() throws Exception { Task task = getTestTask(); // WHEN - when(TEST_NAME); + when(); OperationResult result = modelService.testResource(RESOURCE_DUMMY_OID, task); // THEN - then(TEST_NAME); + then(); result.computeStatusIfUnknown(); assertSuccess(result); } @@ -125,11 +125,11 @@ public void test100ImportAccounts() throws Exception { } // WHEN - when(TEST_NAME); + when(); addTask(TASK_IMPORT_FILE); // THEN - then(TEST_NAME); + then(); Task taskAfter = waitForTaskFinish(TASK_IMPORT_OID, true, SYNC_TASK_WAIT_TIMEOUT); display("task after", prismContext.xmlSerializer().serialize(taskAfter.getUpdatedTaskObject())); @@ -155,11 +155,11 @@ public void test200DeleteAccountsAndReconcile() throws Exception { assertEquals("Wrong # of remaining accounts", 0, dummyResourceCtl.getDummyResource().listAccounts().size()); // WHEN - when(TEST_NAME); + when(); addTask(TASK_RECONCILIATION_FILE); // THEN - then(TEST_NAME); + then(); Task taskAfter = waitForTaskFinish(TASK_RECONCILIATION_OID, true, 0L, SYNC_TASK_WAIT_TIMEOUT, false, 100, null); display("task after", prismContext.xmlSerializer().serialize(taskAfter.getUpdatedTaskObject())); @@ -185,11 +185,11 @@ public void test210DeleteShadows() throws Exception { assertEquals("Wrong # of remaining accounts", 0, dummyResourceCtl.getDummyResource().listAccounts().size()); // WHEN - when(TEST_NAME); + when(); addTask(TASK_BULK_DELETE_FILE); // THEN - then(TEST_NAME); + then(); Task taskAfter = waitForTaskFinish(TASK_BULK_DELETE_OID, true, 0L, SYNC_TASK_WAIT_TIMEOUT, false, 100, null); display("task after", prismContext.xmlSerializer().serialize(taskAfter.getUpdatedTaskObject())); @@ -216,7 +216,7 @@ public void test900Summarize() { display("Summary (" + NUMBER_OF_GENERATED_USERS + " users)", sb.toString()); // THEN - then(TEST_NAME); + then(); // TODO: more thresholds diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestStrings.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestStrings.java index eb138289cec..ae36a4e2de8 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestStrings.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestStrings.java @@ -213,11 +213,11 @@ public void test100SimpleAssignmentStart() throws Exception { dummyTransport.clearMessages(); // WHEN - when(TEST_NAME); + when(); assignRole(userBobOid, roleATest1Oid, task, task.getResult()); // THEN - then(TEST_NAME); + then(); assertNotAssignedRole(getUser(userBobOid), roleATest1Oid); CaseWorkItemType workItem = getWorkItem(task, result); @@ -282,7 +282,7 @@ public void test102SimpleAssignmentApproveByLechuck() throws Exception { CaseWorkItemType workItem = getWorkItem(task, result); // WHEN - when(TEST_NAME); + when(); PrismObject lechuck = getUserFromRepo(userLechuckOid); login(lechuck); workflowService.completeWorkItem(WorkItemId.of(workItem), @@ -290,7 +290,7 @@ public void test102SimpleAssignmentApproveByLechuck() throws Exception { task, result); // THEN - then(TEST_NAME); + then(); login(userAdministrator); List workItems = getWorkItems(task, result); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestThresholds.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestThresholds.java index ce2e78ebcee..3dc5e213d21 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestThresholds.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestThresholds.java @@ -170,7 +170,7 @@ public void test110importAccounts() throws Exception { assertUsers(getNumberOfUsers()); //WHEN - when(TEST_NAME); + when(); OperationResult reconResult = waitForTaskResume(getTaskOid(), false, TASK_IMPORT_TIMEOUT); assertFailure(reconResult); @@ -195,7 +195,7 @@ public void test111importAccountsAgain() throws Exception { assertUsers(getNumberOfUsers()+getProcessedUsers()); //WHEN - when(TEST_NAME); + when(); OperationResult reconResult = waitForTaskResume(getTaskOid(), false, TASK_IMPORT_TIMEOUT); assertFailure(reconResult); @@ -236,7 +236,7 @@ public void test520changeActivationThreeAccounts() throws Exception { openDJController.executeLdifChange(LDIF_CHANGE_ACTIVATION_FILE); //WHEN - when(TEST_NAME); + when(); OperationResult reconResult = waitForTaskResume(getTaskOid(), false, 20000); assertFailure(reconResult); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestThresholdsReconFull.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestThresholdsReconFull.java index 7248b772322..90d8365c2e1 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestThresholdsReconFull.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestThresholdsReconFull.java @@ -90,7 +90,7 @@ public void test610testFullRecon() throws Exception { OperationResult result = createResult(); //WHEN - when(TEST_NAME); + when(); OperationResult reconResult = waitForTaskResume(TASK_RECONCILE_OPENDJ_SIMULATE_EXECUTE_OID, true, 20000); assertSuccess(reconResult); @@ -117,7 +117,7 @@ public void test611testFullRecon() throws Exception { openDJController.delete("uid=user15,ou=People,dc=example,dc=com"); //WHEN - when(TEST_NAME); + when(); OperationResult reconResult = waitForTaskNextRun(TASK_RECONCILE_OPENDJ_SIMULATE_EXECUTE_OID, true, 20000, false); assertSuccess(reconResult); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestUnix.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestUnix.java index a5ee28b4bc2..142f64003b6 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestUnix.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestUnix.java @@ -345,11 +345,11 @@ public void test100AddUserHermanBasic() throws Exception { PrismObject user = createUser(USER_HERMAN_USERNAME, USER_HERMAN_FIST_NAME, USER_HERMAN_LAST_NAME, ROLE_BASIC_OID); // WHEN - when(TEST_NAME); + when(); addObject(user, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_HERMAN_USERNAME); @@ -372,11 +372,11 @@ public void test110AddUserMancombUnix() throws Exception { PrismObject user = createUser(USER_MANCOMB_USERNAME, USER_MANCOMB_FIST_NAME, USER_MANCOMB_LAST_NAME, ROLE_UNIX_OID); // WHEN - when(TEST_NAME); + when(); addObject(user, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_MANCOMB_USERNAME); @@ -400,11 +400,11 @@ public void test111AccountMancombEditObjectClassDefinition() throws Exception { display("shadow", shadow); // WHEN - when(TEST_NAME); + when(); RefinedObjectClassDefinition editObjectClassDefinition = modelInteractionService.getEditObjectClassDefinition(shadow, resourceOpenDj, AuthorizationPhaseType.REQUEST, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); display("OC def", editObjectClassDefinition); @@ -428,11 +428,11 @@ public void test119DeleteUserMancombUnix() throws Exception { PrismObject userBefore = findUserByUsername(USER_MANCOMB_USERNAME); // WHEN - when(TEST_NAME); + when(); deleteObject(UserType.class, userBefore.getOid(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_MANCOMB_USERNAME); @@ -453,11 +453,11 @@ public void test120AddUserLargo() throws Exception { PrismObject user = createUser(USER_LARGO_USERNAME, USER_LARGO_FIST_NAME, USER_LARGO_LAST_NAME, (String)null); // WHEN - when(TEST_NAME); + when(); addObject(user, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_LARGO_USERNAME); @@ -476,11 +476,11 @@ public void test122AssignUserLargoBasic() throws Exception { PrismObject userBefore = findUserByUsername(USER_LARGO_USERNAME); // WHEN - when(TEST_NAME); + when(); assignRole(userBefore.getOid(), ROLE_BASIC_OID); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_LARGO_USERNAME); @@ -506,11 +506,11 @@ public void test124AssignUserLargoUnix() throws Exception { long startTs = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); assignRole(userBefore.getOid(), ROLE_UNIX_OID); // THEN - then(TEST_NAME); + then(); assertSuccess(result); long endTs = System.currentTimeMillis(); @@ -538,11 +538,11 @@ public void test125RecomputeUserLargo() throws Exception { PrismObject userBefore = findUserByUsername(USER_LARGO_USERNAME); // WHEN - when(TEST_NAME); + when(); recomputeUser(userBefore.getOid(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_LARGO_USERNAME); @@ -566,11 +566,11 @@ public void test126UnAssignUserLargoUnix() throws Exception { PrismObject userBefore = findUserByUsername(USER_LARGO_USERNAME); // WHEN - when(TEST_NAME); + when(); unassignRole(userBefore.getOid(), ROLE_UNIX_OID); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_LARGO_USERNAME); @@ -594,11 +594,11 @@ public void test127RecomputeUserLargo() throws Exception { PrismObject userBefore = findUserByUsername(USER_LARGO_USERNAME); // WHEN - when(TEST_NAME); + when(); recomputeUser(userBefore.getOid(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_LARGO_USERNAME); @@ -622,11 +622,11 @@ public void test128UnAssignUserLargoBasic() throws Exception { PrismObject userBefore = findUserByUsername(USER_LARGO_USERNAME); // WHEN - when(TEST_NAME); + when(); unassignRole(userBefore.getOid(), ROLE_BASIC_OID); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_LARGO_USERNAME); @@ -649,11 +649,11 @@ public void test129RecomputeUserLargo() throws Exception { PrismObject userBefore = findUserByUsername(USER_LARGO_USERNAME); // WHEN - when(TEST_NAME); + when(); recomputeUser(userBefore.getOid(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_LARGO_USERNAME); @@ -676,11 +676,11 @@ public void test130AssignUserLargoUnix() throws Exception { PrismObject userBefore = findUserByUsername(USER_LARGO_USERNAME); // WHEN - when(TEST_NAME); + when(); assignRole(userBefore.getOid(), ROLE_UNIX_OID); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_LARGO_USERNAME); @@ -706,11 +706,11 @@ public void test131ReconcileUserLargo() throws Exception { dummyAuditService.clear(); // WHEN - when(TEST_NAME); + when(); reconcileUser(userBefore.getOid(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_LARGO_USERNAME); @@ -764,11 +764,11 @@ public void test132MeddleWithAccountAndReconcileUserLargo() throws Exception { dummyAuditService.clear(); // WHEN - when(TEST_NAME); + when(); reconcileUser(userBefore.getOid(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_LARGO_USERNAME); @@ -815,11 +815,11 @@ public void test133ReconcileUserLargoAgain() throws Exception { dummyAuditService.clear(); // WHEN - when(TEST_NAME); + when(); reconcileUser(userBefore.getOid(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_LARGO_USERNAME); @@ -850,11 +850,11 @@ public void test134AssignUserLargoBasic() throws Exception { dummyAuditService.clear(); // WHEN - when(TEST_NAME); + when(); assignRole(userBefore.getOid(), ROLE_BASIC_OID); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_LARGO_USERNAME); @@ -886,11 +886,11 @@ public void test135UnAssignUserLargoUnix() throws Exception { dummyAuditService.clear(); // WHEN - when(TEST_NAME); + when(); unassignRole(userBefore.getOid(), ROLE_UNIX_OID); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_LARGO_USERNAME); @@ -950,11 +950,11 @@ public void test136MeddleWithAccountAndReconcileUserLargo() throws Exception { dummyAuditService.clear(); // WHEN - when(TEST_NAME); + when(); reconcileUser(userBefore.getOid(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_LARGO_USERNAME); @@ -993,11 +993,11 @@ public void test137ReconcileUserLargoAgain() throws Exception { dummyAuditService.clear(); // WHEN - when(TEST_NAME); + when(); reconcileUser(userBefore.getOid(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_LARGO_USERNAME); @@ -1034,11 +1034,11 @@ public void test138UnAssignUserLargoBasic() throws Exception { PrismObject userBefore = findUserByUsername(USER_LARGO_USERNAME); // WHEN - when(TEST_NAME); + when(); unassignRole(userBefore.getOid(), ROLE_BASIC_OID); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_LARGO_USERNAME); @@ -1063,11 +1063,11 @@ public void test200AddLdapGroupMonkeyIsland() throws Exception { PrismObject role = createLdapGroupRole(ROLE_MONKEY_ISLAND_NAME); // WHEN - when(TEST_NAME); + when(); addObject(role, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject roleAfter = getObject(RoleType.class, role.getOid()); @@ -1091,11 +1091,11 @@ public void test202AssignUserHermanMonkeyIsland() throws Exception { PrismObject user = findUserByUsername(USER_HERMAN_USERNAME); // WHEN - when(TEST_NAME); + when(); assignRole(user.getOid(), roleMonkeyIslandOid); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_HERMAN_USERNAME); @@ -1119,11 +1119,11 @@ public void test210AddUnixGroupVillains() throws Exception { PrismObject role = createUnixGroupRole(ROLE_VILLAINS_NAME, ROLE_META_UNIXGROUP_OID); // WHEN - when(TEST_NAME); + when(); addObject(role, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject roleAfter = getObject(RoleType.class, role.getOid()); @@ -1147,11 +1147,11 @@ public void test211AssignUserLargoUnix() throws Exception { PrismObject userBefore = findUserByUsername(USER_LARGO_USERNAME); // WHEN - when(TEST_NAME); + when(); assignRole(userBefore.getOid(), ROLE_UNIX_OID); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_LARGO_USERNAME); @@ -1175,11 +1175,11 @@ public void test212AssignUserLargoVillains() throws Exception { PrismObject user = findUserByUsername(USER_LARGO_USERNAME); // WHEN - when(TEST_NAME); + when(); assignRole(user.getOid(), roleVillainsOid); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_LARGO_USERNAME); @@ -1205,11 +1205,11 @@ public void test250AddUserRangerBasic() throws Exception { PrismObject user = createUser(USER_RANGER_USERNAME, USER_RANGER_FIST_NAME, USER_RANGER_LAST_NAME, ROLE_BASIC_OID); // WHEN - when(TEST_NAME); + when(); addObject(user, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_RANGER_USERNAME); @@ -1232,11 +1232,11 @@ public void test251AssignUserRangerBasic() throws Exception { PrismObject userBefore = findUserByUsername(USER_RANGER_USERNAME); // WHEN - when(TEST_NAME); + when(); assignRole(userBefore.getOid(), ROLE_BASIC_OID); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_RANGER_USERNAME); @@ -1260,11 +1260,11 @@ public void test252AddUnixGroupRangers() throws Exception { PrismObject role = createUnixGroupRole(ROLE_RANGERS_NAME, ROLE_META_UNIXGROUP2_OID); // WHEN - when(TEST_NAME); + when(); addObject(role, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); PrismObject roleAfter = getObject(RoleType.class, role.getOid()); @@ -1288,11 +1288,11 @@ public void test253AddUnixGroupSeals() throws Exception { PrismObject role = createUnixGroupRole(ROLE_SEALS_NAME, ROLE_META_UNIXGROUP2_OID); // WHEN - when(TEST_NAME); + when(); addObject(role, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); PrismObject roleAfter = getObject(RoleType.class, role.getOid()); @@ -1318,11 +1318,11 @@ public void test254AssignUserRangerRangers() throws Exception { PrismObject user = findUserByUsername(USER_RANGER_USERNAME); // WHEN - when(TEST_NAME); + when(); assignRole(user.getOid(), roleRangersOid); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_RANGER_USERNAME); @@ -1331,7 +1331,7 @@ public void test254AssignUserRangerRangers() throws Exception { assertUser(userAfter, USER_RANGER_USERNAME, USER_RANGER_FIST_NAME, USER_RANGER_LAST_NAME); String accountOid = getSingleLinkOid(userAfter); - then(TEST_NAME); + then(); PrismObject shadow = getShadowModel(accountOid); display("Shadow (model)", shadow); String accountRangerDn = assertPosixAccount(shadow, USER_RANGER_UID_NUMBER); @@ -1359,11 +1359,11 @@ public void test255AssignUserRangerSeals() throws Exception { PrismObject user = findUserByUsername(USER_RANGER_USERNAME); // WHEN - when(TEST_NAME); + when(); assignRole(user.getOid(), roleSealsOid); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_RANGER_USERNAME); @@ -1392,11 +1392,11 @@ public void test256UnAssignUserRangerSealsKeepRangers() throws Exception { PrismObject userBefore = findUserByUsername(USER_RANGER_USERNAME); // WHEN - when(TEST_NAME); + when(); unassignRole(userBefore.getOid(), roleSealsOid); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_RANGER_USERNAME); @@ -1430,11 +1430,11 @@ public void test257RenameUserAndAccountsCheckGroupmembership() throws Exception PrismObject userBefore = findUserByUsername(USER_RANGER_USERNAME); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(userBefore.getOid(), UserType.F_NAME, task, result, new PolyString("usranger", "usranger")); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_RANGER_USERNAME_RENAMED); @@ -1469,11 +1469,11 @@ public void test260DeleteUserUsrangerUnix() throws Exception { PrismObject userBefore = findUserByUsername(USER_RANGER_USERNAME_RENAMED); // WHEN - when(TEST_NAME); + when(); deleteObject(UserType.class, userBefore.getOid(), task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_RANGER_USERNAME_RENAMED); @@ -1495,11 +1495,11 @@ public void test270RenameUnixGroupSeals() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); renameObject(RoleType.class, roleSealsOid, ROLE_WALRUSES_NAME, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); PrismObject roleAfter = getObject(RoleType.class, roleSealsOid); @@ -1532,7 +1532,7 @@ public void test300AddUserCapsizeUnixFail() throws Exception { try { // WHEN - when(TEST_NAME); + when(); addObject(user, task, result); AssertJUnit.fail("Unexpected success"); @@ -1542,7 +1542,7 @@ public void test300AddUserCapsizeUnixFail() throws Exception { } // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertFailure(result); @@ -1574,11 +1574,11 @@ public void test310AddUserWallyUnix() throws Exception { PrismObject user = createUser(USER_WALLY_USERNAME, USER_WALLY_FIST_NAME, USER_WALLY_LAST_NAME, ROLE_UNIX_OID); // WHEN - when(TEST_NAME); + when(); addObject(user, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_WALLY_USERNAME); @@ -1624,11 +1624,11 @@ public void test312AccountWallyRemovePosixObjectclassNative() throws Exception { display("Wally LDAP account before", entryWallyBefore); // WHEN - when(TEST_NAME); + when(); PrismObject shadow = modelService.getObject(ShadowType.class, accountWallyOid, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1674,11 +1674,11 @@ public void test314AccountWallyAddPosixObjectclassNative() throws Exception { display("Wally LDAP account before", entryWallyBefore); // WHEN - when(TEST_NAME); + when(); PrismObject shadow = modelService.getObject(ShadowType.class, accountWallyOid, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1706,11 +1706,11 @@ public void test400ListAllAccountsObjectClass() throws Exception { OPENDJ_ACCOUNT_STRUCTURAL_OBJECTCLASS_NAME, prismContext); // WHEN - when(TEST_NAME); + when(); SearchResultList> objects = modelService.searchObjects(ShadowType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1729,11 +1729,11 @@ public void test401ListAllAccountsKindIntent() throws Exception { display("query", query); // WHEN - when(TEST_NAME); + when(); SearchResultList> objects = modelService.searchObjects(ShadowType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1752,11 +1752,11 @@ public void test402ListLdapGroupsKindIntent() throws Exception { display("query", query); // WHEN - when(TEST_NAME); + when(); SearchResultList> objects = modelService.searchObjects(ShadowType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); result.computeStatus(); TestUtil.assertSuccess(result); @@ -1775,11 +1775,11 @@ public void test403ListUnixGroupsKindIntent() throws Exception { display("query", query); // WHEN - when(TEST_NAME); + when(); SearchResultList> objects = modelService.searchObjects(ShadowType.class, query, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("found objects", objects); @@ -1796,11 +1796,11 @@ public void test500AddUserStan() throws Exception { addRoleAssignment(user, roleMonkeyIslandOid); // WHEN - when(TEST_NAME); + when(); addObject(user, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_STAN_USERNAME); @@ -1841,11 +1841,11 @@ public void test510StanDisablePosixAssocAndReconcile() throws Exception { repositoryService.modifyObject(UserType.class, userStan.getOid(), itemDeltas, result); // WHEN - when(TEST_NAME); + when(); reconcileUser(userStan.getOid(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_STAN_USERNAME); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestUnixTolerantAux.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestUnixTolerantAux.java index 024bd61cb6d..97170f9dcd2 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestUnixTolerantAux.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestUnixTolerantAux.java @@ -118,11 +118,11 @@ public void test140AssignUserLargoBasic() throws Exception { PrismObject userBefore = findUserByUsername(USER_LARGO_USERNAME); // WHEN - when(TEST_NAME); + when(); assignRole(userBefore.getOid(), ROLE_BASIC_OID); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_LARGO_USERNAME); @@ -166,11 +166,11 @@ public void test142MeddleWithAccountAndReconcileUserLargo() throws Exception { dummyAuditService.clear(); // WHEN - when(TEST_NAME); + when(); reconcileUser(userBefore.getOid(), task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_LARGO_USERNAME); @@ -198,11 +198,11 @@ public void test144AssignUserLargoUnix() throws Exception { PrismObject userBefore = findUserByUsername(USER_LARGO_USERNAME); // WHEN - when(TEST_NAME); + when(); assignRole(userBefore.getOid(), ROLE_UNIX_OID); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_LARGO_USERNAME); @@ -228,11 +228,11 @@ public void test146UnassignUserLargoUnix() throws Exception { PrismObject userBefore = findUserByUsername(USER_LARGO_USERNAME); // WHEN - when(TEST_NAME); + when(); unassignRole(userBefore.getOid(), ROLE_UNIX_OID); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_LARGO_USERNAME); @@ -258,11 +258,11 @@ public void test149UnAssignUserLargoBasic() throws Exception { PrismObject userBefore = findUserByUsername(USER_LARGO_USERNAME); // WHEN - when(TEST_NAME); + when(); unassignRole(userBefore.getOid(), ROLE_BASIC_OID); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject userAfter = findUserByUsername(USER_LARGO_USERNAME); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestVillage.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestVillage.java index a4ecef6ab49..29f17288224 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestVillage.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestVillage.java @@ -773,12 +773,12 @@ public void test200CreateUserAssignOrgPwdPolicy() throws Exception { ObjectDelta addUserMikeDelta = DeltaFactory.Object.createAddDelta(userMikeBefore); // WHEN - when(TEST_NAME); + when(); //The user's password has length 4..if the policy is not chosen correctly, it fails modelService.executeChanges(MiscUtil.createCollection(addUserMikeDelta), null, task, result); // THEN - then(TEST_NAME); + then(); assertPartialError(result); //TODO: assert added user @@ -815,11 +815,11 @@ public void test300AddProjectJollyRoger() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); addObject(ORG_PROJECT_JOLLY_ROGER_FILE, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PrismObject org = getObject(OrgType.class, ORG_PROJECT_JOLLY_ROGER_OID); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestWriter.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestWriter.java index 33e204882cf..b8b915efe06 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestWriter.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/TestWriter.java @@ -77,12 +77,12 @@ public void test100AssignJackDummyAccount() throws Exception { modifyUserReplace(USER_JACK_OID, UserType.F_LOCALITY, task, result, createPolyString(USER_JACK_LOCALITY)); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_JACK_OID, RESOURCE_WRITER_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertDummyAccountByUsername(RESOURCE_WRITER_DUMMY_NAME, USER_JACK_USERNAME) @@ -100,12 +100,12 @@ public void test110ModifyCaptainJack() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_FULL_NAME, task, result, createPolyString(USER_JACK_FULL_NAME_CAPTAIN)); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertDummyAccountByUsername(RESOURCE_WRITER_DUMMY_NAME, USER_JACK_USERNAME) diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/TestLdapAssociationPerformance.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/TestLdapAssociationPerformance.java index 3f8401ccfbb..5040f9f9ec4 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/TestLdapAssociationPerformance.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/TestLdapAssociationPerformance.java @@ -170,13 +170,13 @@ public void test010Sanity() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); addObject(ROLE_TEST_FILE, task, result); addObject(USER_TEST_FILE, task, result); // THEN - then(TEST_NAME); + then(); dumpLdap(); openDJController.assertUniqueMember("cn=role-test,ou=groups,dc=example,dc=com", "uid=user-test,ou=people,dc=example,dc=com"); @@ -194,7 +194,7 @@ public void test020GenerateRoles() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); resetPerformanceCollectors(); @@ -210,7 +210,7 @@ public void test020GenerateRoles() throws Exception { IntegrationTestTools.setSilentConsole(false); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); recordDuration(TEST_NAME, (endMillis - startMillis)); @@ -242,7 +242,7 @@ public void test100AddUsers() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); resetPerformanceCollectors(); @@ -271,7 +271,7 @@ public void test100AddUsers() throws Exception { IntegrationTestTools.setSilentConsole(false); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); recordDuration(TEST_NAME, (endMillis - startMillis)); @@ -313,7 +313,7 @@ public void test110RecomputeUsers() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); getRepoPerformanceMonitor().clearGlobalPerformanceInformation(); resetGlobalCachePerformanceCollector(); @@ -323,7 +323,7 @@ public void test110RecomputeUsers() throws Exception { waitForTaskFinish(TASK_RECOMPUTE_1_OID, true, RECOMPUTE_TASK_WAIT_TIMEOUT); // THEN - then(TEST_NAME); + then(); recordDuration(TEST_NAME,getRunDurationMillis(TASK_RECOMPUTE_1_OID)); @@ -357,7 +357,7 @@ public void test120RecomputeUsersNoRoleAndShadowCache() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); getRepoPerformanceMonitor().clearGlobalPerformanceInformation(); resetGlobalCachePerformanceCollector(); @@ -367,7 +367,7 @@ public void test120RecomputeUsersNoRoleAndShadowCache() throws Exception { waitForTaskFinish(TASK_RECOMPUTE_NO_CACHE_OID, true, RECOMPUTE_TASK_WAIT_TIMEOUT); // THEN - then(TEST_NAME); + then(); recordDuration(TEST_NAME,getRunDurationMillis(TASK_RECOMPUTE_NO_CACHE_OID)); @@ -401,7 +401,7 @@ public void test130RecomputeUsersMultinode() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); getRepoPerformanceMonitor().clearGlobalPerformanceInformation(); resetGlobalCachePerformanceCollector(); @@ -413,7 +413,7 @@ public void test130RecomputeUsersMultinode() throws Exception { IntegrationTestTools.setSilentConsole(false); // THEN - then(TEST_NAME); + then(); recordDuration(TEST_NAME, getTreeRunDurationMillis(TASK_RECOMPUTE_MULTINODE_OID)); @@ -449,7 +449,7 @@ public void test140RecomputeUsersMultinodeMultithreaded() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); getRepoPerformanceMonitor().clearGlobalPerformanceInformation(); resetGlobalCachePerformanceCollector(); @@ -461,7 +461,7 @@ public void test140RecomputeUsersMultinodeMultithreaded() throws Exception { IntegrationTestTools.setSilentConsole(false); // THEN - then(TEST_NAME); + then(); recordDuration(TEST_NAME, getTreeRunDurationMillis(TASK_RECOMPUTE_MULTINODE_MULTITHREADED_OID)); @@ -498,7 +498,7 @@ public void test200RecomputeUsersNoDefaultRoleCache() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); PrismObject newConfiguration = parseObject(SYSTEM_CONFIGURATION_NO_ROLE_CACHE_FILE); repositoryService.addObject(newConfiguration, RepoAddOptions.createOverwrite(), result); @@ -510,7 +510,7 @@ public void test200RecomputeUsersNoDefaultRoleCache() throws Exception { waitForTaskFinish(TASK_RECOMPUTE_4_OID, true, RECOMPUTE_TASK_WAIT_TIMEOUT); // THEN - then(TEST_NAME); + then(); recordDuration(TEST_NAME,getRunDurationMillis(TASK_RECOMPUTE_4_OID)); @@ -549,7 +549,7 @@ public void test900Summarize() throws Exception { display("Summary ("+NUMBER_OF_GENERATED_USERS+" users, "+NUMBER_OF_GENERATED_ROLES+" roles)", sb.toString()); // THEN - then(TEST_NAME); + then(); // TODO: more thresholds diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/TestLdapComplex.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/TestLdapComplex.java index fee50ac709c..da122427ed7 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/TestLdapComplex.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/TestLdapComplex.java @@ -204,11 +204,11 @@ public void test010Shadows() throws Exception { ObjectQuery query = ObjectQueryUtil.createResourceQuery(RESOURCE_OPENDJ_OID, prismContext); // WHEN - when(TEST_NAME); + when(); SearchResultList> shadows = repositoryService.searchObjects(ShadowType.class, query, null, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Found shadows", shadows); @@ -225,11 +225,11 @@ public void test050AssignAccountOpenDjSimple() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_JACK_OID, RESOURCE_OPENDJ_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); accountJackOid = assertUserAfter(USER_JACK_OID) @@ -261,11 +261,11 @@ public void test055Shadows() throws Exception { display("Query", query); // WHEN - when(TEST_NAME); + when(); SearchResultList> shadows = repositoryService.searchObjects(ShadowType.class, query, null, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Found shadows", shadows); @@ -279,11 +279,11 @@ public void test059UnassignAccountOpenDjSimple() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignAccountFromUser(USER_JACK_OID, RESOURCE_OPENDJ_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) @@ -312,11 +312,11 @@ public void test100ModifyJackFullNameLang() throws Exception { newFullName.setLang(MiscUtil.paramsToMap(JACK_FULL_NAME_LANG_EN_SK)); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_FULL_NAME, task, result, newFullName); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) @@ -342,11 +342,11 @@ public void test110AssignAccountOpenDjLang() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_JACK_OID, RESOURCE_OPENDJ_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); accountJackOid = assertUserAfter(USER_JACK_OID) @@ -380,11 +380,11 @@ public void test112ModifyJackFullNameLangEnSkRuHr() throws Exception { newFullName.setLang(MiscUtil.paramsToMap(JACK_FULL_NAME_LANG_EN_SK_RU_HR)); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_FULL_NAME, task, result, newFullName); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) @@ -417,11 +417,11 @@ public void test114ModifyJackFullNameLangCzHr() throws Exception { newFullName.setLang(MiscUtil.paramsToMap(JACK_FULL_NAME_LANG_CZ_HR)); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_FULL_NAME, task, result, newFullName); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) @@ -454,11 +454,11 @@ public void test116ModifyJackFullNameLangCaptain() throws Exception { newFullName.setLang(MiscUtil.paramsToMap(JACK_FULL_NAME_LANG_CAPTAIN_EN_CZ_SK)); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_FULL_NAME, task, result, newFullName); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) @@ -489,11 +489,11 @@ public void test118ModifyJackFullNameCaptain() throws Exception { PolyString newFullName = new PolyString(USER_JACK_FULL_NAME_CAPTAIN); // WHEN - when(TEST_NAME); + when(); modifyUserReplace(USER_JACK_OID, UserType.F_FULL_NAME, task, result, newFullName); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) @@ -519,11 +519,11 @@ public void test119UnassignAccountOpenDjLang() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignAccountFromUser(USER_JACK_OID, RESOURCE_OPENDJ_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) @@ -556,11 +556,11 @@ public void test120ModifyJackTitleMap() throws Exception { .asObjectDelta(USER_JACK_OID); // WHEN - when(TEST_NAME); + when(); executeChanges(delta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) @@ -586,11 +586,11 @@ public void test130AssignAccountOpenDjTitleMap() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_JACK_OID, RESOURCE_OPENDJ_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); accountJackOid = assertUserAfter(USER_JACK_OID) @@ -633,11 +633,11 @@ public void test132AssignAccountOpenDjTitleMapAdd() throws Exception { .asObjectDelta(USER_JACK_OID); // WHEN - when(TEST_NAME); + when(); executeChanges(delta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); accountJackOid = assertUserAfter(USER_JACK_OID) @@ -680,11 +680,11 @@ public void test134AssignAccountOpenDjTitleMapDelete() throws Exception { .asObjectDelta(USER_JACK_OID); // WHEN - when(TEST_NAME); + when(); executeChanges(delta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); accountJackOid = assertUserAfter(USER_JACK_OID) @@ -727,11 +727,11 @@ public void test138AssignAccountOpenDjTitleMapReplace() throws Exception { .asObjectDelta(USER_JACK_OID); // WHEN - when(TEST_NAME); + when(); executeChanges(delta, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); accountJackOid = assertUserAfter(USER_JACK_OID) @@ -763,11 +763,11 @@ public void test139UnassignAccountOpenDjTitleMap() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignAccountFromUser(USER_JACK_OID, RESOURCE_OPENDJ_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) @@ -792,11 +792,11 @@ public void test150AssignAccountOpenDj() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_JACK_OID, RESOURCE_OPENDJ_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); accountJackOid = assertUserAfter(USER_JACK_OID) @@ -853,11 +853,11 @@ public void test152JackMultivalueDescriptionGet() throws Exception { .getOid(); // WHEN - when(TEST_NAME); + when(); PrismObject shadow = modelService.getObject(ShadowType.class, accountJackOid, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); PolyString descriptionShadowAttribute = (PolyString) assertShadow(shadow, "Jack's shadow after read") @@ -892,11 +892,11 @@ public void test300Shadows() throws Exception { ObjectQuery query = ObjectQueryUtil.createResourceQuery(RESOURCE_OPENDJ_OID, prismContext); // WHEN - when(TEST_NAME); + when(); SearchResultList> shadows = repositoryService.searchObjects(ShadowType.class, query, null, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Found shadows", shadows); @@ -914,7 +914,7 @@ public void test310SearchLdapAccounts() throws Exception { ObjectQuery query = ObjectQueryUtil.createResourceAndKindIntent(RESOURCE_OPENDJ_OID, ShadowKindType.ACCOUNT, SchemaConstants.INTENT_DEFAULT, prismContext); // WHEN - when(TEST_NAME); + when(); searchObjectsIterative(ShadowType.class, query, o -> display("Found object", o), 4); } @@ -932,11 +932,11 @@ public void test312Shadows() throws Exception { ObjectQuery query = ObjectQueryUtil.createResourceQuery(RESOURCE_OPENDJ_OID, prismContext); // WHEN - when(TEST_NAME); + when(); SearchResultList> shadows = repositoryService.searchObjects(ShadowType.class, query, null, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Found shadows", shadows); @@ -982,7 +982,7 @@ public void test320SearchLdapAccountsBelow() throws Exception { ObjectQuery query = ObjectQueryUtil.createResourceAndKindIntent(RESOURCE_OPENDJ_OID, ShadowKindType.ACCOUNT, SchemaConstants.INTENT_DEFAULT, prismContext); // WHEN - when(TEST_NAME); + when(); searchObjectsIterative(ShadowType.class, query, o -> display("Found object", o), 4); } @@ -998,7 +998,7 @@ public void test400SearchLdapProjectGroups() throws Exception { ObjectQuery query = ObjectQueryUtil.createResourceAndKindIntent(RESOURCE_OPENDJ_OID, ShadowKindType.ENTITLEMENT, INTENT_LDAP_PROJECT_GROUP, prismContext); // WHEN - when(TEST_NAME); + when(); // Group "pirates" already exists searchObjectsIterative(ShadowType.class, query, o -> display("Found object", o), 1); @@ -1015,7 +1015,7 @@ public void test401SearchLdapOrgGroups() throws Exception { ObjectQuery query = ObjectQueryUtil.createResourceAndKindIntent(RESOURCE_OPENDJ_OID, ShadowKindType.ENTITLEMENT, INTENT_LDAP_ORG_GROUP, prismContext); // WHEN - when(TEST_NAME); + when(); searchObjectsIterative(ShadowType.class, query, o -> display("Found object", o), 0); } @@ -1033,11 +1033,11 @@ public void test410CreateProjectKeelhaul() throws Exception { .targetRef(ORG_PROJECT_TOP_OID, OrgType.COMPLEX_TYPE); // WHEN - when(TEST_NAME); + when(); addObject(projectKeelhaul); // THEN - then(TEST_NAME); + then(); PrismObject orgKeelhaul = findObjectByName(OrgType.class, PROJECT_KEELHAUL_NAME); projectKeelhaulOid = orgKeelhaul.getOid(); groupKeelhaulOid = assertOrg(orgKeelhaul, "after") @@ -1062,11 +1062,11 @@ public void test412CreateProjectWalkThePlank() throws Exception { .targetRef(ORG_PROJECT_TOP_OID, OrgType.COMPLEX_TYPE); // WHEN - when(TEST_NAME); + when(); addObject(projectKeelhaul); // THEN - then(TEST_NAME); + then(); PrismObject orgWalkThePlank = findObjectByName(OrgType.class, PROJECT_WALK_THE_PLANK_NAME); projectWalkThePlankOid = orgWalkThePlank.getOid(); groupWalkThePlankOid = assertOrg(orgWalkThePlank, "after") @@ -1094,11 +1094,11 @@ public void test415CreateOrgRumDepartment() throws Exception { .targetRef(ORG_FUNCTIONAL_TOP_OID, OrgType.COMPLEX_TYPE); // WHEN - when(TEST_NAME); + when(); addObject(orgBefore); // THEN - then(TEST_NAME); + then(); PrismObject orgAfter = findObjectByName(OrgType.class, ORG_RUM_DEPARTMENT_NAME); orgRumDepartmentOid = orgAfter.getOid(); assertNotNull("Null org oid", orgRumDepartmentOid); @@ -1133,11 +1133,11 @@ public void test420AssignJackToKeelhaul() throws Exception { .getOid(); // WHEN - when(TEST_NAME); + when(); assignOrg(USER_JACK_OID, projectKeelhaulOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); openDJController.assertUniqueMembers("cn="+PROJECT_KEELHAUL_NAME+",ou=groups,dc=example,dc=com", "uid="+USER_JACK_USERNAME+",ou=people,dc=example,dc=com"); @@ -1173,11 +1173,11 @@ public void test422AssignJackToWalkThePlank() throws Exception { .getOid(); // WHEN - when(TEST_NAME); + when(); assignOrg(USER_JACK_OID, projectWalkThePlankOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); openDJController.assertUniqueMembers("cn="+PROJECT_KEELHAUL_NAME+",ou=groups,dc=example,dc=com", "uid="+USER_JACK_USERNAME+",ou=people,dc=example,dc=com"); @@ -1213,11 +1213,11 @@ public void test424AssignJackToRumDepartment() throws Exception { .getOid(); // WHEN - when(TEST_NAME); + when(); assignOrg(USER_JACK_OID, orgRumDepartmentOid, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); openDJController.assertUniqueMembers("cn="+PROJECT_KEELHAUL_NAME+",ou=groups,dc=example,dc=com", "uid="+USER_JACK_USERNAME+",ou=people,dc=example,dc=com"); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/TestLdapDependency.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/TestLdapDependency.java index 92dc00f4ef5..d9f3d2ad58f 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/TestLdapDependency.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/TestLdapDependency.java @@ -157,12 +157,12 @@ public void test100AddOrgIT() throws Exception { PrismObject orgBefore = createOrg(ORG_IT_NAME, ORG_TOP_OID); // WHEN - when(TEST_NAME); + when(); display("Adding org", orgBefore); addObject(orgBefore, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); dumpOrgTree(); @@ -184,12 +184,12 @@ public void test150AssignFunctionalRoleToITOrg() throws Exception { PrismObject orgBefore = getOrg(ORG_IT_NAME); // WHEN - when(TEST_NAME); + when(); display("orgBefore: ", orgBefore); assignRoleToOrg(orgItOid, ROLE_META_ORG_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); dumpOrgTree(); @@ -213,12 +213,12 @@ public void test170UnassignFunctionalRoleFromITOrg() throws Exception { PrismObject orgBefore = getOrg(ORG_IT_NAME); // WHEN - when(TEST_NAME); + when(); display("unassigning vip role org", orgBefore); unassignRoleFromOrg(orgItOid, ROLE_META_ORG_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); dumpOrgTree(); @@ -243,12 +243,12 @@ public void test200AddOrgHR() throws Exception { PrismObject orgBefore = createOrg(ORG_HR_NAME, ORG_TOP_OID); // WHEN - when(TEST_NAME); + when(); display("Adding org", orgBefore); addObject(orgBefore, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); dumpOrgTree(); @@ -270,13 +270,13 @@ public void test250AssignFunctionalAndVipRoleToHROrg() throws Exception { PrismObject orgBefore = getOrg(ORG_HR_NAME); // WHEN - when(TEST_NAME); + when(); display("orgBefore: ", orgBefore); assignRoleToOrg(orgHrOid, ROLE_META_ORG_OID, task, result); assignRoleToOrg(orgHrOid, ROLE_META_ORG_VIP_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); dumpOrgTree(); @@ -302,12 +302,12 @@ public void test270UnassignVipRoleFromHROrg() throws Exception { PrismObject orgBefore = getOrg(ORG_HR_NAME); // WHEN - when(TEST_NAME); + when(); display("unassigning vip role org", orgBefore); unassignRoleFromOrg(orgHrOid, ROLE_META_ORG_VIP_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); dumpOrgTree(); @@ -334,13 +334,13 @@ public void test280AssignVipAndSuperVipRoleToHROrg() throws Exception { PrismObject orgBefore = getOrg(ORG_HR_NAME); // WHEN - when(TEST_NAME); + when(); display("orgBefore: ", orgBefore); assignRoleToOrg(orgHrOid, ROLE_META_ORG_VIP_OID, task, result); assignRoleToOrg(orgHrOid, ROLE_META_ORG_SUPERVIP_OID, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); dumpOrgTree(); @@ -370,7 +370,7 @@ public void test290UnassignVipRoleFromHROrg() throws Exception { try { // WHEN - when(TEST_NAME); + when(); unassignRoleFromOrg(orgHrOid, ROLE_META_ORG_VIP_OID, task, result); assertNotReached(); @@ -380,7 +380,7 @@ public void test290UnassignVipRoleFromHROrg() throws Exception { } // THEN - then(TEST_NAME); + then(); assertFailure(result); dumpOrgTree(); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/TestLdapMutilated.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/TestLdapMutilated.java index a49eb893d71..11b4c1649aa 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/TestLdapMutilated.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/TestLdapMutilated.java @@ -118,11 +118,11 @@ public void test010Shadows() throws Exception { ObjectQuery query = ObjectQueryUtil.createResourceQuery(RESOURCE_OPENDJ_OID, prismContext); // WHEN - when(TEST_NAME); + when(); SearchResultList> shadows = repositoryService.searchObjects(ShadowType.class, query, null, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Found shadows", shadows); @@ -139,11 +139,11 @@ public void test100AssignAccountOpenDjSimple() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_JACK_OID, RESOURCE_OPENDJ_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); accountJackOid = assertUserAfter(USER_JACK_OID) @@ -173,11 +173,11 @@ public void test105Shadows() throws Exception { display("Query", query); // WHEN - when(TEST_NAME); + when(); SearchResultList> shadows = repositoryService.searchObjects(ShadowType.class, query, null, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Found shadows", shadows); @@ -191,11 +191,11 @@ public void test109UnassignAccountOpenDjSimple() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); unassignAccountFromUser(USER_JACK_OID, RESOURCE_OPENDJ_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); assertUserAfter(USER_JACK_OID) @@ -224,11 +224,11 @@ public void test300Shadows() throws Exception { ObjectQuery query = ObjectQueryUtil.createResourceQuery(RESOURCE_OPENDJ_OID, prismContext); // WHEN - when(TEST_NAME); + when(); SearchResultList> shadows = repositoryService.searchObjects(ShadowType.class, query, null, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Found shadows", shadows); @@ -246,7 +246,7 @@ public void test310SearchLdapAccounts() throws Exception { ObjectQuery query = ObjectQueryUtil.createResourceAndKindIntent(RESOURCE_OPENDJ_OID, ShadowKindType.ACCOUNT, SchemaConstants.INTENT_DEFAULT, prismContext); // WHEN - when(TEST_NAME); + when(); searchObjectsIterative(ShadowType.class, query, o -> display("Found object", o), 0); } @@ -263,11 +263,11 @@ public void test312Shadows() throws Exception { ObjectQuery query = ObjectQueryUtil.createResourceQuery(RESOURCE_OPENDJ_OID, prismContext); // WHEN - when(TEST_NAME); + when(); SearchResultList> shadows = repositoryService.searchObjects(ShadowType.class, query, null, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); display("Found shadows", shadows); @@ -296,11 +296,11 @@ public void test320AssignAccountOpenDj() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); assignAccountToUser(USER_JACK_OID, RESOURCE_OPENDJ_OID, null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); accountJackOid = assertUserAfter(USER_JACK_OID) @@ -326,7 +326,7 @@ public void test322SearchLdapAccounts() throws Exception { ObjectQuery query = ObjectQueryUtil.createResourceAndKindIntent(RESOURCE_OPENDJ_OID, ShadowKindType.ACCOUNT, SchemaConstants.INTENT_DEFAULT, prismContext); // WHEN - when(TEST_NAME); + when(); searchObjectsIterative(ShadowType.class, query, o -> display("Found object", o), 1); } diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/TestLdapReconPerformance.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/TestLdapReconPerformance.java index f96c9536d51..2cd7a79ce71 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/TestLdapReconPerformance.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/TestLdapReconPerformance.java @@ -112,7 +112,7 @@ public void test010GenerateUsers() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); // Add objects using model, we also want to create LDAP accounts generateObjects(UserType.class, NUMBER_OF_GENERATED_USERS, GENERATED_USER_NAME_FORMAT, GENERATED_USER_OID_FORMAT, (user,i) -> { @@ -128,7 +128,7 @@ public void test010GenerateUsers() throws Exception { result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); recordDuration(TEST_NAME, (endMillis - startMillis)); @@ -154,13 +154,13 @@ public void test100Reconcile1ThreadLdap0() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); addTask(TASK_RECON_1_OPENDJ_FILE); waitForTaskFinish(TASK_RECON_1_OPENDJ_OID, true, RECON_TASK_WAIT_TIMEOUT); // THEN - then(TEST_NAME); + then(); recordDuration(TEST_NAME,getRunDurationMillis(TASK_RECON_1_OPENDJ_OID)); @@ -197,13 +197,13 @@ public void test200ReconcileLdap0() throws Exception { OperationResult result = task.getResult(); // WHEN - when(TEST_NAME); + when(); addTask(TASK_RECON_4_OPENDJ_FILE); waitForTaskFinish(TASK_RECON_4_OPENDJ_OID, true, RECON_TASK_WAIT_TIMEOUT); // THEN - then(TEST_NAME); + then(); recordDuration(TEST_NAME,getRunDurationMillis(TASK_RECON_4_OPENDJ_OID)); @@ -278,13 +278,13 @@ private long testReconcileLdapRestartWhen(final String TEST_NAME, String taskOid rememberConnectorResourceCounters(); // WHEN - when(TEST_NAME); + when(); restartTask(taskOid); waitForTaskFinish(taskOid, true, RECON_TASK_WAIT_TIMEOUT); // THEN - then(TEST_NAME); + then(); long duration = recordDuration(TEST_NAME, getRunDurationMillis(taskOid)); @@ -312,7 +312,7 @@ public void test900Summarize() throws Exception { display("Summary ("+NUMBER_OF_GENERATED_USERS+" users)", sb.toString()); // THEN - then(TEST_NAME); + then(); if (reconDuration1ThreadBaseline < reconDuration4ThreadBaseline) { fail("Multi-thread recon SLOWER than single-thread! singlethread="+reconDuration1ThreadBaseline+"ms, multithread="+reconDuration4ThreadBaseline+"ms"); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/TestLdapSyncMassive.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/TestLdapSyncMassive.java index 5007adb0cc2..c76ac333cad 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/TestLdapSyncMassive.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/TestLdapSyncMassive.java @@ -21,7 +21,6 @@ import com.evolveum.midpoint.prism.PrismObject; import com.evolveum.midpoint.schema.SearchResultList; -import com.evolveum.midpoint.schema.constants.MidPointConstants; import com.evolveum.midpoint.schema.constants.SchemaConstants; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.schema.util.ObjectTypeUtil; @@ -47,7 +46,6 @@ public class TestLdapSyncMassive extends AbstractLdapTest { public static final File TEST_DIR = new File(LDAP_TEST_DIR, "sync-massive"); private static final String RESOURCE_OPENDJ_OID = "10000000-0000-0000-0000-000000000003"; - private static final String RESOURCE_OPENDJ_NAMESPACE = MidPointConstants.NS_RI; private static final File RESOURCE_OPENDJ_FILE_BAD = new File(TEST_DIR, "resource-opendj-bad.xml"); @@ -59,8 +57,6 @@ public class TestLdapSyncMassive extends AbstractLdapTest { private static final String ACCOUNT_WILL_LDAP_CN = "Will Turner"; private static final File ACCOUNT_KRAKEN_LDIF_FILE = new File(TEST_DIR, "kraken.ldif"); - private static final String ACCOUNT_KRAKEN_LDAP_UID = "kraken"; - private static final String ACCOUNT_KRAKEN_LDAP_CN = "Kraken Krakenoff"; private static final int THREAD_COUNT_TOLERANCE = 10; private static final int THREAD_COUNT_TOLERANCE_BIG = 20; @@ -80,7 +76,6 @@ public class TestLdapSyncMassive extends AbstractLdapTest { */ private static final int INSTANCES_MAX = 3; - private PrismObject resourceOpenDj; private Integer lastSyncToken; private int threadCountBaseline; @@ -112,7 +107,7 @@ public void initSystem(Task initTask, OperationResult initResult) throws Excepti super.initSystem(initTask, initResult); // Resources - resourceOpenDj = importAndGetObjectFromFile(ResourceType.class, getResourceOpenDjFile(), RESOURCE_OPENDJ_OID, initTask, initResult); + PrismObject resourceOpenDj = importAndGetObjectFromFile(ResourceType.class, getResourceOpenDjFile(), RESOURCE_OPENDJ_OID, initTask, initResult); openDJController.setResource(resourceOpenDj); } @@ -133,12 +128,12 @@ public void test080ImportSyncTask() throws Exception { final String TEST_NAME = "test080ImportSyncTask"; // WHEN - when(TEST_NAME); + when(); importObjectFromFile(TASK_LIVE_SYNC_FILE); // THEN - then(TEST_NAME); + then(); waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_OID, true); @@ -166,12 +161,12 @@ public void test110SyncAddWill() throws Exception { display("Entry from LDIF", entry); // WHEN - when(TEST_NAME); + when(); waitForTaskNextRunAssertSuccess(TASK_LIVE_SYNC_OID, true); // THEN - then(TEST_NAME); + then(); assertSyncTokenIncrement(1); @@ -204,14 +199,14 @@ public void test112SyncAddGoods() throws Exception { final String TEST_NAME = "test112SyncAddGoods"; // WHEN - when(TEST_NAME); + when(); for (int i = 0; i < SYNC_ADD_ATTEMPTS; i++) { syncAddAttemptGood("good", i); } // THEN - then(TEST_NAME); + then(); dumpLdap(); @@ -231,7 +226,7 @@ public void test150AddGoblins() throws Exception { final String TEST_NAME = "test150AddGoblins"; // WHEN - when(TEST_NAME); + when(); for (int i = 0; i < NUMBER_OF_GOBLINS; i++) { String username = goblinUsername(i); @@ -244,7 +239,7 @@ public void test150AddGoblins() throws Exception { } // THEN - then(TEST_NAME); + then(); dumpLdap(); assertLdapConnectorInstances(1, INSTANCES_MAX); @@ -303,12 +298,12 @@ public void test210SyncAddKraken() throws Exception { display("Entry from LDIF", entry); // WHEN - when(TEST_NAME); + when(); OperationResult taskResult = waitForTaskNextRun(TASK_LIVE_SYNC_OID); // THEN - then(TEST_NAME); + then(); assertPartialError(taskResult); assertSyncTokenIncrement(0); @@ -338,14 +333,14 @@ public void test212SyncAddBads() throws Exception { final String TEST_NAME = "test212SyncAddBads"; // WHEN - when(TEST_NAME); + when(); for (int i = 0; i < SYNC_ADD_ATTEMPTS; i++) { syncAddAttemptBad("bad", i); } // THEN - then(TEST_NAME); + then(); dumpLdap(); @@ -360,12 +355,12 @@ public void test219StopSyncTask() throws Exception { final String TEST_NAME = "test219StopSyncTask"; // WHEN - when(TEST_NAME); + when(); suspendTask(TASK_LIVE_SYNC_OID); // THEN - then(TEST_NAME); + then(); assertSyncTokenIncrement(0); assertLdapConnectorInstances(1, INSTANCES_MAX); @@ -383,14 +378,14 @@ public void test230UserRecomputeSequential() throws Exception { SearchResultList> users = modelService.searchObjects(UserType.class, null, null, task, result); // WHEN - when(TEST_NAME); + when(); for (PrismObject user : users) { reconcile(user); } // THEN - then(TEST_NAME); + then(); assertLdapConnectorInstances(1, INSTANCES_MAX); assertThreadCount(); @@ -406,7 +401,7 @@ public void test232UserRecomputeParallel() throws Exception { SearchResultList> users = modelService.searchObjects(UserType.class, null, null, task, result); // WHEN - when(TEST_NAME); + when(); int segmentSize = users.size() / NUMBER_OF_TEST_THREADS; ParallelTestThread[] threads = multithread( @@ -419,7 +414,7 @@ public void test232UserRecomputeParallel() throws Exception { }, NUMBER_OF_TEST_THREADS, TEST_THREADS_RANDOM_START_RANGE); // THEN - then(TEST_NAME); + then(); waitForThreads(threads, PARALLEL_TEST_TIMEOUT); // When system is put under load, this means more threads. But not huge number of threads. diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/hierarchy/AbstractLdapHierarchyTest.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/hierarchy/AbstractLdapHierarchyTest.java index e709f451cc9..7cc6a954121 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/hierarchy/AbstractLdapHierarchyTest.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/ldap/hierarchy/AbstractLdapHierarchyTest.java @@ -349,11 +349,11 @@ public void test310RenameUserGorc() throws Exception { USER_GORC_GIVEN_NAME, USER_GORC_FAMILY_NAME, orgCortuvHradOid); // WHEN - when(TEST_NAME); + when(); modifyObjectReplaceProperty(UserType.class, userGorcOid, UserType.F_NAME, task, result, new PolyString(USER_GORC_USERNAME2)); // THEN - then(TEST_NAME); + then(); assertSuccess(result); dumpOrgTree(); @@ -371,12 +371,12 @@ public void test320AddOrgRoyulaDiabolica() throws Exception { PrismObject orgBefore = createOrg(ORG_ROYULA_DIABOLICA_NAME, ORG_TOP_OID); // WHEN - when(TEST_NAME); + when(); display("Adding org", orgBefore); addObject(orgBefore, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); dumpOrgTree(); @@ -414,13 +414,13 @@ public void test322MoveOrgZblo() throws Exception { delta.addModificationAddContainer(OrgType.F_ASSIGNMENT, newAssignmentType); // WHEN - when(TEST_NAME); + when(); display("Modifying " + orgBefore + "with delta", delta); modelService.executeChanges(MiscSchemaUtil.createCollection(delta), null, task, result); // THEN - then(TEST_NAME); + then(); assertSuccess(result); dumpOrgTree(); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/notorious/AbstractNotoriousTest.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/notorious/AbstractNotoriousTest.java index 3a2fd84849e..12072fbb84f 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/notorious/AbstractNotoriousTest.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/notorious/AbstractNotoriousTest.java @@ -176,11 +176,11 @@ public void test100AssignRa0ToJack() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, generateRoleAOid(0), task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -211,11 +211,11 @@ public void test102RecomputeJack() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -249,11 +249,11 @@ public void test104PreviewChangesJack() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); ModelContext modelContext = modelInteractionService.previewChanges(MiscSchemaUtil.createCollection(delta), null, task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -282,11 +282,11 @@ public void test109UnassignRa0FromJack() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, generateRoleAOid(0), task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -315,11 +315,11 @@ public void test110Assign5ARolesToJack() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); assignJackARoles(5, task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -347,11 +347,11 @@ public void test112RecomputeJack() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -379,11 +379,11 @@ public void test119Unassign5ARolesFromJack() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); unassignJackARoles(5, task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -412,11 +412,11 @@ public void test120AssignAllARolesToJack() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); assignJackARoles(NUMBER_OF_LEVEL_A_ROLES, task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -444,11 +444,11 @@ public void test122RecomputeJack() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -482,11 +482,11 @@ public void test124PreviewChangesJack() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); ModelContext modelContext = modelInteractionService.previewChanges(MiscSchemaUtil.createCollection(delta), null, task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -515,11 +515,11 @@ public void test129UnassignAllARolesFromJack() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); unassignJackARoles(NUMBER_OF_LEVEL_A_ROLES, task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -549,11 +549,11 @@ public void test130AssignRb0ToJack() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, generateRoleBOid(0), task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -591,11 +591,11 @@ public void test132AssignRa0ToJack() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, generateRoleAOid(0), task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -626,11 +626,11 @@ public void test134RecomputeJack() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -661,11 +661,11 @@ public void test136UnassignRb0FromJack() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, generateRoleBOid(0), task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -697,11 +697,11 @@ public void test138AssignRb0ToJackAgain() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); assignRole(USER_JACK_OID, generateRoleBOid(0), task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -732,11 +732,11 @@ public void test140RecomputeJackAgain() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -767,11 +767,11 @@ public void test142RecomputeJackAlt() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -802,11 +802,11 @@ public void test144UnassignRa0FromJack() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, generateRoleAOid(0), task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -838,11 +838,11 @@ public void test149UnassignRb0FromJack() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); unassignRole(USER_JACK_OID, generateRoleBOid(0), task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -879,12 +879,12 @@ public void test150AssignNotoriousDefaultToJack() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); modifyAssignmentHolderAssignment(UserType.class, USER_JACK_OID, getNotoriousOid(), getNotoriousType(), null, task, null, null, true, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -921,12 +921,12 @@ public void test152AssignNotoriousAltRelationToJack() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); modifyAssignmentHolderAssignment(UserType.class, USER_JACK_OID, getNotoriousOid(), getNotoriousType(), getAltRelation(), task, null, null, true, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -964,11 +964,11 @@ public void test154RecomputeJack() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -1010,11 +1010,11 @@ public void test156RecomputeJackAlt() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); recomputeUser(USER_JACK_OID, task, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -1052,12 +1052,12 @@ public void test158UnassignNotoriousDefaultFromJack() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); modifyAssignmentHolderAssignment(UserType.class, USER_JACK_OID, getNotoriousOid(), getNotoriousType(), null, task, null, null, false, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); @@ -1093,12 +1093,12 @@ public void test159UnassignNotoriousAltRelationFromJack() throws Exception { long startMillis = System.currentTimeMillis(); // WHEN - when(TEST_NAME); + when(); modifyAssignmentHolderAssignment(UserType.class, USER_JACK_OID, getNotoriousOid(), getNotoriousType(), getAltRelation(), task, null, null, false, result); // THEN - then(TEST_NAME); + then(); long endMillis = System.currentTimeMillis(); assertSuccess(result); diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/security/TestPrivacy.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/security/TestPrivacy.java index 93b6373a6d5..1d32777e2bd 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/security/TestPrivacy.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/security/TestPrivacy.java @@ -79,7 +79,7 @@ public void test100AutzJackReadSearch() throws Exception { login(USER_JACK_USERNAME); // WHEN - when(TEST_NAME); + when(); assertGetAllow(UserType.class, USER_GUYBRUSH_OID); assertGetAllow(UserType.class, USER_ELAINE_OID); @@ -89,7 +89,7 @@ public void test100AutzJackReadSearch() throws Exception { USER_ADMINISTRATOR_OID, USER_GUYBRUSH_OID, USER_ELAINE_OID, USER_JACK_OID); // THEN - then(TEST_NAME); + then(); } diff --git a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/security/TestRoleMembers.java b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/security/TestRoleMembers.java index 44f0e68ae1f..2667cb20ab3 100644 --- a/testing/story/src/test/java/com/evolveum/midpoint/testing/story/security/TestRoleMembers.java +++ b/testing/story/src/test/java/com/evolveum/midpoint/testing/story/security/TestRoleMembers.java @@ -88,7 +88,7 @@ public void test000Sanity() throws Exception { final String TEST_NAME = "test000Sanity"; // WHEN - when(TEST_NAME); + when(); assertUserBefore(USER_GUYBRUSH_OID) .assertName(USER_GUYBRUSH_USERNAME) @@ -124,7 +124,7 @@ public void test000Sanity() throws Exception { assertFalse("Preview evaluated assignment triple is empty", evaluatedAssignmentTriple.isEmpty()); // THEN - then(TEST_NAME); + then(); } @@ -138,7 +138,7 @@ public void test100AutzGuybrushNoMembers() throws Exception { login(USER_GUYBRUSH_USERNAME); // WHEN - when(TEST_NAME); + when(); PrismObject userMancomb = assertGetAllow(UserType.class, USER_MANCOMB_OID); assertUser(userMancomb, "mancomb") @@ -170,7 +170,7 @@ public void test100AutzGuybrushNoMembers() throws Exception { assertNull("Preview evaluated assignment triple sneaked in", evaluatedAssignmentTriple); // THEN - then(TEST_NAME); + then(); } @@ -198,7 +198,7 @@ public void test105AutzElaineMembers() throws Exception { login(USER_ELAINE_USERNAME); // WHEN - when(TEST_NAME); + when(); PrismObject userMancomb = assertGetAllow(UserType.class, USER_MANCOMB_OID); assertUser(userMancomb, "mancomb") @@ -218,7 +218,7 @@ public void test105AutzElaineMembers() throws Exception { .assertRoleMemberhipRefs(1); // THEN - then(TEST_NAME); + then(); }