@Test
public void testOnTabChangedEvent_PreviewTab() {

    when(editWorkflow.getEditor()).thenReturn(dataSetDefEditor);
    TabChangedEvent event = mock(TabChangedEvent.class);
    when(event.getContext()).thenReturn(dataSetDefEditor);
    when(event.getTabId()).thenReturn(DataSetEditor.TAB_PREVIEW);
    presenter.currentWorkflow = editWorkflow;
    presenter.onTabChangedEvent(event);
    verify(editWorkflow, times(1)).clearButtons();
    verify(editWorkflow, times(1)).showNextButton();
    verify(editWorkflow, times(1)).showBackButton();
    verify(editWorkflow, times(0)).showTestButton();
    verify(editWorkflow, times(0)).edit(any(SQLDataSetDef.class), any(List.class));
    verify(errorPopupPresenter, times(0)).showMessage(anyString());
    verify(view, times(0)).setWidget(any(IsWidget.class));
}