SearchAdminDisplayContext { public String getSelectedTab() { return _selectedTab; }  NavigationItemList getNavigationItemList(); String getSelectedTab(); void setNavigationItemList(NavigationItemList navigationItemList); void setSelectedTab(String selectedTab);  }
@Test public void testGetTabConnections() { SearchAdminDisplayBuilder searchAdminDisplayBuilder = new SearchAdminDisplayBuilder( _language, _portal, getRenderRequestWithSelectedTab("connections"), new MockRenderResponse()); searchAdminDisplayBuilder.setIndexInformation( Mockito.mock(IndexInformation.class)); SearchAdminDisplayContext searchAdminDisplayContext = searchAdminDisplayBuilder.build(); Assert.assertEquals( "connections", searchAdminDisplayContext.getSelectedTab()); }
@Test public void testGetTabDefault() { SearchAdminDisplayBuilder searchAdminDisplayBuilder = new SearchAdminDisplayBuilder( _language, _portal, new MockRenderRequest(), new MockRenderResponse()); searchAdminDisplayBuilder.setIndexInformation( Mockito.mock(IndexInformation.class)); SearchAdminDisplayContext searchAdminDisplayContext = searchAdminDisplayBuilder.build(); Assert.assertEquals( "connections", searchAdminDisplayContext.getSelectedTab()); }
@Test public void testGetTabFieldMappings() { SearchAdminDisplayBuilder searchAdminDisplayBuilder = new SearchAdminDisplayBuilder( _language, _portal, getRenderRequestWithSelectedTab("field-mappings"), new MockRenderResponse()); searchAdminDisplayBuilder.setIndexInformation( Mockito.mock(IndexInformation.class)); SearchAdminDisplayContext searchAdminDisplayContext = searchAdminDisplayBuilder.build(); Assert.assertEquals( "field-mappings", searchAdminDisplayContext.getSelectedTab()); }
@Test public void testGetTabFieldMappingsNoIndexInformation() { SearchAdminDisplayBuilder searchAdminDisplayBuilder = new SearchAdminDisplayBuilder( _language, _portal, getRenderRequestWithSelectedTab("field-mappings"), new MockRenderResponse()); searchAdminDisplayBuilder.setIndexInformation(null); SearchAdminDisplayContext searchAdminDisplayContext = searchAdminDisplayBuilder.build(); Assert.assertEquals( "connections", searchAdminDisplayContext.getSelectedTab()); }
@Test public void testGetTabIndexActions() { SearchAdminDisplayBuilder searchAdminDisplayBuilder = new SearchAdminDisplayBuilder( _language, _portal, getRenderRequestWithSelectedTab("index-actions"), new MockRenderResponse()); searchAdminDisplayBuilder.setIndexInformation( Mockito.mock(IndexInformation.class)); SearchAdminDisplayContext searchAdminDisplayContext = searchAdminDisplayBuilder.build(); Assert.assertEquals( "index-actions", searchAdminDisplayContext.getSelectedTab()); }
@Test public void testGetTabUnavailable() { SearchAdminDisplayBuilder searchAdminDisplayBuilder = new SearchAdminDisplayBuilder( _language, _portal, getRenderRequestWithSelectedTab(RandomTestUtil.randomString()), new MockRenderResponse()); searchAdminDisplayBuilder.setIndexInformation( Mockito.mock(IndexInformation.class)); SearchAdminDisplayContext searchAdminDisplayContext = searchAdminDisplayBuilder.build(); Assert.assertEquals( "connections", searchAdminDisplayContext.getSelectedTab()); }