Skip to content

Commit

Permalink
test classes: another batch of TEST_NAME removal, reformat, cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
virgo47 committed Mar 6, 2020
1 parent c0266eb commit b071201
Show file tree
Hide file tree
Showing 28 changed files with 1,089 additions and 2,224 deletions.
Expand Up @@ -7,32 +7,26 @@
package com.evolveum.midpoint.model.impl;

import java.io.File;

import javax.xml.namespace.QName;

import com.evolveum.midpoint.test.TestResource;

import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.annotation.DirtiesContext.ClassMode;

import com.evolveum.icf.dummy.resource.DummyAccount;
import com.evolveum.midpoint.model.impl.util.mock.MockClockworkHook;
import com.evolveum.midpoint.model.test.AbstractModelIntegrationTest;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.schema.constants.MidPointConstants;
import com.evolveum.midpoint.schema.internals.InternalsConfig;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.test.DummyResourceContoller;
import com.evolveum.midpoint.test.TestResource;
import com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.xml.ns._public.common.common_3.SystemObjectsType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType;

/**
* @author semancik
*
*/
@DirtiesContext(classMode = ClassMode.AFTER_CLASS)
public class AbstractInternalModelIntegrationTest extends AbstractModelImplementationIntegrationTest {
Expand Down Expand Up @@ -66,7 +60,7 @@ public class AbstractInternalModelIntegrationTest extends AbstractModelImplement
protected static final String USER_ELAINE_USERNAME = "elaine";

// Largo does not have a full name set, employeeType=PIRATE
protected static final File USER_LARGO_FILE = new File(COMMON_DIR, "user-largo.xml");
protected static final File USER_LARGO_FILE = new File(COMMON_DIR, "user-largo.xml");
protected static final String USER_LARGO_OID = "c0c010c0-d34d-b33f-f00d-111111111118";

public static final File ROLE_SUPERUSER_FILE = new File(COMMON_DIR, "role-superuser.xml");
Expand Down Expand Up @@ -113,8 +107,6 @@ public class AbstractInternalModelIntegrationTest extends AbstractModelImplement

protected static final String MOCK_CLOCKWORK_HOOK_URL = MidPointConstants.NS_MIDPOINT_TEST_PREFIX + "/mockClockworkHook";

protected static final Trace LOGGER = TraceManager.getTrace(AbstractModelIntegrationTest.class);

protected PrismObject<UserType> userAdministrator;

protected UserType userTypeJack;
Expand All @@ -126,7 +118,7 @@ public class AbstractInternalModelIntegrationTest extends AbstractModelImplement

@Override
public void initSystem(Task initTask, OperationResult initResult) throws Exception {
LOGGER.trace("initSystem");
logger.trace("initSystem");
super.initSystem(initTask, initResult);

// We want logging config from logback-test.xml and not from system config object (unless suppressed)
Expand Down
Expand Up @@ -70,7 +70,7 @@ public void text001testReconcileScriptsWhenProvisioning() throws Exception {
String userName = (String) script.getParams().get("midpoint_usercn");
String idPath = (String) script.getParams().get("midpoint_idpath");
String tempPath = (String) script.getParams().get("midpoint_temppath");
LOGGER.trace("userName {} idPath {} tempPath {}", userName, idPath, tempPath);
logger.trace("userName {} idPath {} tempPath {}", userName, idPath, tempPath);
if (!idPath.contains(userName)) {
AssertJUnit.fail("Expected that idPath will contain userName [idPath: " + idPath + ", userName " + userName + "]");
}
Expand All @@ -97,7 +97,7 @@ public void test002testReconcileScriptsWhenReconciling() throws Exception {
String userName = (String) script.getParams().get("midpoint_usercn");
String idPath = (String) script.getParams().get("midpoint_idpath");
String tempPath = (String) script.getParams().get("midpoint_temppath");
LOGGER.trace("userName {} idPath {} tempPath {}", userName, idPath, tempPath);
logger.trace("userName {} idPath {} tempPath {}", userName, idPath, tempPath);
if (!idPath.contains(userName)) {
AssertJUnit.fail("Expected that idPath will contain userName [idPath: " + idPath + ", userName " + userName + "]");
}
Expand All @@ -110,9 +110,7 @@ public void test002testReconcileScriptsWhenReconciling() throws Exception {

@Test
public void test003testReconcileScriptsAddUserAction() throws Exception {
final String TEST_NAME = "test003testReconcileScriptsAddUserAction";

Task task = taskManager.createTaskInstance(TEST_NAME);
Task task = getTestTask();
OperationResult parentResult = createOperationResult();

ShadowType shadow = parseObjectType(new File(ACCOUNT_BEFORE_SCRIPT_FILENAME), ShadowType.class);
Expand Down Expand Up @@ -140,7 +138,7 @@ public void test003testReconcileScriptsAddUserAction() throws Exception {
String userName = (String) script.getParams().get("midpoint_usercn");
String idPath = (String) script.getParams().get("midpoint_idpath");
String tempPath = (String) script.getParams().get("midpoint_temppath");
LOGGER.trace("userName {} idPath {} tempPath {}", userName, idPath, tempPath);
logger.trace("userName {} idPath {} tempPath {}", userName, idPath, tempPath);
if (!idPath.contains(userName)) {
AssertJUnit.fail("Expected that idPath will contain userName [idPath: " + idPath + ", userName " + userName + "]");
}
Expand Down
Expand Up @@ -161,7 +161,7 @@ public void test004CorrelationMatchCaseInsensitive() throws Exception {

AssertJUnit.assertTrue(matchedUsers);
} catch (Exception ex) {
LOGGER.error("exception occured: {}", ex.getMessage(), ex);
logger.error("exception occured: {}", ex.getMessage(), ex);
throw ex;
}
}
Expand All @@ -185,7 +185,7 @@ public void test005CorrelationMatchCaseInsensitive() throws Exception {

AssertJUnit.assertTrue(matchedUsers);
} catch (Exception ex) {
LOGGER.error("exception occured: {}", ex.getMessage(), ex);
logger.error("exception occured: {}", ex.getMessage(), ex);
throw ex;
}
}
Expand Down
Expand Up @@ -76,7 +76,7 @@ public class TestSynchronizationService extends AbstractInternalModelIntegration

@Override
public void initSystem(Task initTask, OperationResult initResult) throws Exception {
LOGGER.trace("initSystem");
logger.trace("initSystem");
super.initSystem(initTask, initResult);

initDummyResourcePirate(RESOURCE_DUMMY_LIMITED_NAME,
Expand Down

0 comments on commit b071201

Please sign in to comment.