CaseOverviewPresenter extends AbstractCaseInstancePresenter<CaseOverviewPresenter.CaseOverviewView> { protected void cancelCaseInstance() { caseService.call( e -> { caseCancelEvent.fire(new CaseCancelEvent(caseId)); backToList(); } ).cancelCaseInstance(containerId, caseId); }  @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 testCancelCaseInstance() { final CaseInstanceSummary cis = setupCaseInstance(); presenter.cancelCaseInstance(); verify(caseManagementService).cancelCaseInstance(cis.getContainerId(), cis.getCaseId()); final ArgumentCaptor<CaseCancelEvent> captor = ArgumentCaptor.forClass(CaseCancelEvent.class); verify(caseCancelEvent).fire(captor.capture()); assertEquals(cis.getCaseId(), captor.getValue().getCaseId()); }