use of com.b2international.snowowl.core.api.IBranchPath in project snow-owl by b2ihealthcare.
the class SnomedMergeApiTest method rebaseConceptDeletionOverNewInboundRelationships.
@Test
public void rebaseConceptDeletionOverNewInboundRelationships() throws Exception {
// new concept on test branch
final String deletedConcept = createNewConcept(branchPath);
// new child branch of test parent branch
final IBranchPath a = BranchPathUtils.createPath(branchPath, "a");
branching.createBranch(a).statusCode(201);
// create a new relationship to newly created destination concept on parent branch
final String newInboundRelationshipToDeletedConcept = createNewRelationship(branchPath, Concepts.ROOT_CONCEPT, Concepts.FINDING_SITE, deletedConcept, Concepts.INFERRED_RELATIONSHIP);
// delete destination concept on child branch
deleteComponent(a, SnomedComponentType.CONCEPT, deletedConcept, false);
// rebase child branch with deletion over new relationship, this should succeed, but should also implicitly delete the relationship
merge(branchPath, a, "Rebased concept deletion over new inbound relationship").body("status", equalTo(Merge.Status.CONFLICTS.name()));
// relationships should be deleted along with the already deleted destination concept
getComponent(a, SnomedComponentType.RELATIONSHIP, newInboundRelationshipToDeletedConcept).statusCode(404);
}
use of com.b2international.snowowl.core.api.IBranchPath in project snow-owl by b2ihealthcare.
the class SnomedMergeApiTest method rebaseDivergedThenMerge.
@Test
public void rebaseDivergedThenMerge() throws Exception {
final IBranchPath task1 = BranchPathUtils.createPath(branchPath, "task1");
branching.createBranch(task1).statusCode(201);
final IBranchPath task2 = BranchPathUtils.createPath(branchPath, "task2");
branching.createBranch(task2).statusCode(201);
final String task1Concept = createNewConcept(task1);
final String task2Concept = createNewConcept(task2);
final String parentConcept = createNewConcept(branchPath);
// Synchronization makes parentConcept visible on task 2
getComponent(task2, SnomedComponentType.CONCEPT, parentConcept).statusCode(404);
merge(branchPath, task2, "Synchronize task 2").body("status", equalTo(Merge.Status.COMPLETED.name()));
getComponent(task2, SnomedComponentType.CONCEPT, parentConcept).statusCode(200);
// Synchronization makes parentConcept visible on task 1
getComponent(task1, SnomedComponentType.CONCEPT, parentConcept).statusCode(404);
merge(branchPath, task1, "Synchronize task 1").body("status", equalTo(Merge.Status.COMPLETED.name()));
getComponent(task1, SnomedComponentType.CONCEPT, parentConcept).statusCode(200);
// Promotion makes task2Concept visible on parent branch
getComponent(branchPath, SnomedComponentType.CONCEPT, task2Concept).statusCode(404);
merge(task2, branchPath, "Promote task 2").body("status", equalTo(Merge.Status.COMPLETED.name()));
getComponent(branchPath, SnomedComponentType.CONCEPT, task2Concept).statusCode(200);
// Synchronization makes task2Concept (that was just promoted to the parent branch) visible on task 1
getComponent(task1, SnomedComponentType.CONCEPT, task2Concept).statusCode(404);
merge(branchPath, task1, "Synchronize task 1 after promoting task 2").body("status", equalTo(Merge.Status.COMPLETED.name()));
getComponent(task1, SnomedComponentType.CONCEPT, task2Concept).statusCode(200);
// Promotion makes task1Concept visible on parent branch
getComponent(branchPath, SnomedComponentType.CONCEPT, task1Concept).statusCode(404);
merge(task1, branchPath, "Promote task 1").body("status", equalTo(Merge.Status.COMPLETED.name()));
getComponent(branchPath, SnomedComponentType.CONCEPT, task1Concept).statusCode(200);
}
use of com.b2international.snowowl.core.api.IBranchPath in project snow-owl by b2ihealthcare.
the class SnomedMergeApiTest method mergeNewConceptForwardWithChildBranchDelete.
@Test
public void mergeNewConceptForwardWithChildBranchDelete() {
final IBranchPath a = BranchPathUtils.createPath(branchPath, "a");
branching.createBranch(a).statusCode(201);
final String conceptId = createNewConcept(a);
merge(a, branchPath, "Merged new concept from child branch").body("status", equalTo(Merge.Status.COMPLETED.name()));
branching.deleteBranch(a).statusCode(204);
// getComponent(a, SnomedComponentType.CONCEPT, conceptId).statusCode(404);
SnomedConcept concept = getConcept(conceptId, "descriptions(),relationships()");
assertFalse(concept.getDescriptions().isEmpty());
assertFalse(concept.getRelationships().isEmpty());
}
use of com.b2international.snowowl.core.api.IBranchPath in project snow-owl by b2ihealthcare.
the class SnomedMergeApiTest method mergeNewRelationshipForward.
@Test
public void mergeNewRelationshipForward() {
final IBranchPath a = BranchPathUtils.createPath(branchPath, "a");
branching.createBranch(a).statusCode(201);
String relationshipId = createNewRelationship(a);
merge(a, branchPath, "Merged new relationship from child branch").body("status", equalTo(Merge.Status.COMPLETED.name()));
getComponent(a, SnomedComponentType.RELATIONSHIP, relationshipId).statusCode(200);
getComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId).statusCode(200);
}
use of com.b2international.snowowl.core.api.IBranchPath in project snow-owl by b2ihealthcare.
the class SnomedMergeApiTest method rebaseChangedDescriptionOnParentDeletedOnBranch.
@Test
public void rebaseChangedDescriptionOnParentDeletedOnBranch() {
final String descriptionId = createNewDescription(branchPath);
final IBranchPath a = BranchPathUtils.createPath(branchPath, "a");
branching.createBranch(a).statusCode(201);
// Parent branch changes to CaseSignificance.ENTIRE_TERM_CASE_SENSITIVE
changeCaseSignificance(branchPath, descriptionId);
deleteComponent(a, SnomedComponentType.DESCRIPTION, descriptionId, false).statusCode(204);
merge(branchPath, a, "Rebased deletion over case significance change").body("status", equalTo(Merge.Status.COMPLETED.name()));
getComponent(branchPath, SnomedComponentType.DESCRIPTION, descriptionId).statusCode(200).body("caseSignificanceId", equalTo(Concepts.ENTIRE_TERM_CASE_SENSITIVE));
getComponent(a, SnomedComponentType.DESCRIPTION, descriptionId).statusCode(404);
}
Aggregations