Skip to content

Instantly share code, notes, and snippets.

@tomblench
Created June 24, 2015 15:52
Show Gist options
  • Save tomblench/c314402d333332853060 to your computer and use it in GitHub Desktop.
Save tomblench/c314402d333332853060 to your computer and use it in GitHub Desktop.
@Test
public void forceInsert_noCommonHistory() throws Exception {
// rev6 represents the current state after we lost all of the history from 1 -> 5
BasicDocumentRevision rev6 = createDbObject("6-x", bodyOne);
// rev7 represents an incoming change which has deleted set
BasicDocumentRevision rev7 = createDbObject("7-x", bodyTwo);
//BasicDocumentRevision rev7 = createDbObjectDeleted("7-x");
// rev2 represents an incoming change which will not have an ancestor because it was lost
BasicDocumentRevision rev2 = createDbObject("2-x", bodyTwo);
datastore.forceInsert(rev6, "6-x");
datastore.forceInsert(rev7, "6-x", "7-x");
datastore.forceInsert(rev2, "1-x", "2-x");
System.out.println(datastore.getDocument(OBJECT_ID));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment