fix backdoor issue when using portal
[aai/sparky-be.git] / sparkybe-onap-service / src / test / java / org / onap / aai / sparky / security / EcompSsoTest.java
1 package org.onap.aai.sparky.security;
2
3 import static org.junit.Assert.assertNotNull;
4
5 import java.util.ArrayList;
6
7 import org.junit.Before;
8 import org.junit.Test;
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;
13
14
15 public class EcompSsoTest {
16
17   private EcompSso ecompSso;
18   private PortalRestAPICentralServiceImpl portalRestCentralServiceImpl;
19
20   @Before
21   public void init() throws Exception {
22     ecompSso = new EcompSso();
23     portalRestCentralServiceImpl = Mockito.mock(PortalRestAPICentralServiceImpl.class);
24   }
25
26
27   @Test
28   public void TestValidateUserAccess() throws PortalAPIException {
29
30     Mockito.when(portalRestCentralServiceImpl.getUserRoles(Mockito.anyString()))
31         .thenReturn(new ArrayList<EcompRole>());
32     assertNotNull(ecompSso.validateUserAccess("ui_view"));
33   }
34
35
36 }