/**
* Bookkeeping for codebases different at head and equivalent at migrated revs.
*/
public void testOneSubmittedMigration_equivalent() throws Exception {
InMemoryFileSystem fileSystem = new InMemoryFileSystem(ImmutableMap.of(
"/path/to/db", "{\"equivalences\":[], \"migrations\":[]}",
"/dummy/codebase/int/1/file", "1",
"/dummy/codebase/pub/1/", "empty dir (different)",
"/dummy/codebase/int/migrated_from/file", "migrated_from",
"/dummy/codebase/pub/migrated_to/file", "migrated_to (equivalent)"
));
AppContext.RUN.fileSystem = fileSystem;
BookkeepingDirective d = new BookkeepingDirective();
d.getFlags().configFilename = "moe_config.txt";
d.getFlags().dbLocation = DB_FILE.getAbsolutePath();
expectDiffs();
control.replay();
assertEquals(0, d.perform());
control.verify();
// expected db at end of call to bookkeep
DbStorage dbStorage = new DbStorage();
dbStorage.addEquivalence(new Equivalence(
new Revision("migrated_from", "int"), new Revision("migrated_to", "pub")));
dbStorage.addMigration(new SubmittedMigration(
new Revision("migrated_from", "int"), new Revision("migrated_to", "pub")));
FileDb expectedDb = new FileDb(dbStorage);
assertEquals(expectedDb.toJsonString(), fileSystem.fileToString(DB_FILE));
}