@Test
public void testOnFilterChangedEvent() {

    final FilterChangedEvent event = mock(FilterChangedEvent.class);
    final DataSetFilter filter = mock(DataSetFilter.class);
    when(event.getContext()).thenReturn(filterEditor);
    when(event.getFilter()).thenReturn(filter);
    presenter.dataSetDef = this.dataSetDef;
    mockPreviewTableCall();
    final Command afterPreviewCommand = mock(Command.class);
    presenter.afterPreviewCommand = afterPreviewCommand;
    presenter.onFilterChangedEvent(event);
    verify(dataSetDef, times(1)).setDataSetFilter(filter);
    verify(loadingBox, times(1)).show();
    verify(loadingBox, times(1)).hide();
    verify(view, times(1)).clearErrorNotification();
    verify(filterEditor, times(0)).init(any(DataSetMetadata.class));
    verify(afterPreviewCommand, times(1)).execute();
    verify(view, times(0)).init(any(DataSetEditor.class));
    verify(view, times(0)).initWidgets(
            any(DataSetDefBasicAttributesEditor.View.class),
            any(IsWidget.class),
            any(DataSetDefColumnsFilterEditor.View.class),
            any(DataSetDefPreviewTable.View.class),
            any(DataSetDefCacheAttributesEditorView.class),
            any(DataSetDefCacheAttributesEditorView.class),
            any(DataSetDefRefreshAttributesEditor.View.class)
    );
    verify(view, times(0)).addConfigurationTabItemClickHandler(any(Command.class));
    verify(view, times(0)).addPreviewTabItemClickHandler(any(Command.class));
    verify(view, times(0)).addAdvancedTabItemClickHandler(any(Command.class));
    verify(view, times(0)).showConfigurationTab();
    verify(view, times(0)).showPreviewTab();
    verify(view, times(0)).showAdvancedTab();
    verify(view, times(0)).openColumnsFilterPanel(anyString());
    verify(view, times(0)).closeColumnsFilterPanel(anyString());
    verify(view, times(0)).showErrorNotification(any(SafeHtml.class));
}