diff options
Diffstat (limited to 'sparkybe-onap-service/src/test/java')
2 files changed, 41 insertions, 3 deletions
diff --git a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/security/portal/PortalRestAPICentralServiceImplTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/security/portal/PortalRestAPICentralServiceImplTest.java new file mode 100644 index 0000000..fe6175d --- /dev/null +++ b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/security/portal/PortalRestAPICentralServiceImplTest.java @@ -0,0 +1,40 @@ +package org.onap.aai.sparky.security.portal; + +import javax.servlet.http.HttpServletRequest; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mockito; +import org.onap.portalsdk.core.onboarding.exception.PortalAPIException; +import org.onap.portalsdk.core.restful.domain.EcompUser; + +public class PortalRestAPICentralServiceImplTest { + + private PortalRestAPICentralServiceImpl portalRestAPICentralImpl; + private static final String LOGINID_1 = "200"; + private HttpServletRequest request; + private EcompUser ecompUser; + + @Before + public void init() throws Exception { + request = Mockito.mock(HttpServletRequest.class); + portalRestAPICentralImpl = new PortalRestAPICentralServiceImpl(); + ecompUser = new EcompUser(); + } + + + @Test + public void testIsAppAuthenticated() throws PortalAPIException { + portalRestAPICentralImpl.isAppAuthenticated(request); + } + + @Test + public void testgetCredentials() throws PortalAPIException { + portalRestAPICentralImpl.editUser(LOGINID_1, ecompUser); + portalRestAPICentralImpl.getCredentials(); + portalRestAPICentralImpl.getAppCredentials(); + + } + + +} diff --git a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/security/portal/TestUserManager.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/security/portal/TestUserManager.java index 784d807..9249a21 100644 --- a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/security/portal/TestUserManager.java +++ b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/security/portal/TestUserManager.java @@ -45,11 +45,9 @@ import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; -import org.junit.runner.RunWith; import org.onap.aai.sparky.security.portal.UserManager; import org.onap.aai.sparky.util.NodeUtils; -import org.openecomp.portalsdk.core.restful.domain.EcompUser; -import org.powermock.modules.junit4.PowerMockRunner; +import org.onap.portalsdk.core.restful.domain.EcompUser; import org.slf4j.Logger; import org.slf4j.LoggerFactory; |