CaseRolesPresenter extends AbstractCaseInstancePresenter<CaseRolesPresenter.CaseRolesView> { @Override protected void loadCaseInstance(final CaseInstanceSummary cis) { loadCaseRoles(cis); }  @WorkbenchPartTitle String getTittle(); void filterCaseRoles(); void setCaseRoleActions(CaseRoleItemView caseRole); void setCaseRoleAssignments(CaseRoleItemView caseRole,
                                       final int assignmentsListMaxWidth); void storeRoleAssignments(final CaseRoleAssignmentSummary currentRoleAssignments,
                                     List<String> users,
                                     List<String> groups); static final String SCREEN_ID; static final String CASE_OWNER_ROLE; }
@Test public void testLoadCaseInstance() { caseDefinition = CaseDefinitionSummary.builder() .roles(singletonMap(CASE_ROLE, 3)) .build(); caseInstance.setRoleAssignments (singletonList(CaseRoleAssignmentSummary.builder().name(CASE_ROLE).groups(singletonList(GROUP)).users(singletonList(USER)).build())); setCaseDefinitionID(CASE_DEFINITION_ID, caseDefinition, caseInstance); when(caseManagementService.getCaseDefinition(caseInstance.getContainerId(), caseInstance.getCaseDefinitionId())).thenReturn(caseDefinition); when(view.getFilterValue()).thenReturn("All"); setupCaseInstance(caseInstance); verify(view).removeAllRoles(); verify(view).setBadge(0); ArgumentCaptor<List> allRoleAssignments = ArgumentCaptor.forClass(List.class); verify(presenter).setCaseRolesAssignments(allRoleAssignments.capture()); verify(view).setBadge(caseInstance.getRoleAssignments().size()); verify(presenter).filterCaseRoles(); ArgumentCaptor<List> displayedRoleAssignments = ArgumentCaptor.forClass(List.class); verify(view).displayCaseRolesList(displayedRoleAssignments.capture()); assertEquals(caseInstance.getRoleAssignments().size(), allRoleAssignments.getValue().size()); assertEquals(allRoleAssignments.getValue().size(), displayedRoleAssignments.getValue().size()); assertEquals(CASE_ROLE, ((CaseRoleAssignmentSummary) displayedRoleAssignments.getValue().get(0)).getName()); assertEquals(USER, ((CaseRoleAssignmentSummary) displayedRoleAssignments.getValue().get(0)).getUsers().get(0)); assertEquals(GROUP, ((CaseRoleAssignmentSummary) displayedRoleAssignments.getValue().get(0)).getGroups().get(0)); }