diff options
author | statta <statta@research.att.com> | 2020-03-19 16:26:13 -0400 |
---|---|---|
committer | statta <statta@research.att.com> | 2020-03-20 14:18:41 -0400 |
commit | ac28ae9246294a68a7ccfbd3bf561d61d6b5e438 (patch) | |
tree | acedf6e7bae89f843c307cc3841692ff25298370 /ecomp-portal-BE-common/src/test/java/org/onap | |
parent | aa3977cd66a4fe27fe3f00257872f8c438fd3c92 (diff) |
Header hiding the tab menu
Issue-ID: PORTAL-857
Change-Id: I11eab7411aff67db1fa247d01bd7519ad1c34ed5
Signed-off-by: statta <statta@research.att.com>
Diffstat (limited to 'ecomp-portal-BE-common/src/test/java/org/onap')
-rw-r--r-- | ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPLeftMenuServiceImplTest.java | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPLeftMenuServiceImplTest.java b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPLeftMenuServiceImplTest.java index 9a2568d8..258bf99d 100644 --- a/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPLeftMenuServiceImplTest.java +++ b/ecomp-portal-BE-common/src/test/java/org/onap/portalapp/portal/service/EPLeftMenuServiceImplTest.java @@ -20,7 +20,6 @@ package org.onap.portalapp.portal.service; import java.util.ArrayList; -import java.util.Collection; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; @@ -29,6 +28,7 @@ import java.util.Set; import org.json.JSONArray; import org.json.JSONObject; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.mockito.InjectMocks; @@ -37,16 +37,18 @@ import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import org.onap.portalapp.portal.domain.CentralizedApp; import org.onap.portalapp.portal.domain.EPUser; +import org.onap.portalapp.portal.framework.MockitoTestSuite; import org.onap.portalsdk.core.domain.MenuData; import org.onap.portalsdk.core.service.DataAccessService; import org.onap.portalsdk.core.service.DataAccessServiceImpl; -public class EPLeftMenuServiceImplTest { +public class EPLeftMenuServiceImplTest extends MockitoTestSuite{ @Mock DataAccessService dataAccessService = new DataAccessServiceImpl(); + @Mock - ExternalAccessRolesService externalAccessRolesService; + ExternalAccessRolesService externalAccessRolesService; @Before public void setup() { @@ -54,7 +56,12 @@ public class EPLeftMenuServiceImplTest { } @InjectMocks - EPLeftMenuServiceImpl epLeftMenuServiceImpl = new EPLeftMenuServiceImpl(); + EPLeftMenuServiceImpl epLeftMenuServiceImpl = new EPLeftMenuServiceImpl() { + + String getLeftMenuValue() { + return null; + } + }; @Test public void getLeftMenuItemsTest() { @@ -97,13 +104,15 @@ public class EPLeftMenuServiceImplTest { JSONObject sidebarModel = new JSONObject(); JSONArray navItems = new JSONArray(); - Collection<JSONObject> jsonObjs = defaultNavMap.values(); + navItems.put(navItemsDetails3); sidebarModel.put("label", "ECOMP portal"); sidebarModel.put("navItems", navItems); - epLeftMenuServiceImpl.getLeftMenuItems(epUser, fullMenuSet, roleFunctionSet); + String menuStr = epLeftMenuServiceImpl.getLeftMenuItems(epUser, fullMenuSet, roleFunctionSet); + Assert.assertTrue(!menuStr.contains("root")); + Assert.assertEquals("{\"navItems\":[{\"name\":\"Home\",\"imageSrc\":\"home\",\"state\":\"applicationsHome\"},{\"name\":\"Application Catalog\",\"imageSrc\":\"apps\",\"state\":\"appCatalog\"},{\"name\":\"Widget Catalog\",\"imageSrc\":\"apps\",\"state\":\"widgetCatalog\"}],\"label\":\"Portal\"}", menuStr); } } |