use of com.b2international.snowowl.core.branch.compare.BranchCompareResult in project snow-owl by b2ihealthcare.
the class SnomedCompareRestRequestTest method testCompareWithDeletedComponents.
@Test
public void testCompareWithDeletedComponents() throws Exception {
final String newConceptId = createNewConcept(parentBranch);
final String parentBranchPath = parentBranch.toString();
final String childBranchPath = createBranch(parentBranchPath, "SNOMEDCT-DELETED");
final Set<ComponentIdentifier> newIds = prepareNewChanges(newConceptId, parentBranch);
final ComponentIdentifier concept = newIds.stream().filter(ci -> ci.getComponentType() == SnomedConcept.TYPE).findFirst().get();
SnomedRequests.prepareDeleteConcept(concept.getComponentId()).build(childBranchPath, RestExtensions.USER, "Delete concept on child branch").execute(bus).getSync();
final BranchCompareResult compareResult = getCompareResult(parentBranchPath, childBranchPath);
// compare task branch and its parent
assertThat(compareResult.getNewComponents()).isEmpty();
assertThat(compareResult.getChangedComponents()).isEmpty();
assertThat(compareResult.getDeletedComponents()).containsAll(newIds);
}
use of com.b2international.snowowl.core.branch.compare.BranchCompareResult in project snow-owl by b2ihealthcare.
the class SnomedCompareRestRequestTest method testCompareWithChangedNewComponents.
@Test
public void testCompareWithChangedNewComponents() throws IOException {
final String newConceptId = createNewConcept(branchPath);
final BranchCompareResult compareResult = getCompareResult(parentBranch.getPath(), branchPath.getPath());
final Set<ComponentIdentifier> newIds = prepareNewChanges(newConceptId, branchPath);
assertThat(compareResult.getNewComponents()).containsAll(newIds);
assertThat(compareResult.getChangedComponents()).doesNotContainAnyElementsOf(newIds);
assertThat(compareResult.getDeletedComponents()).isEmpty();
}
Aggregations