use of com.b2international.snowowl.core.api.IBranchPath in project snow-owl by b2ihealthcare.
the class SnomedMergeConflictTest method rebaseModuleChangeOverNewRelationship.
@Test
public void rebaseModuleChangeOverNewRelationship() throws Exception {
final String concept = createNewConcept(branchPath);
final IBranchPath a = BranchPathUtils.createPath(branchPath, "a");
branching.createBranch(a).statusCode(201);
String relationshipOnChild = createNewRelationship(a, concept, Concepts.IS_A, Concepts.REFSET_ALL);
final Map<?, ?> moduleUpdateOnParent = Map.of("moduleId", Concepts.MODULE_ROOT, "commitComment", "Update module");
updateComponent(branchPath, SnomedComponentType.CONCEPT, concept, moduleUpdateOnParent);
merge(branchPath, a, "Rebase branch A").body("status", equalTo(Merge.Status.COMPLETED.name()));
getComponent(branchPath, SnomedComponentType.CONCEPT, concept).statusCode(200).body("moduleId", equalTo(Concepts.MODULE_ROOT));
getComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipOnChild).statusCode(404);
getComponent(a, SnomedComponentType.CONCEPT, concept).statusCode(200).body("moduleId", equalTo(Concepts.MODULE_ROOT));
getComponent(a, SnomedComponentType.RELATIONSHIP, relationshipOnChild).statusCode(200);
}
use of com.b2international.snowowl.core.api.IBranchPath in project snow-owl by b2ihealthcare.
the class SnomedMergeApiTest method mergeNewDescriptionForward.
@Test
public void mergeNewDescriptionForward() {
final IBranchPath a = BranchPathUtils.createPath(branchPath, "a");
branching.createBranch(a).statusCode(201);
final String descriptionId = createNewDescription(a);
merge(a, branchPath, "Merged new description from child branch").body("status", equalTo(Merge.Status.COMPLETED.name()));
getComponent(a, SnomedComponentType.DESCRIPTION, descriptionId).statusCode(200);
getComponent(branchPath, SnomedComponentType.DESCRIPTION, descriptionId).statusCode(200);
}
use of com.b2international.snowowl.core.api.IBranchPath in project snow-owl by b2ihealthcare.
the class SnomedDescriptionApiTest method deleteDescriptionOnNestedBranch.
@Test
public void deleteDescriptionOnNestedBranch() {
String conceptId = createNewConcept(branchPath);
List<String> descriptionIds = newArrayList();
for (int i = 0; i < 5; i++) {
String descriptionId = createNewDescription(branchPath, conceptId);
descriptionIds.add(descriptionId);
}
IBranchPath a = BranchPathUtils.createPath(branchPath, "a");
IBranchPath b = BranchPathUtils.createPath(a, "b");
branching.createBranchRecursively(b);
// New description on nested branch resets the concept's version to 1 again
createNewDescription(b, conceptId);
// Deleting a description from the middle should work
String descriptionToDeleteId = descriptionIds.remove(2);
deleteComponent(branchPath, SnomedComponentType.DESCRIPTION, descriptionToDeleteId, false).statusCode(204);
getComponent(branchPath, SnomedComponentType.DESCRIPTION, descriptionToDeleteId).statusCode(404);
deleteComponent(b, SnomedComponentType.DESCRIPTION, descriptionToDeleteId, false).statusCode(204);
getComponent(b, SnomedComponentType.DESCRIPTION, descriptionToDeleteId).statusCode(404);
// All the remaining descriptions should be visible
for (String descriptionId : descriptionIds) {
getComponent(branchPath, SnomedComponentType.DESCRIPTION, descriptionId).statusCode(200);
getComponent(b, SnomedComponentType.DESCRIPTION, descriptionId).statusCode(200);
}
}
use of com.b2international.snowowl.core.api.IBranchPath in project snow-owl by b2ihealthcare.
the class SnomedRelationshipApiTest method createRelationshipOnNestedBranch.
@Test
public void createRelationshipOnNestedBranch() {
IBranchPath a = BranchPathUtils.createPath(branchPath, "a");
IBranchPath b = BranchPathUtils.createPath(a, "b");
branching.createBranchRecursively(b);
String relationshipId = createNewRelationship(b);
getComponent(b, SnomedComponentType.RELATIONSHIP, relationshipId).statusCode(200);
getComponent(a, SnomedComponentType.RELATIONSHIP, relationshipId).statusCode(404);
getComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId).statusCode(404);
}
use of com.b2international.snowowl.core.api.IBranchPath in project snow-owl by b2ihealthcare.
the class SnomedDescriptionApiTest method createDescriptionOnNestedBranch.
@Test
public void createDescriptionOnNestedBranch() {
IBranchPath a = BranchPathUtils.createPath(branchPath, "a");
IBranchPath b = BranchPathUtils.createPath(a, "b");
branching.createBranchRecursively(b);
String descriptionId = createNewDescription(b);
getComponent(b, SnomedComponentType.DESCRIPTION, descriptionId).statusCode(200);
getComponent(a, SnomedComponentType.DESCRIPTION, descriptionId).statusCode(404);
getComponent(branchPath, SnomedComponentType.DESCRIPTION, descriptionId).statusCode(404);
}
Aggregations