Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2016-10-25 19:35:31 -0400
committerdonald.g.dunne2016-10-25 19:35:31 -0400
commit70c7e8004f96d56b3e27f47eb17939aa3d54c47c (patch)
treedcf9442ecf4da5c8abc4098da7e1fc444d72fc59
parenta50384bec11f3f52243bcb09d934109cae8bf9d6 (diff)
downloadorg.eclipse.osee-70c7e8004f96d56b3e27f47eb17939aa3d54c47c.tar.gz
org.eclipse.osee-70c7e8004f96d56b3e27f47eb17939aa3d54c47c.tar.xz
org.eclipse.osee-70c7e8004f96d56b3e27f47eb17939aa3d54c47c.zip
refactor: Remove DemoDbUtil.getDemoUser
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDbReviews.java3
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDbTasks.java6
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDbUtil.java10
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/actions/DuplicateWorkflowActionTest.java6
4 files changed, 9 insertions, 16 deletions
diff --git a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDbReviews.java b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDbReviews.java
index 935aac23e8..cfe756f8ec 100644
--- a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDbReviews.java
+++ b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDbReviews.java
@@ -42,6 +42,7 @@ import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.enums.QueryOption;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
@@ -153,7 +154,7 @@ public class DemoDbReviews {
// Create a PeerToPeer review and transition to Completed
reviewArt = PeerToPeerReviewManager.createNewPeerToPeerReview(secondCodeArt, "Review new logic",
secondCodeArt.getStateMgr().getCurrentStateName(), new Date(),
- AtsClientService.get().getUserServiceClient().getUserFromOseeUser(DemoDbUtil.getDemoUser(DemoUsers.Kay_Jones)),
+ AtsClientService.get().getUserServiceClient().getUserFromOseeUser(UserManager.getUser(DemoUsers.Kay_Jones)),
changes);
changes.setSoleAttributeValue((ArtifactId) reviewArt, AtsAttributeTypes.CSCI, "csci");
changes.setSoleAttributeValue((ArtifactId) reviewArt, AtsAttributeTypes.Description, "description");
diff --git a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDbTasks.java b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDbTasks.java
index 52592ace3e..7d40b19377 100644
--- a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDbTasks.java
+++ b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDbTasks.java
@@ -45,10 +45,10 @@ public class DemoDbTasks {
NewTaskData newTaskData = NewTaskDataFactory.get("Populate Demo DB - Create Tasks", createdBy, codeArt);
List<String> assigneeUserIds = new ArrayList<>();
if (firstTaskWorkflow) {
- assigneeUserIds.add(DemoDbUtil.getDemoUser(DemoUsers.Joe_Smith).getUserId());
- assigneeUserIds.add(DemoDbUtil.getDemoUser(DemoUsers.Kay_Jones).getUserId());
+ assigneeUserIds.add(DemoUsers.Joe_Smith.getUserId());
+ assigneeUserIds.add(DemoUsers.Kay_Jones.getUserId());
} else {
- assigneeUserIds.add(DemoDbUtil.getDemoUser(DemoUsers.Joe_Smith).getUserId());
+ assigneeUserIds.add(DemoUsers.Joe_Smith.getUserId());
}
for (String title : getTaskTitles(firstTaskWorkflow)) {
JaxAtsTask task = JaxAtsTaskFactory.get(newTaskData, title, createdBy, createdDate);
diff --git a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDbUtil.java b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDbUtil.java
index 4e26d2d4b3..b485d67270 100644
--- a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDbUtil.java
+++ b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/DemoDbUtil.java
@@ -27,15 +27,12 @@ import org.eclipse.osee.ats.demo.api.DemoArtifactTypes;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IOseeBranch;
-import org.eclipse.osee.framework.core.data.IUserToken;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.QueryOption;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.User;
-import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
@@ -115,10 +112,6 @@ public class DemoDbUtil {
branch);
}
- public static User getDemoUser(IUserToken demoUser) throws OseeCoreException {
- return UserManager.getUserByName(demoUser.getName());
- }
-
public static Collection<IAtsActionableItem> getActionableItems(String[] aiasNames) throws OseeCoreException {
Set<IAtsActionableItem> aias = new HashSet<>();
for (String str : aiasNames) {
@@ -131,5 +124,4 @@ public class DemoDbUtil {
}
return aias;
}
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/actions/DuplicateWorkflowActionTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/actions/DuplicateWorkflowActionTest.java
index 01817d9ce5..5116911a80 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/actions/DuplicateWorkflowActionTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/actions/DuplicateWorkflowActionTest.java
@@ -23,7 +23,6 @@ import org.eclipse.osee.ats.api.notify.AtsNotificationEventFactory;
import org.eclipse.osee.ats.api.notify.AtsNotifyType;
import org.eclipse.osee.ats.api.team.CreateTeamOption;
import org.eclipse.osee.ats.api.user.IAtsUser;
-import org.eclipse.osee.ats.client.demo.config.DemoDbUtil;
import org.eclipse.osee.ats.client.integration.tests.AtsClientService;
import org.eclipse.osee.ats.client.integration.tests.ats.core.client.AtsTestUtil;
import org.eclipse.osee.ats.core.client.action.ActionManager;
@@ -33,6 +32,7 @@ import org.eclipse.osee.ats.core.users.AtsCoreUsers;
import org.eclipse.osee.ats.core.util.AtsUtilCore;
import org.eclipse.osee.ats.demo.api.DemoUsers;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.UserManager;
import org.junit.After;
import org.junit.Test;
@@ -57,7 +57,7 @@ public class DuplicateWorkflowActionTest extends AbstractAtsActionRunTest {
List<IAtsUser> assignees = setupAssignees(teamWf);
IAtsUser originator = AtsClientService.get().getUserServiceClient().getUserFromOseeUser(
- DemoDbUtil.getDemoUser(DemoUsers.Jason_Michael));
+ UserManager.getUser(DemoUsers.Jason_Michael));
// new workflow
AtsChangeSet changes = new AtsChangeSet("Duplicate Workflow");
@@ -89,7 +89,7 @@ public class DuplicateWorkflowActionTest extends AbstractAtsActionRunTest {
List<IAtsUser> assignees = new LinkedList<>();
assignees.addAll(teamWf.getAssignees());
IAtsUser lead =
- AtsClientService.get().getUserServiceClient().getUserFromOseeUser(DemoDbUtil.getDemoUser(DemoUsers.Kay_Jones));
+ AtsClientService.get().getUserServiceClient().getUserFromOseeUser(UserManager.getUser(DemoUsers.Kay_Jones));
assignees.add(lead);
return assignees;
}

Back to the top