use of org.neo4j.internal.schema.IndexConfig in project neo4j by neo4j.
the class GenericNativeIndexProviderTest method mustCompleteIndexDescriptorConfigurationsWithSpatialConfig.
@Test
void mustCompleteIndexDescriptorConfigurationsWithSpatialConfig() {
// Given
DatabaseIndexContext context = DatabaseIndexContext.builder(null, null, DEFAULT_DATABASE_NAME).build();
GenericNativeIndexProvider provider = new GenericNativeIndexProvider(context, IndexDirectoryStructure.NONE, null, Config.defaults());
LabelSchemaDescriptor incompleteSchema = SchemaDescriptor.forLabel(1, 1);
IndexDescriptor incompleteDescriptor = IndexPrototype.forSchema(incompleteSchema, IndexProviderDescriptor.UNDECIDED).withName("index").materialise(1);
// When
IndexDescriptor completedDescriptor = provider.completeConfiguration(incompleteDescriptor);
// Then
IndexConfig sinfulIndexConfig = incompleteDescriptor.getIndexConfig();
IndexConfig completedIndexConfig = completedDescriptor.getIndexConfig();
assertEquals(0, sinfulIndexConfig.entries().count(p -> true), "expected sinful index config to have no entries");
for (CoordinateReferenceSystem crs : CoordinateReferenceSystem.all()) {
assertNotNull(completedIndexConfig.get(spatialMinSettingForCrs(crs).getSettingName()));
assertNotNull(completedIndexConfig.get(spatialMaxSettingForCrs(crs).getSettingName()));
}
}
Aggregations