GroupsExplorer extends AbstractEntityExplorer<Group> { void onGroupCreated(@Observes final CreateGroupEvent createGroupEvent) { 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 testOnCreateGroup() throws Exception { final CreateGroupEvent createGroupEvent = mock(CreateGroupEvent.class); presenter.context = mock(ExplorerViewContext.class); presenter.onGroupCreated(createGroupEvent); verify(groupsManagerService, times(1)).search(any(AbstractEntityManager.SearchRequest.class)); }
@Test public void testOnCreateGroupButNoContext() throws Exception { final CreateGroupEvent createGroupEvent = mock(CreateGroupEvent.class); presenter.context = null; presenter.onGroupCreated(createGroupEvent); verify(groupsManagerService, never()).search(any(AbstractEntityManager.SearchRequest.class)); }