CaseInstanceListPresenter extends AbstractPresenter<CaseInstanceListPresenter.CaseInstanceListView> { protected void closeCaseInstance(final CaseInstanceSummary caseInstanceSummary) { caseService.call( e -> refreshData() ).closeCaseInstance(caseInstanceSummary.getContainerId(), caseInstanceSummary.getCaseId(), null); }  @WorkbenchPartTitle String getTitle(); @Override void init(); void createCaseInstance(); void onCaseCreatedEvent(@Observes CaseCreatedEvent event); @Inject void setCaseService(final Caller<CaseManagementService> caseService); static final String SCREEN_ID; }
@Test public void testCloseCaseInstance() { final CaseInstanceSummary cis = caseInstanceSummaryList.remove(0); presenter.closeCaseInstance(cis); verify(caseManagementService).closeCaseInstance(cis.getContainerId(), cis.getCaseId(), null); verify(caseManagementService).getCaseInstances(any(CaseInstanceSearchRequest.class)); final ArgumentCaptor<List> captor = ArgumentCaptor.forClass(List.class); verify(view).setCaseInstanceList(captor.capture()); assertEquals(caseInstanceSummaryList.size(), captor.getValue().size()); }