use of com.b2international.index.revision.RevisionFixtures.ContainerRevisionData in project snow-owl by b2ihealthcare.
the class RevisionCompareTest method compareBranchWithChangedRootAndChildThenDeletedRootObject.
@Test
public void compareBranchWithChangedRootAndChildThenDeletedRootObject() throws Exception {
final ContainerRevisionData container = new ContainerRevisionData(STORAGE_KEY1);
final ComponentRevisionData component = new ComponentRevisionData(STORAGE_KEY2, STORAGE_KEY1, "value");
indexRevision(MAIN, container, component);
final String branch = createBranch(MAIN, "a");
final ComponentRevisionData componentChanged = new ComponentRevisionData(STORAGE_KEY2, STORAGE_KEY1, "valueChanged");
indexChange(branch, component, componentChanged);
deleteRevision(branch, ComponentRevisionData.class, STORAGE_KEY2);
deleteRevision(branch, ContainerRevisionData.class, STORAGE_KEY1);
final RevisionCompare compare = index().compare(MAIN, branch);
assertThat(compare.getDetails()).hasSize(2);
assertThat(compare.getTotalAdded()).isEqualTo(0);
assertThat(compare.getTotalChanged()).isEqualTo(0);
assertThat(compare.getTotalRemoved()).isEqualTo(2);
}
Aggregations