1 package org.onap.aai.sparky.security;
3 import static org.junit.Assert.assertNotNull;
5 import java.util.ArrayList;
7 import org.junit.Before;
9 import org.mockito.Mockito;
10 import org.onap.aai.sparky.security.portal.PortalRestAPICentralServiceImpl;
11 import org.onap.portalsdk.core.onboarding.exception.PortalAPIException;
12 import org.onap.portalsdk.core.restful.domain.EcompRole;
15 public class EcompSsoTest {
17 private EcompSso ecompSso;
18 private PortalRestAPICentralServiceImpl portalRestCentralServiceImpl;
21 public void init() throws Exception {
22 ecompSso = new EcompSso();
23 portalRestCentralServiceImpl = Mockito.mock(PortalRestAPICentralServiceImpl.class);
28 public void TestValidateUserAccess() throws PortalAPIException {
30 Mockito.when(portalRestCentralServiceImpl.getUserRoles(Mockito.anyString()))
31 .thenReturn(new ArrayList<EcompRole>());
32 assertNotNull(ecompSso.validateUserAccess("ui_view"));