use of com.b2international.snowowl.core.api.IBranchPath in project snow-owl by b2ihealthcare.
the class SnomedMergeApiTest method rebaseConceptDeletionOverNewOutboundRelationships.
@Ignore
@Test
public void rebaseConceptDeletionOverNewOutboundRelationships() 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 outbound relationship
final String newOutboundRelationshipFromDeletedConcept = createNewRelationship(branchPath, deletedConcept, Concepts.FINDING_SITE, Concepts.ROOT_CONCEPT, 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 outbound relationship").body("status", equalTo(Merge.Status.CONFLICTS.name()));
merge(branchPath, a, "Rebased concept deletion over new outbound relationship").body("status", equalTo(Merge.Status.COMPLETED.name()));
// relationships should be deleted along with the already deleted destination concept
getComponent(a, SnomedComponentType.RELATIONSHIP, newOutboundRelationshipFromDeletedConcept).statusCode(404);
}
use of com.b2international.snowowl.core.api.IBranchPath in project snow-owl by b2ihealthcare.
the class SnomedMergeApiTest method mergeNewConceptForward.
@Test
public void mergeNewConceptForward() {
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()));
getComponent(a, SnomedComponentType.CONCEPT, conceptId).statusCode(200);
getComponent(branchPath, SnomedComponentType.CONCEPT, conceptId).statusCode(200);
}
use of com.b2international.snowowl.core.api.IBranchPath in project snow-owl by b2ihealthcare.
the class SnomedMergeApiTest method rebaseOverReusedRelationshipId.
@Test
public void rebaseOverReusedRelationshipId() {
final String relationshipId = createNewRelationship(branchPath);
final IBranchPath a = BranchPathUtils.createPath(branchPath, "a");
branching.createBranch(a).statusCode(201);
deleteComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId, false).statusCode(204);
final Map<?, ?> requestBody = ImmutableMap.builder().put("sourceId", Concepts.ROOT_CONCEPT).put("moduleId", Concepts.MODULE_SCT_CORE).put("typeId", Concepts.FINDING_SITE).put("destinationId", Concepts.ROOT_CONCEPT).put("id", relationshipId).put("commitComment", "Created new relationship on parent with same SCTID").build();
createComponent(branchPath, SnomedComponentType.RELATIONSHIP, requestBody).statusCode(201);
// Different relationships before rebase
getComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId).statusCode(200).body("typeId", equalTo(Concepts.FINDING_SITE));
getComponent(a, SnomedComponentType.RELATIONSHIP, relationshipId).statusCode(200).body("typeId", equalTo(Concepts.PART_OF));
merge(branchPath, a, "Rebase after new relationship creation on parent").body("status", equalTo(Merge.Status.COMPLETED.name()));
// Same relationships after rebase
getComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId).statusCode(200).body("typeId", equalTo(Concepts.FINDING_SITE));
getComponent(a, SnomedComponentType.RELATIONSHIP, relationshipId).statusCode(200).body("typeId", equalTo(Concepts.FINDING_SITE));
}
use of com.b2international.snowowl.core.api.IBranchPath in project snow-owl by b2ihealthcare.
the class SnomedMergeApiTest method rebaseTextDefinitions.
@Test
public void rebaseTextDefinitions() throws Exception {
final IBranchPath a = BranchPathUtils.createPath(branchPath, "a");
branching.createBranch(a).statusCode(201);
// Create two new text definitions with "cross-shaped" acceptability on child
final String textDefinition1Id = createNewTextDefinition(a, ImmutableMap.of(Concepts.REFSET_LANGUAGE_TYPE_UK, Acceptability.PREFERRED, Concepts.REFSET_LANGUAGE_TYPE_US, Acceptability.ACCEPTABLE));
final String textDefinition2Id = createNewTextDefinition(a, ImmutableMap.of(Concepts.REFSET_LANGUAGE_TYPE_UK, Acceptability.ACCEPTABLE, Concepts.REFSET_LANGUAGE_TYPE_US, Acceptability.PREFERRED));
// Create change on parent
final String relationshipId = createNewRelationship(branchPath);
merge(branchPath, a, "Rebased new text definitions over new relationship").body("status", equalTo(Merge.Status.COMPLETED.name()));
// Relationship should be visible on both branches
getComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId).statusCode(200);
getComponent(a, SnomedComponentType.RELATIONSHIP, relationshipId).statusCode(200);
// Text definitions are only on the child, however
getComponent(branchPath, SnomedComponentType.DESCRIPTION, textDefinition1Id).statusCode(404);
getComponent(a, SnomedComponentType.DESCRIPTION, textDefinition1Id).statusCode(200);
getComponent(branchPath, SnomedComponentType.DESCRIPTION, textDefinition2Id).statusCode(404);
getComponent(a, SnomedComponentType.DESCRIPTION, textDefinition2Id).statusCode(200);
}
Aggregations