Search in sources :

Example 1 with ContainerRevisionData

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);
}
Also used : ContainerRevisionData(com.b2international.index.revision.RevisionFixtures.ContainerRevisionData) ComponentRevisionData(com.b2international.index.revision.RevisionFixtures.ComponentRevisionData) Test(org.junit.Test)

Aggregations

ComponentRevisionData (com.b2international.index.revision.RevisionFixtures.ComponentRevisionData)1 ContainerRevisionData (com.b2international.index.revision.RevisionFixtures.ContainerRevisionData)1 Test (org.junit.Test)1