TabContainerPresenter implements TabContainer, TabContainerView.ActionDelegate, PanelState.StateChangeListener { @Override public void showTab(@NotNull String title) { onTabClicked(title); } @Inject  TabContainerPresenter(TabContainerView view, PanelState panelState, RunnerLocalizationConstant locale); @Override void go(AcceptsOneWidget container); @Override void showTab(@NotNull String title); @Override void addTab(@NotNull Tab tab); @Override void showTabTitle(@NotNull String tabName, boolean isShown); @Override void setLocation(@NotNull PanelLocation panelLocation); @Override void onTabClicked(@NotNull String title); @Override void onStateChanged();  }
@Test public void shouldShowTab() { addTwoTabs(); tabContainerPresenter.showTab(TITLE2); verify(tab2, times(2)).getTitle(); verify(tab2).performHandler(); verify(view).showTab(tab2); verify(view).selectTab(tab2); }
@Test public void shouldShowTabWhenTitleIsWrong() { addTwoTabs(); tabContainerPresenter.showTab("some not exist title"); verify(tab1).getTitle(); verify(tab2).getTitle(); verifyNoMoreInteractions(view, tab1, tab2); }