@Test public void canMakeChangesWhenFalseTest() { doReturn(false).when(authorizationManager).authorize(any(ResourceRef.class), any(User.class)); final boolean result = presenter.canMakeChanges(); assertFalse(result); verify(authorizationManager).authorize(any(ResourceRef.class), any(User.class)); }
@Override public boolean canMakeChanges() { final ResourceRef resourceRef = new ResourceRef(ArchetypeManagementPerspective.IDENTIFIER, ActivityResourceType.PERSPECTIVE); return authorizationManager.authorize(resourceRef, user); }
GlobalArchetypeTablePresenter extends AbstractArchetypeTablePresenter { @Override public boolean canMakeChanges() { final ResourceRef resourceRef = new ResourceRef(ArchetypeManagementPerspective.IDENTIFIER, ActivityResourceType.PERSPECTIVE); return authorizationManager.authorize(resourceRef, user); } }
GlobalArchetypeTablePresenter extends AbstractArchetypeTablePresenter { @Override public boolean canMakeChanges() { final ResourceRef resourceRef = new ResourceRef(ArchetypeManagementPerspective.IDENTIFIER, ActivityResourceType.PERSPECTIVE); return authorizationManager.authorize(resourceRef, user); } @Inject  GlobalArchetypeTablePresenter(final View view,
                                         final ArchetypeListPresenter archetypeListPresenter,
                                         final BusyIndicatorView busyIndicatorView,
                                         final TranslationService ts,
                                         final AddArchetypeModalPresenter addArchetypeModalPresenter,
                                         final ArchetypePreferences archetypePreferences,
                                         final Caller<ArchetypeService> archetypeService,
                                         final PreferenceScopeFactory preferenceScopeFactory,
                                         final Promises promises,
                                         final AuthorizationManager authorizationManager,
                                         final User user); }
GlobalArchetypeTablePresenter extends AbstractArchetypeTablePresenter { @Override public boolean canMakeChanges() { final ResourceRef resourceRef = new ResourceRef(ArchetypeManagementPerspective.IDENTIFIER, ActivityResourceType.PERSPECTIVE); return authorizationManager.authorize(resourceRef, user); } @Inject  GlobalArchetypeTablePresenter(final View view,
                                         final ArchetypeListPresenter archetypeListPresenter,
                                         final BusyIndicatorView busyIndicatorView,
                                         final TranslationService ts,
                                         final AddArchetypeModalPresenter addArchetypeModalPresenter,
                                         final ArchetypePreferences archetypePreferences,
                                         final Caller<ArchetypeService> archetypeService,
                                         final PreferenceScopeFactory preferenceScopeFactory,
                                         final Promises promises,
                                         final AuthorizationManager authorizationManager,
                                         final User user); @Override Promise<Void> loadPreferences(final PaginatedArchetypeList paginatedList); @Override Promise<Void> makeDefaultValue(final String alias,
                                          final boolean updateList); @Override ArchetypeTableConfiguration initConfiguration(); @Override boolean canMakeChanges(); @Override Promise<Void> savePreferences(final boolean updateList); }
GlobalArchetypeTablePresenter extends AbstractArchetypeTablePresenter { @Override public boolean canMakeChanges() { final ResourceRef resourceRef = new ResourceRef(ArchetypeManagementPerspective.IDENTIFIER, ActivityResourceType.PERSPECTIVE); return authorizationManager.authorize(resourceRef, user); } @Inject  GlobalArchetypeTablePresenter(final View view,
                                         final ArchetypeListPresenter archetypeListPresenter,
                                         final BusyIndicatorView busyIndicatorView,
                                         final TranslationService ts,
                                         final AddArchetypeModalPresenter addArchetypeModalPresenter,
                                         final ArchetypePreferences archetypePreferences,
                                         final Caller<ArchetypeService> archetypeService,
                                         final PreferenceScopeFactory preferenceScopeFactory,
                                         final Promises promises,
                                         final AuthorizationManager authorizationManager,
                                         final User user); @Override Promise<Void> loadPreferences(final PaginatedArchetypeList paginatedList); @Override Promise<Void> makeDefaultValue(final String alias,
                                          final boolean updateList); @Override ArchetypeTableConfiguration initConfiguration(); @Override boolean canMakeChanges(); @Override Promise<Void> savePreferences(final boolean updateList);  }