@Test
public void testGetFilterDefinitions() {

    // Create view
    final View view = new View();
    // Create two filters
    final Filter filter1 = new Filter();
    filter1.setId(1);
    filter1.setName("Filter1");
    filter1.setClasspath("classpath1");
    filter1.setJar("jar1");
    // Create two filters
    final Filter filter2 = new Filter();
    filter2.setId(2);
    filter2.setName("Filter2");
    filter2.setClasspath("classpath2");
    filter2.setJar("jar2");
    // Associate them as optional filters
    final ViewToFilterOptional optional1 = new ViewToFilterOptional();
    optional1.setView(view);
    optional1.setFilter(filter1);
    // Associate them as optional filters
    final ViewToFilterOptional optional2 = new ViewToFilterOptional();
    optional2.setView(view);
    optional2.setFilter(filter2);
    view.setOptionalFilters(Sets.newHashSet(optional1, optional2));
    // Create consume request
    final ConsumeRequest consumeRequest = new ConsumeRequest();
    final Map<String, String> uiFilter1Options = new HashMap<>();
    uiFilter1Options.put("key1", "value1");
    uiFilter1Options.put("key2", "value2");
    final ConsumeRequest.Filter uiFilter1 = new ConsumeRequest.Filter();
    uiFilter1.setFilterId(1L);
    uiFilter1.setOptions(uiFilter1Options);
    consumeRequest.setFilters(Lists.newArrayList(uiFilter1));
    // Create instance & override
    final ViewCustomizer viewCustomizer = new ViewCustomizer(view, consumeRequest);
    List<FilterDefinition> filterDefinitions = viewCustomizer.getFilterDefinitions();
    assertFalse("Not Empty list", filterDefinitions.isEmpty());
    final FilterDefinition filterDefinition = filterDefinitions.get(0);
    Assert.assertEquals("Has expected filter", filter1, filterDefinition.getFilter());
    assertEquals("Has expected filter", uiFilter1Options, filterDefinition.getOptions());
}