use of com.b2international.commons.json.Json in project snow-owl by b2ihealthcare.
the class SnomedRelationshipApiTest method changeRelationshipUnionGroup.
@Test
public void changeRelationshipUnionGroup() {
String relationshipId = createNewRelationship(branchPath);
Json requestBody = Json.object("unionGroup", 101, "commitComment", "Updated relationship union group");
updateComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId, requestBody).statusCode(204);
getComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId).statusCode(200).body("unionGroup", equalTo(101));
}
use of com.b2international.commons.json.Json in project snow-owl by b2ihealthcare.
the class SnomedRelationshipApiTest method updateReleasedRelationshipTypeId.
@Test
public void updateReleasedRelationshipTypeId() 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");
// release component
createCodeSystemAndVersion(branchPath, "SNOMEDCT-RELREL-TYPEID", "v1", LocalDate.parse("2017-03-01"));
updateComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId, update).statusCode(400);
getComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId).statusCode(200).body(SnomedRf2Headers.FIELD_TYPE_ID, equalTo(Concepts.PART_OF));
}
use of com.b2international.commons.json.Json in project snow-owl by b2ihealthcare.
the class SnomedRelationshipApiTest method updateGroup.
@Test
public void updateGroup() {
String relationshipId = createNewRelationship(branchPath);
Json requestBody = Json.object("relationshipGroup", 99, "commitComment", "Updated relationship group");
updateComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId, requestBody).statusCode(204);
getComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId).statusCode(200).body("relationshipGroup", equalTo(99));
}
use of com.b2international.commons.json.Json in project snow-owl by b2ihealthcare.
the class SnomedRelationshipApiTest method updateGroupToInvalidValue.
@Test
public void updateGroupToInvalidValue() {
String relationshipId = createNewRelationship(branchPath);
Json requestBody = Json.object("relationshipGroup", -5, "commitComment", "Updated relationship group to invalid value");
updateComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId, requestBody).statusCode(400);
getComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId).statusCode(200).body("relationshipGroup", equalTo(0));
}
use of com.b2international.commons.json.Json in project snow-owl by b2ihealthcare.
the class SnomedRelationshipApiTest method createRelationshipNonExistentBranch.
@Test
public void createRelationshipNonExistentBranch() {
Json requestBody = createRelationshipRequestBody(Concepts.ROOT_CONCEPT, Concepts.PART_OF, Concepts.NAMESPACE_ROOT).with("commitComment", "Created new relationship on non-existent branch");
createComponent(BranchPathUtils.createPath("MAIN/x/y/z"), SnomedComponentType.RELATIONSHIP, requestBody).statusCode(404);
}
Aggregations