Schema extends ElementDefinitions<SchemaEntityDefinition, SchemaEdgeDefinition> implements Cloneable { @JsonIgnore public boolean isAggregationEnabled() { boolean isEnabled = false; for (final Entry<String, ? extends SchemaElementDefinition> entry : getElementDefinitions()) { if (null != entry.getValue() && entry.getValue().isAggregate()) { isEnabled = true; break; } } return isEnabled; } Schema(); protected  Schema(final Map<String, TypeDefinition> types); static Schema fromJson(final InputStream... inputStreams); static Schema fromJson(final Path... filePaths); static Schema fromJson(final byte[]... jsonBytes); @Deprecated String getId(); @Deprecated void setId(final String id); @SuppressWarnings("CloneDoesntCallSuperClone") @SuppressFBWarnings(value = "CN_IDIOM_NO_SUPER_CALL", justification = "Uses toJson instead.") @Override Schema clone(); @JsonIgnore boolean isAggregationEnabled(); @JsonIgnore List<String> getAggregatedGroups(); ValidationResult validate(); boolean hasValidation(); Map<String, TypeDefinition> getTypes(); TypeDefinition getType(final String typeName); @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "class") Serialiser getVertexSerialiser(); @Deprecated @JsonIgnore String getVertexSerialiserClass(); @Override SchemaElementDefinition getElement(final String group); String getVisibilityProperty(); @Deprecated String getTimestampProperty(); Map<String, String> getConfig(); String getConfig(final String key); void addConfig(final String key, final String value); @Override String toString(); byte[] toCompactJson();  }
@Test public void shouldReturnTrueWhenSchemaHasAggregationEnabled() { final Schema schemaWithAggregators = new Schema.Builder() .entity(TestGroups.ENTITY, new SchemaEntityDefinition.Builder().aggregate(true).build()) .build(); assertTrue(schemaWithAggregators.isAggregationEnabled()); }
@Test public void shouldReturnFalseWhenSchemaHasAggregationDisabled() { final Schema schemaNoAggregators = new Schema.Builder().entity(TestGroups.ENTITY, new SchemaEntityDefinition.Builder().aggregate(false).build()).build(); assertFalse(schemaNoAggregators.isAggregationEnabled()); }