use of org.kie.kogito.persistence.api.schema.IndexDescriptor in project kogito-apps by kiegroup.
the class IndexManagerIT method testCreateCompoundIndex.
@Test
void testCreateCompoundIndex() {
String indexName = "test";
IndexDescriptor id = new IndexDescriptor(indexName, List.of("test1", "test2"));
String parentField = "test";
String prefixUUID = UUID.randomUUID().toString() + ".";
Optional<IndexModel> index = indexManager.createIndex(id, parentField, prefixUUID);
assertTrue(equalsIndexModels(List.of(index.get()), List.of(new IndexModel(Indexes.ascending(indexName + ".test1", indexName + ".test2"), new IndexOptions().name(prefixUUID + indexName).sparse(true)))));
}
use of org.kie.kogito.persistence.api.schema.IndexDescriptor in project kogito-apps by kiegroup.
the class IndexManagerIT method testCreateSingleIndex.
@Test
void testCreateSingleIndex() {
String fieldName = "id";
IndexDescriptor id = new IndexDescriptor(fieldName, List.of(fieldName));
String parentField = "";
String prefixUUID = UUID.randomUUID().toString() + ".";
Optional<IndexModel> index = indexManager.createIndex(id, parentField, prefixUUID);
assertTrue(equalsIndexModels(List.of(index.get()), List.of(new IndexModel(Indexes.ascending(fieldName), new IndexOptions().name(prefixUUID + fieldName).sparse(true)))));
}
Aggregations