summaryrefslogtreecommitdiffstats
path: root/sparkybe-onap-service/src/test
diff options
context:
space:
mode:
authorRogers, Reneal(rr267j) <rr267j@att.com>2018-12-31 13:01:54 -0500
committerrenealr <reneal.rogers@amdocs.com>2018-12-31 15:15:16 -0500
commit57e7ef7a5b1a20b6237c78f3a85a9b4bb5aefa54 (patch)
treeb85852f495f6ef76f9c32605799950ba02d365c0 /sparkybe-onap-service/src/test
parent8aec4dcf8241295b48cfbfe1f4827ba6b4ccf982 (diff)
fix backdoor issue when using portal
Issue-ID: AAI-2045 Change-Id: I7bad950ca142e81ef5f2a698dcaff90975f944a2 Signed-off-by: renealr <reneal.rogers@amdocs.com>
Diffstat (limited to 'sparkybe-onap-service/src/test')
-rw-r--r--sparkybe-onap-service/src/test/java/org/onap/aai/sparky/security/EcompSsoTest.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/security/EcompSsoTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/security/EcompSsoTest.java
new file mode 100644
index 0000000..1863eb9
--- /dev/null
+++ b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/security/EcompSsoTest.java
@@ -0,0 +1,36 @@
+package org.onap.aai.sparky.security;
+
+import static org.junit.Assert.assertNotNull;
+
+import java.util.ArrayList;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.onap.aai.sparky.security.portal.PortalRestAPICentralServiceImpl;
+import org.onap.portalsdk.core.onboarding.exception.PortalAPIException;
+import org.onap.portalsdk.core.restful.domain.EcompRole;
+
+
+public class EcompSsoTest {
+
+ private EcompSso ecompSso;
+ private PortalRestAPICentralServiceImpl portalRestCentralServiceImpl;
+
+ @Before
+ public void init() throws Exception {
+ ecompSso = new EcompSso();
+ portalRestCentralServiceImpl = Mockito.mock(PortalRestAPICentralServiceImpl.class);
+ }
+
+
+ @Test
+ public void TestValidateUserAccess() throws PortalAPIException {
+
+ Mockito.when(portalRestCentralServiceImpl.getUserRoles(Mockito.anyString()))
+ .thenReturn(new ArrayList<EcompRole>());
+ assertNotNull(ecompSso.validateUserAccess("ui_view"));
+ }
+
+
+}