Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2015-12-01 10:49:15 -0500
committerRyan D. Brooks2015-12-01 10:49:15 -0500
commita37e3e01f6bc999a5d3beff251976a79ece1b889 (patch)
tree5509b81fa78d2be39ce60b52c4229622132ee979 /plugins/org.eclipse.osee.ats.core.test
parente49593ed680640365b97802faf6267bd08d20bcf (diff)
downloadorg.eclipse.osee-a37e3e01f6bc999a5d3beff251976a79ece1b889.tar.gz
org.eclipse.osee-a37e3e01f6bc999a5d3beff251976a79ece1b889.tar.xz
org.eclipse.osee-a37e3e01f6bc999a5d3beff251976a79ece1b889.zip
refactor: Use core enum directly in ats users
Diffstat (limited to 'plugins/org.eclipse.osee.ats.core.test')
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/internal/state/StateManagerTest.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/users/CoreAtsUsersTest.java33
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/util/AtsObjectsTest.java12
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workflow/transition/TransitionHelperAdapterTest.java2
4 files changed, 26 insertions, 25 deletions
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/internal/state/StateManagerTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/internal/state/StateManagerTest.java
index e51a334e43..374029d7cb 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/internal/state/StateManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/internal/state/StateManagerTest.java
@@ -111,7 +111,7 @@ public class StateManagerTest extends AbstractUserTest {
stateMgr.addState(new WorkStateImpl("endorse"));
stateMgr.setCurrentStateName("endorse");
- stateMgr.addAssignee(AtsCoreUsers.GUEST_USER);
+ stateMgr.addAssignee(AtsCoreUsers.ANONYMOUS_USER);
}
@Test
@@ -207,7 +207,7 @@ public class StateManagerTest extends AbstractUserTest {
stateMgr.addState(new WorkStateImpl("endorse"));
stateMgr.setCurrentStateName("endorse");
- stateMgr.setAssignee(AtsCoreUsers.GUEST_USER);
+ stateMgr.setAssignee(AtsCoreUsers.ANONYMOUS_USER);
}
@Test
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/users/CoreAtsUsersTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/users/CoreAtsUsersTest.java
index 89e5c7e7a0..39e4989905 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/users/CoreAtsUsersTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/users/CoreAtsUsersTest.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.ats.core.users;
import java.util.HashMap;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.jdk.core.type.UuidIdentity;
@@ -21,7 +22,7 @@ import org.junit.Test;
/**
* Test case for {@link SystemUser}<br/>
- * Test case for {@link Guest}<br/>
+ * Test case for {@link Anonymous}<br/>
* Test case for {@link UnAssigned}<br/>
* Test case for {@link AbstractAtsUser}
*
@@ -31,37 +32,37 @@ public class CoreAtsUsersTest {
@Test
public void testGetDescription() {
- Assert.assertEquals("System User", AtsCoreUsers.SYSTEM_USER.getDescription());
- Assert.assertEquals("Guest", AtsCoreUsers.GUEST_USER.getDescription());
- Assert.assertEquals("UnAssigned", AtsCoreUsers.UNASSIGNED_USER.getDescription());
+ Assert.assertEquals(SystemUser.OseeSystem.getName(), AtsCoreUsers.SYSTEM_USER.getDescription());
+ Assert.assertEquals(SystemUser.Anonymous.getName(), AtsCoreUsers.ANONYMOUS_USER.getDescription());
+ Assert.assertEquals(SystemUser.UnAssigned.getName(), AtsCoreUsers.UNASSIGNED_USER.getDescription());
}
@Test
public void testIsActive() {
AtsCoreUsers.SYSTEM_USER.isActive();
- AtsCoreUsers.GUEST_USER.isActive();
+ AtsCoreUsers.ANONYMOUS_USER.isActive();
AtsCoreUsers.UNASSIGNED_USER.isActive();
new TestUser().isActive();
}
@Test
public void testGetName() {
- Assert.assertEquals("OSEE System", AtsCoreUsers.SYSTEM_USER.getName());
- Assert.assertEquals("Guest", AtsCoreUsers.GUEST_USER.getName());
- Assert.assertEquals("UnAssigned", AtsCoreUsers.UNASSIGNED_USER.getName());
+ Assert.assertEquals(SystemUser.OseeSystem.getName(), AtsCoreUsers.SYSTEM_USER.getName());
+ Assert.assertEquals(SystemUser.Anonymous.getName(), AtsCoreUsers.ANONYMOUS_USER.getName());
+ Assert.assertEquals(SystemUser.UnAssigned.getName(), AtsCoreUsers.UNASSIGNED_USER.getName());
}
@Test
public void testGetUuid() {
- Assert.assertEquals(11L, AtsCoreUsers.SYSTEM_USER.getUuid());
- Assert.assertEquals(1896L, AtsCoreUsers.GUEST_USER.getUuid());
+ Assert.assertEquals(SystemUser.OseeSystem.getUuid(), AtsCoreUsers.SYSTEM_USER.getUuid());
+ Assert.assertEquals(SystemUser.Anonymous.getUuid(), AtsCoreUsers.ANONYMOUS_USER.getUuid());
}
@Test
public void testGetUserId() {
- Assert.assertEquals("99999999", AtsCoreUsers.SYSTEM_USER.getUserId());
- Assert.assertEquals("99999998", AtsCoreUsers.GUEST_USER.getUserId());
- Assert.assertEquals("99999997", AtsCoreUsers.UNASSIGNED_USER.getUserId());
+ Assert.assertEquals(SystemUser.OseeSystem.getUserId(), AtsCoreUsers.SYSTEM_USER.getUserId());
+ Assert.assertEquals(SystemUser.Anonymous.getUserId(), AtsCoreUsers.ANONYMOUS_USER.getUserId());
+ Assert.assertEquals(SystemUser.UnAssigned.getUserId(), AtsCoreUsers.UNASSIGNED_USER.getUserId());
}
@Test
@@ -74,13 +75,13 @@ public class CoreAtsUsersTest {
@Test
public void testGetEmail() {
Assert.assertEquals("", AtsCoreUsers.SYSTEM_USER.getEmail());
- Assert.assertEquals("", AtsCoreUsers.GUEST_USER.getEmail());
+ Assert.assertEquals("", AtsCoreUsers.ANONYMOUS_USER.getEmail());
Assert.assertEquals("", AtsCoreUsers.UNASSIGNED_USER.getEmail());
}
@Test
public void testToString() {
- Assert.assertEquals("User [Guest - 99999998 - ]", AtsCoreUsers.GUEST_USER.toString());
+ Assert.assertEquals("User [Anonymous - 99999998 - ]", AtsCoreUsers.ANONYMOUS_USER.toString());
}
@Test
@@ -119,7 +120,7 @@ public class CoreAtsUsersTest {
user1.setUserId("234");
TestUser user2 = new TestUser();
- user2.setUserId(AtsCoreUsers.SYSTEM_USER.getUserId());
+ user2.setUserId(SystemUser.OseeSystem.getUserId());
IAtsUser mapToPi = AtsCoreUsers.SYSTEM_USER;
IAtsUser alsoMapToPi = user2;
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/util/AtsObjectsTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/util/AtsObjectsTest.java
index 792a40277b..76cb0b114d 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/util/AtsObjectsTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/util/AtsObjectsTest.java
@@ -33,8 +33,8 @@ public class AtsObjectsTest {
public void testToUuids() {
List<IAtsObject> objs = new ArrayList<>();
objs.add(AtsCoreUsers.SYSTEM_USER);
- objs.add(AtsCoreUsers.GUEST_USER);
- Assert.assertEquals(Arrays.asList(AtsCoreUsers.SYSTEM_USER.getUuid(), AtsCoreUsers.GUEST_USER.getUuid()),
+ objs.add(AtsCoreUsers.ANONYMOUS_USER);
+ Assert.assertEquals(Arrays.asList(AtsCoreUsers.SYSTEM_USER.getUuid(), AtsCoreUsers.ANONYMOUS_USER.getUuid()),
AtsObjects.toUuids(objs));
}
@@ -44,21 +44,21 @@ public class AtsObjectsTest {
List<Object> objs = new ArrayList<>();
objs.add(AtsCoreUsers.SYSTEM_USER);
- objs.add(AtsCoreUsers.GUEST_USER);
+ objs.add(AtsCoreUsers.ANONYMOUS_USER);
objs.add(AtsCoreUsers.UNASSIGNED_USER);
objs.add("Just a String");
Assert.assertEquals(
String.format("%s; %s; %s; Just a String", AtsCoreUsers.SYSTEM_USER.getName(),
- AtsCoreUsers.GUEST_USER.getName(), AtsCoreUsers.UNASSIGNED_USER.getName()), AtsObjects.toString("; ", objs));
+ AtsCoreUsers.ANONYMOUS_USER.getName(), AtsCoreUsers.UNASSIGNED_USER.getName()), AtsObjects.toString("; ", objs));
}
@Test
public void testGetNames() {
List<IAtsObject> objs = new ArrayList<>();
objs.add(AtsCoreUsers.SYSTEM_USER);
- objs.add(AtsCoreUsers.GUEST_USER);
+ objs.add(AtsCoreUsers.ANONYMOUS_USER);
objs.add(AtsCoreUsers.UNASSIGNED_USER);
- Assert.assertEquals(Arrays.asList(AtsCoreUsers.SYSTEM_USER.getName(), AtsCoreUsers.GUEST_USER.getName(),
+ Assert.assertEquals(Arrays.asList(AtsCoreUsers.SYSTEM_USER.getName(), AtsCoreUsers.ANONYMOUS_USER.getName(),
AtsCoreUsers.UNASSIGNED_USER.getName()), AtsObjects.getNames(objs));
}
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workflow/transition/TransitionHelperAdapterTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workflow/transition/TransitionHelperAdapterTest.java
index 685bc9d026..9c9506c82f 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workflow/transition/TransitionHelperAdapterTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workflow/transition/TransitionHelperAdapterTest.java
@@ -92,7 +92,7 @@ public class TransitionHelperAdapterTest {
Assert.assertTrue(helper.isSystemUserAssingee(workItem));
assignees.clear();
- assignees.add(AtsCoreUsers.GUEST_USER);
+ assignees.add(AtsCoreUsers.ANONYMOUS_USER);
Assert.assertTrue(helper.isSystemUserAssingee(workItem));
}

Back to the top