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