RoleEditorWorkflow extends BaseRoleEditorWorkflow { @Override protected void edit() { super.edit(); selectedHomePerspective = roleEditor.getAclSettings().getHomePerspective(); if (isPerspectiveReadDenied(selectedHomePerspective)) { showNotification(UsersManagementWidgetsConstants.INSTANCE.homePerspectiveReadDenied()); } } @Inject  RoleEditorWorkflow(final ClientUserSystemManager userSystemManager,
                              final Caller<AuthorizationService> authorizationService,
                              final PermissionManager permissionManager,
                              final Event<OnErrorEvent> errorEvent,
                              final Event<NotificationEvent> workbenchNotification,
                              final Event<SaveRoleEvent> saveUserEvent,
                              final ConfirmBox confirmBox,
                              final RoleEditor roleEditor,
                              final RoleEditorDriver roleEditorDriver,
                              final LoadingBox loadingBox,
                              final EntityWorkflowView view); void show(final String roleName);  }
@Test public void testHomePerspectiveGranted() { permissionCollection.add(permissionManager.createPermission(homePerspective, PerspectiveAction.READ, true)); tested.edit(); verify(tested, never()).showNotification(anyString()); }
@Test public void testHomePerspectiveDenied() { permissionCollection.add(permissionManager.createPermission(homePerspective, PerspectiveAction.READ, false)); tested.edit(); verify(tested).showNotification(anyString()); }