CaseRolesPresenter extends AbstractCaseInstancePresenter<CaseRolesPresenter.CaseRolesView> { public void setCaseRoleActions(CaseRoleItemView caseRole){ final CaseRoleAssignmentSummary caseRoleAssignmentSummary = caseRole.getValue(); if (CASE_OWNER_ROLE.equals(caseRoleAssignmentSummary.getName())) { caseRole.displayOwnerActions(); } else { boolean hasAssignment = caseRoleAssignmentSummary.hasAssignment(); addCaseRoleAction(caseRole, new CaseRoleAction() { @Override public String label() { if (hasAssignment) { return translationService.format(EDIT); } return translationService.format(ASSIGN); } @Override public boolean isEnabled() { return true; } @Override public void execute() { caseRole.showEditRoleAssignmentDialog(); } }); addCaseRoleAction(caseRole, new CaseRoleAction() { @Override public String label() { return translationService.format(REMOVE_ALL_ASSIGNMENTS); } @Override public boolean isEnabled() { return hasAssignment; } @Override public void execute() { caseRole.showRemoveAllAssignmentsPopup(); } }); } }  @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 testSetCaseRoleActions_ownerRole() { when(caseRole.getValue()).thenReturn(CaseRoleAssignmentSummary.builder() .name(CaseRolesPresenter.CASE_OWNER_ROLE) .users(singletonList(USER)) .build()); presenter.setCaseRoleActions(caseRole); verify(caseRole).displayOwnerActions(); }