ExecutionErrorListBasicFiltersPresenter extends BasicFiltersPresenter { @Override protected void onActiveFilterAdded(ActiveFilterItem activeFilterItem) { if (activeFilterItem.getKey().equals(constants.Type()) && activeFilterItem.getValue() instanceof List) { final List<String> values = (List<String>) activeFilterItem.getValue(); values.forEach(v -> view.checkSelectFilter(constants.Type(), v)); } }  @Override String getDataSetId(); @Override void loadFilters();  }
@Test public void onActiveFilterAddedTest() { ActiveFilterItem activeFilterItemMock = mock(ActiveFilterItem.class); when(activeFilterItemMock.getKey()).thenReturn(Constants.INSTANCE.JobId()); presenter.onActiveFilterAdded(activeFilterItemMock); verify(getView(), never()).checkSelectFilter(anyString(), anyString()); verify(activeFilterItemMock, never()).getValue(); when(activeFilterItemMock.getKey()).thenReturn(Constants.INSTANCE.Type()); when(activeFilterItemMock.getValue()).thenReturn(Arrays.asList(Constants.INSTANCE.Task(), Constants.INSTANCE.DB())); presenter.onActiveFilterAdded(activeFilterItemMock); verify(getView()).checkSelectFilter(Constants.INSTANCE.Type(), Constants.INSTANCE.Task()); verify(getView()).checkSelectFilter(Constants.INSTANCE.Type(), Constants.INSTANCE.DB()); }