summaryrefslogtreecommitdiffstats
path: root/POLICY-SDK-APP/src/test/java/org/onap
diff options
context:
space:
mode:
Diffstat (limited to 'POLICY-SDK-APP/src/test/java/org/onap')
-rw-r--r--POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyManagerServletTest.java2
-rw-r--r--POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyRestControllerTest.java4
-rw-r--r--POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyUserInfoControllerTest.java4
-rw-r--r--POLICY-SDK-APP/src/test/java/org/onap/policy/controller/AdminTabControllerTest.java13
-rw-r--r--POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PDPControllerTest.java2
5 files changed, 18 insertions, 7 deletions
diff --git a/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyManagerServletTest.java b/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyManagerServletTest.java
index 22cc82a23..dc2159bc1 100644
--- a/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyManagerServletTest.java
+++ b/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyManagerServletTest.java
@@ -40,6 +40,7 @@ import org.onap.policy.common.logging.flexlogger.FlexLogger;
import org.onap.policy.common.logging.flexlogger.Logger;
import org.onap.policy.controller.CreateDcaeMicroServiceController;
import org.onap.policy.controller.PolicyController;
+import org.onap.policy.model.Roles;
import org.onap.policy.rest.dao.CommonClassDao;
import org.onap.policy.rest.jpa.ActionBodyEntity;
import org.onap.policy.rest.jpa.ConfigurationDataEntity;
@@ -48,7 +49,6 @@ import org.onap.policy.rest.jpa.PolicyEditorScopes;
import org.onap.policy.rest.jpa.PolicyEntity;
import org.onap.policy.rest.jpa.PolicyVersion;
import org.onap.policy.rest.jpa.UserInfo;
-import org.openecomp.policy.model.Roles;
public class PolicyManagerServletTest extends Mockito{
diff --git a/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyRestControllerTest.java b/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyRestControllerTest.java
index 1bda7cd41..16cefd854 100644
--- a/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyRestControllerTest.java
+++ b/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyRestControllerTest.java
@@ -45,8 +45,8 @@ import org.onap.policy.rest.jpa.PrefixList;
import org.onap.policy.rest.jpa.SecurityZone;
import org.onap.policy.rest.jpa.ServiceList;
import org.onap.policy.rest.jpa.TermList;
-import org.openecomp.portalsdk.core.domain.User;
-import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.portalsdk.core.domain.User;
+import org.onap.portalsdk.core.util.SystemProperties;
import org.springframework.mock.web.MockHttpServletResponse;
public class PolicyRestControllerTest {
diff --git a/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyUserInfoControllerTest.java b/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyUserInfoControllerTest.java
index f4acaeb9a..7a3401568 100644
--- a/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyUserInfoControllerTest.java
+++ b/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyUserInfoControllerTest.java
@@ -29,8 +29,8 @@ import javax.servlet.http.HttpSession;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
-import org.openecomp.portalsdk.core.domain.User;
-import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.portalsdk.core.domain.User;
+import org.onap.portalsdk.core.util.SystemProperties;
import org.springframework.mock.web.MockHttpServletResponse;
public class PolicyUserInfoControllerTest {
diff --git a/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/AdminTabControllerTest.java b/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/AdminTabControllerTest.java
index 0109cb503..17ad56457 100644
--- a/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/AdminTabControllerTest.java
+++ b/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/AdminTabControllerTest.java
@@ -19,7 +19,8 @@
*/
package org.onap.policy.controller;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -30,13 +31,17 @@ import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
import org.junit.Before;
import org.junit.Test;
+import org.mockito.Mockito;
import org.onap.policy.common.logging.flexlogger.FlexLogger;
import org.onap.policy.common.logging.flexlogger.Logger;
import org.onap.policy.rest.dao.CommonClassDao;
import org.onap.policy.rest.jpa.GlobalRoleSettings;
+import org.onap.portalsdk.core.domain.User;
+import org.onap.portalsdk.core.util.SystemProperties;
import org.springframework.mock.web.MockHttpServletResponse;
public class AdminTabControllerTest {
@@ -55,6 +60,12 @@ public class AdminTabControllerTest {
request = mock(HttpServletRequest.class);
response = new MockHttpServletResponse();
+ HttpSession mockSession = mock(HttpSession.class);
+ User user = new User();
+ user.setOrgUserId("Test");
+ Mockito.when(mockSession.getAttribute(SystemProperties.getProperty("user_attribute_name"))).thenReturn(user);
+ Mockito.when(request.getSession(false)).thenReturn(mockSession);
+
AdminTabController.setCommonClassDao(commonClassDao);
GlobalRoleSettings globalRole = new GlobalRoleSettings();
diff --git a/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PDPControllerTest.java b/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PDPControllerTest.java
index 8433c4740..55a2288c7 100644
--- a/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PDPControllerTest.java
+++ b/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PDPControllerTest.java
@@ -34,10 +34,10 @@ import org.junit.Test;
import org.mockito.Mockito;
import org.onap.policy.common.logging.flexlogger.FlexLogger;
import org.onap.policy.common.logging.flexlogger.Logger;
+import org.onap.policy.model.Roles;
import org.onap.policy.xacml.api.pap.OnapPDPGroup;
import org.onap.policy.xacml.std.pap.StdPDPGroup;
import org.onap.policy.xacml.std.pap.StdPDPGroupStatus;
-import org.openecomp.policy.model.Roles;
import org.springframework.mock.web.MockHttpServletResponse;