CaseOverviewPresenter extends AbstractCaseInstancePresenter<CaseOverviewPresenter.CaseOverviewView> { protected void closeCaseInstance() { caseService.call( e -> { caseClosedEvent.fire(new CaseClosedEvent(caseId)); backToList(); } ).closeCaseInstance(containerId, caseId, null); }  @WorkbenchPartTitle String getTitle(); @OnOpen void onOpen(); @Inject void setCaseCancelEvent(final Event<CaseCancelEvent> caseCancelEvent); @Inject void setCaseDestroyEvent(final Event<CaseClosedEvent> caseClosedEvent); @Inject void setCaseRefreshEvent(final Event<CaseRefreshEvent> caseRefreshEvent); static final String SCREEN_ID; }
@Test public void testCloseCaseInstance() { final CaseInstanceSummary cis = setupCaseInstance(); presenter.closeCaseInstance(); verify(caseManagementService).closeCaseInstance(cis.getContainerId(), cis.getCaseId(), null); final ArgumentCaptor<CaseClosedEvent> captor = ArgumentCaptor.forClass(CaseClosedEvent.class); verify(caseDestroyEvent).fire(captor.capture()); assertEquals(cis.getCaseId(), captor.getValue().getCaseId()); }