GroupsExplorer extends AbstractEntityExplorer<Group> { void onAddUsersToGroup(@Observes final AddUsersToGroupEvent addUsersToGroupEvent) { attemptToShowSearch(); } @Inject  GroupsExplorer(final ClientUserSystemManager userSystemManager,
                          final Event<OnErrorEvent> errorEvent,
                          final LoadingBox loadingBox,
                          final EntitiesList<Group> entitiesList,
                          final EntitiesExplorerView view,
                          final Event<ReadGroupEvent> readGroupEvent,
                          final Event<NewGroupEvent> newGroupEvent); @Override Widget asWidget();  }
@Test public void testOnAddUsersToGroupEvent() throws Exception { final AddUsersToGroupEvent addUsersToGroupEvent = mock(AddUsersToGroupEvent.class); presenter.context = mock(ExplorerViewContext.class); presenter.onAddUsersToGroup(addUsersToGroupEvent); verify(groupsManagerService, times(1)).search(any(AbstractEntityManager.SearchRequest.class)); }
@Test public void testOnAddUsersToGroupEventButNoContext() throws Exception { final AddUsersToGroupEvent addUsersToGroupEvent = mock(AddUsersToGroupEvent.class); presenter.context = null; presenter.onAddUsersToGroup(addUsersToGroupEvent); verify(groupsManagerService, never()).search(any(AbstractEntityManager.SearchRequest.class)); }