ACLSettings implements IsWidget { public void show(Role role) { isEditMode = false; open(role); } @Inject  ACLSettings(View view,
                       PermissionManager permissionManager,
                       PerspectiveDropDown homePerspectiveDropDown,
                       PerspectiveTreeProvider perspectiveTreeProvider,
                       PriorityDropDown priorityDropDown,
                       Event<HomePerspectiveChangedEvent> homePerspectiveChangedEvent,
                       Event<PriorityChangedEvent> priorityChangedEvent); @Override Widget asWidget(); PerspectiveActivity getHomePerspective(); int getPriority(); void show(Role role); void show(Group group); void edit(Role role); void edit(Group group); void updateAuthzPolicy(@Observes AuthorizationPolicySavedEvent authzPolicySavedEvent);  }
@Test public void testShowRole() { presenter.show(new RoleImpl("admin")); verify(view).setHomePerspectiveSelectorEnabled(false); verify(view).setPrioritySelectorEnabled(false); verify(view).setHomePerspectiveSelector(any()); verify(view).setPrioritySelector(any()); verify(view).setHomePerspectiveName("HomeAdmin"); verify(view).setHomePerspectiveTitle("HomeAdmin"); verify(view).setPriorityName("High"); }
@Test public void testShowGroup() { presenter.show(new GroupImpl("group1")); verify(view).setHomePerspectiveSelectorEnabled(false); verify(view).setPrioritySelectorEnabled(false); verify(view).setHomePerspectiveSelector(any()); verify(view).setPrioritySelector(any()); verify(view).setHomePerspectiveName("HomeGroup1"); verify(view).setHomePerspectiveTitle("HomeGroup1"); verify(view).setPriorityName("Very Low"); }
@Test public void testDefaultValues() { reset(view); permissionManager.setAuthorizationPolicy(permissionManager.newAuthorizationPolicy().build()); presenter = new ACLSettings(view, permissionManager, homePerspectiveDropDown, perspectiveTreeProvider, priorityDropDown, homePerspectiveChangedEvent, priorityChangedEvent); presenter.show(new RoleImpl("admin")); verify(view).setHomePerspectiveSelectorEnabled(false); verify(view).setPrioritySelectorEnabled(false); verify(view).setHomePerspectiveSelector(any()); verify(view).setPrioritySelector(any()); verify(view).setHomePerspectiveName("DefaultPerspective"); verify(view).setHomePerspectiveTitle("DefaultPerspective"); verify(view).setPriorityName("Very Low"); }