assertEquals(((OPropertyMapIndexDefinition) indexDefinition).getIndexBy(), OPropertyMapIndexDefinition.INDEX_BY.KEY);
}
@Test
public void testCreateOnePropertyByValueEmbeddedMapIndex() {
final OIndex result = oClass.createIndex("ClassIndexTestPropertyByValueEmbeddedMap", OClass.INDEX_TYPE.UNIQUE,
"fEmbeddedMap by value");
assertEquals(result.getName(), "ClassIndexTestPropertyByValueEmbeddedMap");
assertEquals(oClass.getClassIndex("ClassIndexTestPropertyByValueEmbeddedMap").getName(), result.getName());
assertEquals(
database.getMetadata().getIndexManager().getClassIndex("ClassIndexTestClass", "ClassIndexTestPropertyByValueEmbeddedMap")
.getName(), result.getName());
final OIndexDefinition indexDefinition = result.getDefinition();
assertTrue(indexDefinition instanceof OPropertyMapIndexDefinition);
assertEquals(indexDefinition.getFields().get(0), "fEmbeddedMap");
assertEquals(indexDefinition.getTypes()[0], OType.INTEGER);
assertEquals(((OPropertyMapIndexDefinition) indexDefinition).getIndexBy(), OPropertyMapIndexDefinition.INDEX_BY.VALUE);