use of com.b2international.commons.json.Json in project snow-owl by b2ihealthcare.
the class SnomedRelationshipApiTest method createDuplicateRelationship.
@Test
public void createDuplicateRelationship() {
String relationshipId = createNewRelationship(branchPath);
Json requestBody = createRelationshipRequestBody(Concepts.ROOT_CONCEPT, Concepts.PART_OF, Concepts.NAMESPACE_ROOT).with("id", relationshipId).with("commitComment", "Created new relationship with duplicate identifier");
createComponent(branchPath, SnomedComponentType.RELATIONSHIP, requestBody).statusCode(409);
}
use of com.b2international.commons.json.Json in project snow-owl by b2ihealthcare.
the class SnomedRelationshipApiTest method updateReleasedRelationshipDestinationId.
@Test
public void updateReleasedRelationshipDestinationId() throws Exception {
String relationshipId = createNewRelationship(branchPath);
Json update = Json.object(SnomedRf2Headers.FIELD_DESTINATION_ID, Concepts.MODULE_ROOT, "commitComment", "Updated unreleased relationship destinationId");
// release component
createCodeSystemAndVersion(branchPath, "SNOMEDCT-RELREL-DESTID", "v1", LocalDate.parse("2017-03-01"));
updateComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId, update).statusCode(400);
getComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId).statusCode(200).body(SnomedRf2Headers.FIELD_DESTINATION_ID, equalTo(Concepts.NAMESPACE_ROOT));
}
use of com.b2international.commons.json.Json in project snow-owl by b2ihealthcare.
the class SnomedRelationshipApiTest method updateUnreleasedRelationshipDestinationId.
@Test
public void updateUnreleasedRelationshipDestinationId() throws Exception {
String relationshipId = createNewRelationship(branchPath);
Json update = Json.object(SnomedRf2Headers.FIELD_DESTINATION_ID, Concepts.MODULE_ROOT, "commitComment", "Updated unreleased relationship destinationId");
updateComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId, update).statusCode(204);
getComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId).statusCode(200).body(SnomedRf2Headers.FIELD_DESTINATION_ID, equalTo(Concepts.MODULE_ROOT));
}
use of com.b2international.commons.json.Json in project snow-owl by b2ihealthcare.
the class SnomedRelationshipApiTest method inactivateRelationship.
@Test
public void inactivateRelationship() {
String relationshipId = createNewRelationship(branchPath);
Json requestBody = Json.object("active", false, "commitComment", "Inactivated relationship");
updateComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId, requestBody).statusCode(204);
getComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId).statusCode(200).body("active", equalTo(false));
}
use of com.b2international.commons.json.Json in project snow-owl by b2ihealthcare.
the class SnomedRelationshipApiTest method updateUnreleasedRelationshipTypeId.
@Test
public void updateUnreleasedRelationshipTypeId() throws Exception {
String relationshipId = createNewRelationship(branchPath);
Json update = Json.object(// part of is the initial type
SnomedRf2Headers.FIELD_TYPE_ID, // part of is the initial type
Concepts.DEFINING_RELATIONSHIP, "commitComment", "Updated unreleased relationship typeId");
updateComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId, update).statusCode(204);
getComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId).statusCode(200).body(SnomedRf2Headers.FIELD_TYPE_ID, equalTo(Concepts.DEFINING_RELATIONSHIP));
}
Aggregations