CaseStagesPresenter extends AbstractCaseInstancePresenter<CaseStagesPresenter.CaseStagesView> { void setStage(final CaseStageItemViewImpl caseStageItem) { if (caseStageItem.getValue().getStatus().equals(CaseStageStatus.ACTIVE.getStatus())) { caseStageItem.showStageActive(); } }  @WorkbenchPartTitle String getTitle(); static final String SCREEN_ID; }
@Test public void testSetStage_stageActive() { when(caseStageItemViewMock.getValue()).thenReturn(createCaseStageSummary(ACTIVE.getStatus())); getPresenter().setStage(caseStageItemViewMock); verify(caseStageItemViewMock).showStageActive(); }
@Test public void testSetStage_stageNotActive() { when(caseStageItemViewMock.getValue()).thenReturn(createCaseStageSummary(AVAILABLE.getStatus()), createCaseStageSummary(COMPLETED.getStatus()), createCaseStageSummary(CANCELED.getStatus())); getPresenter().setStage(caseStageItemViewMock); getPresenter().setStage(caseStageItemViewMock); getPresenter().setStage(caseStageItemViewMock); verify(caseStageItemViewMock, never()).showStageActive(); }