X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=sparkybe-onap-service%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Faai%2Fsparky%2Fsecurity%2FEcompSsoTest.java;fp=sparkybe-onap-service%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Faai%2Fsparky%2Fsecurity%2FEcompSsoTest.java;h=1863eb96e2493c677dafd4dfd933e5afaa829b1c;hb=57e7ef7a5b1a20b6237c78f3a85a9b4bb5aefa54;hp=0000000000000000000000000000000000000000;hpb=8aec4dcf8241295b48cfbfe1f4827ba6b4ccf982;p=aai%2Fsparky-be.git 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()); + assertNotNull(ecompSso.validateUserAccess("ui_view")); + } + + +}