@Test public void getVisibilityWithInvalidVisibility() { when(this.helper.getStringProperty(this.entityDoc1, VISIBILITY_CLASS_1, VISIBILITY)).thenReturn("invalid"); Assert.assertEquals(this.privateVisibility, this.component.getVisibility(this.entity1)); }
@Nonnull @Override public Visibility getVisibility(@Nullable final PrimaryEntity entity) { if (entity == null) { return this.privateVisibility; } final DocumentReference classReference = this.partialEntityResolver.resolve(Visibility.CLASS_REFERENCE, entity.getDocumentReference()); final String visibility = this.helper.getStringProperty(entity.getXDocument(), classReference, VISIBILITY); return resolveVisibility(visibility); }
DefaultEntityVisibilityManager implements EntityVisibilityManager { @Nonnull @Override public Visibility getVisibility(@Nullable final PrimaryEntity entity) { if (entity == null) { return this.privateVisibility; } final DocumentReference classReference = this.partialEntityResolver.resolve(Visibility.CLASS_REFERENCE, entity.getDocumentReference()); final String visibility = this.helper.getStringProperty(entity.getXDocument(), classReference, VISIBILITY); return resolveVisibility(visibility); } }
DefaultEntityVisibilityManager implements EntityVisibilityManager { @Nonnull @Override public Visibility getVisibility(@Nullable final PrimaryEntity entity) { if (entity == null) { return this.privateVisibility; } final DocumentReference classReference = this.partialEntityResolver.resolve(Visibility.CLASS_REFERENCE, entity.getDocumentReference()); final String visibility = this.helper.getStringProperty(entity.getXDocument(), classReference, VISIBILITY); return resolveVisibility(visibility); }  }
DefaultEntityVisibilityManager implements EntityVisibilityManager { @Nonnull @Override public Visibility getVisibility(@Nullable final PrimaryEntity entity) { if (entity == null) { return this.privateVisibility; } final DocumentReference classReference = this.partialEntityResolver.resolve(Visibility.CLASS_REFERENCE, entity.getDocumentReference()); final String visibility = this.helper.getStringProperty(entity.getXDocument(), classReference, VISIBILITY); return resolveVisibility(visibility); }  @Nonnull @Override Collection<Visibility> listVisibilityOptions(); @Nonnull @Override Collection<Visibility> listAllVisibilityOptions(); @Nonnull @Override Visibility getDefaultVisibility(); @Nonnull @Override Visibility resolveVisibility(@Nullable final String name); @Override boolean setVisibility(
        @Nullable final PrimaryEntity entity,
        @Nullable final Visibility visibility); @Nonnull @Override Visibility getVisibility(@Nullable final PrimaryEntity entity); @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); }
DefaultEntityVisibilityManager implements EntityVisibilityManager { @Nonnull @Override public Visibility getVisibility(@Nullable final PrimaryEntity entity) { if (entity == null) { return this.privateVisibility; } final DocumentReference classReference = this.partialEntityResolver.resolve(Visibility.CLASS_REFERENCE, entity.getDocumentReference()); final String visibility = this.helper.getStringProperty(entity.getXDocument(), classReference, VISIBILITY); return resolveVisibility(visibility); }  @Nonnull @Override Collection<Visibility> listVisibilityOptions(); @Nonnull @Override Collection<Visibility> listAllVisibilityOptions(); @Nonnull @Override Visibility getDefaultVisibility(); @Nonnull @Override Visibility resolveVisibility(@Nullable final String name); @Override boolean setVisibility(
        @Nullable final PrimaryEntity entity,
        @Nullable final Visibility visibility); @Nonnull @Override Visibility getVisibility(@Nullable final PrimaryEntity entity); @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);  }