CDefinition OldDefinition = JsonUtil.objectFromJsonResource(CDefinition.class, this.getClass().getClassLoader(), "MigrationTestCDefinition.js");
CDefinition NewDefinition = JsonUtil.objectFromJsonResource(CDefinition.class, this.getClass().getClassLoader(), "MigrationTestCDefinition.js");
NewDefinition.getIndexes().remove("index_1:value");
CIndex newIndex1 = new CIndex();
newIndex1.setKey("index_1:index_2");
newIndex1.setShardingStrategy(new ShardingStrategyNone());
NewDefinition.getIndexes().put(newIndex1.getName(), newIndex1);
CIndex newIndex2 = new CIndex();
newIndex2.setKey("value");
newIndex2.setShardingStrategy(new ShardingStrategyNone());
NewDefinition.getIndexes().put(newIndex2.getName(), newIndex2);
CField newField = new CField("newfield", CField.CDataType.VARCHAR);
NewDefinition.getFields().put(newField.getName(),newField);
CObjectMigrator subject = new CObjectMigrator(OldDefinition,NewDefinition);
assertEquals(subject.getNewIndexes().size(), 2);