@Test void testGetMainNavigation_0Levels() throws Exception { NavigationPageItem rootItem = underTest.getMainNavigation(0); List<NavigationPageItem> mainnavItems = rootItem.getChildren(); assertEquals(0, mainnavItems.size()); }
@Override public NavigationPageItem getMainNavigation(final int maxLevels) { Page siteRootPage = siteRoot.getRootPage(); if (siteRootPage == null) { siteRootPage = currentPage; } NavigationPageItem rootItem = createLinkableItem(siteRootPage); if (maxLevels > 0) { rootItem.setChildren(createChildItemsRecursively(siteRootPage, new ValidLinkableItemCreator(), 1, maxLevels)); } return rootItem; }
NavigationManagerImpl implements NavigationManager { @Override public NavigationPageItem getMainNavigation(final int maxLevels) { Page siteRootPage = siteRoot.getRootPage(); if (siteRootPage == null) { siteRootPage = currentPage; } NavigationPageItem rootItem = createLinkableItem(siteRootPage); if (maxLevels > 0) { rootItem.setChildren(createChildItemsRecursively(siteRootPage, new ValidLinkableItemCreator(), 1, maxLevels)); } return rootItem; } }
NavigationManagerImpl implements NavigationManager { @Override public NavigationPageItem getMainNavigation(final int maxLevels) { Page siteRootPage = siteRoot.getRootPage(); if (siteRootPage == null) { siteRootPage = currentPage; } NavigationPageItem rootItem = createLinkableItem(siteRootPage); if (maxLevels > 0) { rootItem.setChildren(createChildItemsRecursively(siteRootPage, new ValidLinkableItemCreator(), 1, maxLevels)); } return rootItem; }  }
NavigationManagerImpl implements NavigationManager { @Override public NavigationPageItem getMainNavigation(final int maxLevels) { Page siteRootPage = siteRoot.getRootPage(); if (siteRootPage == null) { siteRootPage = currentPage; } NavigationPageItem rootItem = createLinkableItem(siteRootPage); if (maxLevels > 0) { rootItem.setChildren(createChildItemsRecursively(siteRootPage, new ValidLinkableItemCreator(), 1, maxLevels)); } return rootItem; }  @Override NavigationPageItem getMainNavigation(final int maxLevels); @Override NavigationPageItem getFooterNavigation(); }
NavigationManagerImpl implements NavigationManager { @Override public NavigationPageItem getMainNavigation(final int maxLevels) { Page siteRootPage = siteRoot.getRootPage(); if (siteRootPage == null) { siteRootPage = currentPage; } NavigationPageItem rootItem = createLinkableItem(siteRootPage); if (maxLevels > 0) { rootItem.setChildren(createChildItemsRecursively(siteRootPage, new ValidLinkableItemCreator(), 1, maxLevels)); } return rootItem; }  @Override NavigationPageItem getMainNavigation(final int maxLevels); @Override NavigationPageItem getFooterNavigation();  }