ACLSettings implements IsWidget { public void edit(Role role) { isEditMode = true; 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 testEditRole() { presenter.edit(new RoleImpl("admin")); verify(view).setHomePerspectiveSelectorEnabled(true); verify(view).setPrioritySelectorEnabled(true); verify(view).setHomePerspectiveSelector(any()); verify(view).setPrioritySelector(any()); verify(homePerspectiveDropDown).setSelectedPerspective("HomeAdmin"); verify(priorityDropDown).setSelectedPriority(10); }
@Test public void testEditGroup() { presenter.edit(new GroupImpl("group1")); verify(view).setHomePerspectiveSelectorEnabled(true); verify(view).setPrioritySelectorEnabled(true); verify(view).setHomePerspectiveSelector(any()); verify(view).setPrioritySelector(any()); verify(homePerspectiveDropDown).setSelectedPerspective("HomeGroup1"); verify(priorityDropDown).setSelectedPriority(DEFAULT_PRIORITY); }