use of com.b2international.snowowl.core.branch.compare.BranchCompareResult in project snow-owl by b2ihealthcare.
the class BranchCompareRequestTest method compareBranchWithNewComponentOnExistingComponent.
@Test
public void compareBranchWithNewComponentOnExistingComponent() throws Exception {
final Set<ComponentIdentifier> componentsOnParentBranch = prepareBranchWithNewChanges(branchPath);
final String taskBranchPath = createBranch(branchPath, "taskBranch");
final ComponentIdentifier concept = componentsOnParentBranch.stream().filter(ci -> ci.getComponentType() == SnomedConcept.TYPE).findFirst().get();
final String newDescriptionId = SnomedRequests.prepareNewDescription().setIdFromNamespace(null).setConceptId(concept.getComponentId()).setTerm("New Description").setModuleId(Concepts.MODULE_SCT_CORE).setLanguageCode("en").setTypeId(Concepts.FULLY_SPECIFIED_NAME).build(taskBranchPath, RestExtensions.USER, "Create new Description on Concept: " + concept.getComponentId()).execute(bus).getSync(1, TimeUnit.MINUTES).getResultAs(String.class);
final ComponentIdentifier newDescription = ComponentIdentifier.of(SnomedDescription.TYPE, newDescriptionId);
final BranchCompareResult compareResult = compare(branchPath, taskBranchPath);
assertThat(compareResult.getNewComponents()).containsOnly(newDescription);
assertThat(compareResult.getChangedComponents()).containsOnly(concept);
assertThat(compareResult.getDeletedComponents()).isEmpty();
}
use of com.b2international.snowowl.core.branch.compare.BranchCompareResult in project snow-owl by b2ihealthcare.
the class BranchCompareRequestTest method compareBranchWithNewComponents.
@Test
public void compareBranchWithNewComponents() throws Exception {
final Set<ComponentIdentifier> newIds = prepareBranchWithNewChanges(branchPath);
final BranchCompareResult compare = compare(null, branchPath);
assertThat(compare.getNewComponents()).containsAll(newIds);
assertThat(compare.getChangedComponents()).doesNotContainAnyElementsOf(newIds);
assertThat(compare.getDeletedComponents()).isEmpty();
}
use of com.b2international.snowowl.core.branch.compare.BranchCompareResult in project snow-owl by b2ihealthcare.
the class BranchCompareRequestTest method remoteJobSupportEmptyCompare.
@Test
public void remoteJobSupportEmptyCompare() throws Exception {
final BranchCompareResult compareResult = compareOnJob(Branch.MAIN_PATH, branchPath);
assertThat(compareResult.getCompareBranch()).isEqualTo(branchPath);
assertThat(compareResult.getBaseBranch()).isEqualTo(Branch.MAIN_PATH);
assertThat(compareResult.getNewComponents()).isEmpty();
assertThat(compareResult.getChangedComponents()).isEmpty();
assertThat(compareResult.getDeletedComponents()).isEmpty();
}
use of com.b2international.snowowl.core.branch.compare.BranchCompareResult in project snow-owl by b2ihealthcare.
the class BranchCompareRequestTest method remoteJobSupportCompareWithContent.
@Test
public void remoteJobSupportCompareWithContent() throws Exception {
final Set<ComponentIdentifier> newIds = prepareBranchWithNewChanges(branchPath);
final BranchCompareResult compare = compareOnJob(null, branchPath);
assertThat(compare.getNewComponents()).containsAll(newIds);
assertThat(compare.getChangedComponents()).doesNotContainAnyElementsOf(newIds);
assertThat(compare.getDeletedComponents()).isEmpty();
}
use of com.b2international.snowowl.core.branch.compare.BranchCompareResult in project snow-owl by b2ihealthcare.
the class BranchCompareRequestTest method compareEmptyBranchWithoutBase.
@Test
public void compareEmptyBranchWithoutBase() throws Exception {
final BranchCompareResult compareResult = compare(null, branchPath);
assertThat(compareResult.getCompareBranch()).isEqualTo(branchPath);
assertThat(compareResult.getBaseBranch()).isEqualTo(Branch.MAIN_PATH);
assertThat(compareResult.getNewComponents()).isEmpty();
assertThat(compareResult.getChangedComponents()).isEmpty();
assertThat(compareResult.getDeletedComponents()).isEmpty();
}
Aggregations