@Test public void filterIteratorByVisibilityForwardsCalls() { final Collection<PrimaryEntity> entities = Collections.singletonList(this.entity); final Iterator<PrimaryEntity> entityIterator = entities.iterator(); when(this.visibilityManager.filterByVisibility(entityIterator, PUBLIC_VISIBILITY)) .thenReturn(Collections.emptyIterator()); Assert.assertFalse(this.component.filterByVisibility(entityIterator, PUBLIC_VISIBILITY).hasNext()); verify(this.visibilityManager, times(1)) .filterByVisibility(entityIterator, PUBLIC_VISIBILITY); }
@Nonnull @Override public Collection<? extends PrimaryEntity> filterByVisibility( @Nullable final Collection<? extends PrimaryEntity> entities, @Nullable final Visibility requiredVisibility) { return this.visibilityManager.filterByVisibility(entities, requiredVisibility); }
DefaultEntityPermissionsManager implements EntityPermissionsManager { @Nonnull @Override public Collection<? extends PrimaryEntity> filterByVisibility( @Nullable final Collection<? extends PrimaryEntity> entities, @Nullable final Visibility requiredVisibility) { return this.visibilityManager.filterByVisibility(entities, requiredVisibility); } }
DefaultEntityPermissionsManager implements EntityPermissionsManager { @Nonnull @Override public Collection<? extends PrimaryEntity> filterByVisibility( @Nullable final Collection<? extends PrimaryEntity> entities, @Nullable final Visibility requiredVisibility) { return this.visibilityManager.filterByVisibility(entities, requiredVisibility); }  }
DefaultEntityPermissionsManager implements EntityPermissionsManager { @Nonnull @Override public Collection<? extends PrimaryEntity> filterByVisibility( @Nullable final Collection<? extends PrimaryEntity> entities, @Nullable final Visibility requiredVisibility) { return this.visibilityManager.filterByVisibility(entities, requiredVisibility); }  @Nonnull @Override Collection<Visibility> listVisibilityOptions(); @Nonnull @Override Collection<Visibility> listAllVisibilityOptions(); @Nonnull @Override Visibility getDefaultVisibility(); @Nonnull @Override Visibility resolveVisibility(@Nullable final String name); @Nonnull @Override Collection<AccessLevel> listAccessLevels(); @Nonnull @Override Collection<AccessLevel> listAllAccessLevels(); @Nonnull @Override AccessLevel resolveAccessLevel(@Nullable final String name); @Nonnull @Override EntityAccess getEntityAccess(@Nullable final PrimaryEntity targetPatient); @Nonnull @Override Collection<? extends PrimaryEntity> filterByVisibility(
        @Nullable final Collection<? extends PrimaryEntity> entities,
        @Nullable final Visibility requiredVisibility); @Nonnull @Override Iterator<? extends PrimaryEntity> filterByVisibility(
        @Nullable final Iterator<? extends PrimaryEntity> entities,
        @Nullable final Visibility requiredVisibility); @Override void fireRightsUpdateEvent(@Nonnull final String entityId); }
DefaultEntityPermissionsManager implements EntityPermissionsManager { @Nonnull @Override public Collection<? extends PrimaryEntity> filterByVisibility( @Nullable final Collection<? extends PrimaryEntity> entities, @Nullable final Visibility requiredVisibility) { return this.visibilityManager.filterByVisibility(entities, requiredVisibility); }  @Nonnull @Override Collection<Visibility> listVisibilityOptions(); @Nonnull @Override Collection<Visibility> listAllVisibilityOptions(); @Nonnull @Override Visibility getDefaultVisibility(); @Nonnull @Override Visibility resolveVisibility(@Nullable final String name); @Nonnull @Override Collection<AccessLevel> listAccessLevels(); @Nonnull @Override Collection<AccessLevel> listAllAccessLevels(); @Nonnull @Override AccessLevel resolveAccessLevel(@Nullable final String name); @Nonnull @Override EntityAccess getEntityAccess(@Nullable final PrimaryEntity targetPatient); @Nonnull @Override Collection<? extends PrimaryEntity> filterByVisibility(
        @Nullable final Collection<? extends PrimaryEntity> entities,
        @Nullable final Visibility requiredVisibility); @Nonnull @Override Iterator<? extends PrimaryEntity> filterByVisibility(
        @Nullable final Iterator<? extends PrimaryEntity> entities,
        @Nullable final Visibility requiredVisibility); @Override void fireRightsUpdateEvent(@Nonnull final String entityId);  }