@Test public void filterIteratorByVisibilityForwardsCalls() throws ComponentLookupException { EntityPermissionsManager internal = this.mocker.getInstance(EntityPermissionsManager.class); Iterator<? extends PrimaryEntity> input = new ArrayList<PrimaryEntity>().iterator(); doReturn(input).when(internal).filterByVisibility(input, this.publicVisibility); Iterator<? extends PrimaryEntity> result = this.mocker.getComponentUnderTest().filterByVisibility(input, this.publicVisibility); Mockito.verify(internal).filterByVisibility(input, this.publicVisibility); Assert.assertSame(input, result); }
@Nonnull @Override public Collection<? extends PrimaryEntity> filterByVisibility( @Nullable final Collection<? extends PrimaryEntity> entities, @Nullable final Visibility requiredVisibility) { return this.internalService.filterByVisibility(entities, requiredVisibility); }
SecureEntityPermissionsManager implements EntityPermissionsManager { @Nonnull @Override public Collection<? extends PrimaryEntity> filterByVisibility( @Nullable final Collection<? extends PrimaryEntity> entities, @Nullable final Visibility requiredVisibility) { return this.internalService.filterByVisibility(entities, requiredVisibility); } }
SecureEntityPermissionsManager implements EntityPermissionsManager { @Nonnull @Override public Collection<? extends PrimaryEntity> filterByVisibility( @Nullable final Collection<? extends PrimaryEntity> entities, @Nullable final Visibility requiredVisibility) { return this.internalService.filterByVisibility(entities, requiredVisibility); }  }
SecureEntityPermissionsManager implements EntityPermissionsManager { @Nonnull @Override public Collection<? extends PrimaryEntity> filterByVisibility( @Nullable final Collection<? extends PrimaryEntity> entities, @Nullable final Visibility requiredVisibility) { return this.internalService.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 targetEntity); @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); }
SecureEntityPermissionsManager implements EntityPermissionsManager { @Nonnull @Override public Collection<? extends PrimaryEntity> filterByVisibility( @Nullable final Collection<? extends PrimaryEntity> entities, @Nullable final Visibility requiredVisibility) { return this.internalService.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 targetEntity); @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);  }