BaseLayoutScreenNavigationEntry implements ScreenNavigationEntry<Layout> { @Override public boolean isVisible(User user, Layout layout) { Group group = layout.getGroup(); if (group.isLayoutPrototype() || group.isLayoutSetPrototype()) { return false; } LayoutPageTemplateEntry layoutPageTemplateEntry = layoutPageTemplateEntryLocalService. fetchLayoutPageTemplateEntryByPlid(layout.getPlid()); if (layoutPageTemplateEntry != null) { return false; } if ((layout.isTypeAssetDisplay() || layout.isTypeContent()) && (layout.fetchDraftLayout() == null)) { return false; } return true; }  @Override String getCategoryKey(); @Override String getLabel(Locale locale); @Override String getScreenNavigationKey(); @Override boolean isVisible(User user, Layout layout); @Override void render(
			HttpServletRequest httpServletRequest,
			HttpServletResponse httpServletResponse); @Reference( target = "(osgi.web.symbolicname=com.liferay.layout.seo.web)", unbind = "-" ) void setServletContext(ServletContext servletContext);  }
@Test public void testIsVisibleLayoutSetPrototype() { TestLayoutScreenNavigationEntry testLayoutScreenNavigationEntry = new TestLayoutScreenNavigationEntry(); Assert.assertFalse( testLayoutScreenNavigationEntry.isVisible( Mockito.mock(User.class), _getLayout(LayoutSetPrototype.class))); }
@Test public void testIsVisibleLayoutPageTemplate() { LayoutPageTemplateEntryLocalService layoutPageTemplateEntryLocalService = Mockito.mock( LayoutPageTemplateEntryLocalService.class); Mockito.when( layoutPageTemplateEntryLocalService. fetchLayoutPageTemplateEntryByPlid(Mockito.anyLong()) ).thenReturn( Mockito.mock(LayoutPageTemplateEntry.class) ); TestLayoutScreenNavigationEntry testLayoutScreenNavigationEntry = new TestLayoutScreenNavigationEntry( layoutPageTemplateEntryLocalService); Assert.assertFalse( testLayoutScreenNavigationEntry.isVisible( Mockito.mock(User.class), _getLayout(null))); }
@Test public void testIsVisibleLayoutPrototype() { TestLayoutScreenNavigationEntry testLayoutScreenNavigationEntry = new TestLayoutScreenNavigationEntry(); Assert.assertFalse( testLayoutScreenNavigationEntry.isVisible( Mockito.mock(User.class), _getLayout(LayoutPrototype.class))); }