@Test
public void testShouldBeIncludedBlacklist() throws Exception {

    SearchChannel channel = mock(SearchChannel.class);
    mockCapabilities(channel, true);
    doReturn(true).when(channel).hasPermission(any(User.class));
    doReturn("TestChannel").when(channel).getId();
    // blacklisted - should not be allowed
    PropertyUtil.addProperty("actionhandler.SearchOptions.blacklist", "TestChannel");
    SearchOptionsHandler handler = getHandler();
    assertFalse("Channel should not permitted for guest", handler.shouldBeIncluded(channel, getGuestUser()));
    assertFalse("Channel should be permitted for user", handler.shouldBeIncluded(channel, getLoggedInUser()));
    // clear blacklist - should be allowed
    PropertyUtil.clearProperties();
    handler = getHandler();
    assertTrue("Channel should not permitted for guest", handler.shouldBeIncluded(channel, getGuestUser()));
    assertTrue("Channel should be permitted for user", handler.shouldBeIncluded(channel, getLoggedInUser()));
}