@Test public void testShouldBeIncludedTextualSearch() throws Exception { SearchChannel channel = mock(SearchChannel.class); mockCapabilities(channel, true); doReturn(true).when(channel).hasPermission(getGuestUser()); SearchOptionsHandler handler = getHandler(); assertTrue("Channel should be permitted if there's textual capabilities, no blacklist and user is permitted", handler.shouldBeIncluded(channel, getGuestUser())); }
protected boolean shouldBeIncluded(SearchableChannel channel, User user) { if(!channel.getCapabilities().canTextSearch()) { return false; } if(blacklist.contains(channel.getId())) { return false; } return channel.hasPermission(user); }
SearchOptionsHandler extends ActionHandler { protected boolean shouldBeIncluded(SearchableChannel channel, User user) { if(!channel.getCapabilities().canTextSearch()) { return false; } if(blacklist.contains(channel.getId())) { return false; } return channel.hasPermission(user); } }
SearchOptionsHandler extends ActionHandler { protected boolean shouldBeIncluded(SearchableChannel channel, User user) { if(!channel.getCapabilities().canTextSearch()) { return false; } if(blacklist.contains(channel.getId())) { return false; } return channel.hasPermission(user); }  }
SearchOptionsHandler extends ActionHandler { protected boolean shouldBeIncluded(SearchableChannel channel, User user) { if(!channel.getCapabilities().canTextSearch()) { return false; } if(blacklist.contains(channel.getId())) { return false; } return channel.hasPermission(user); }  void setSearchService(SearchService service); @Override void init(); void handleAction(final ActionParameters params); }
SearchOptionsHandler extends ActionHandler { protected boolean shouldBeIncluded(SearchableChannel channel, User user) { if(!channel.getCapabilities().canTextSearch()) { return false; } if(blacklist.contains(channel.getId())) { return false; } return channel.hasPermission(user); }  void setSearchService(SearchService service); @Override void init(); void handleAction(final ActionParameters params);  }