use of com.b2international.commons.json.Json in project snow-owl by b2ihealthcare.
the class SnomedConcreteValueApiTest method changeConcreteValueCharacteristicType.
@Test
public void changeConcreteValueCharacteristicType() {
String relationshipId = createNewConcreteValue(branchPath);
Json requestBody = Json.object("characteristicTypeId", Concepts.ADDITIONAL_RELATIONSHIP, "commitComment", "Updated concrete value characteristic type");
updateComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId, requestBody).statusCode(204);
getComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId).statusCode(200).body("characteristicTypeId", equalTo(Concepts.ADDITIONAL_RELATIONSHIP));
}
use of com.b2international.commons.json.Json in project snow-owl by b2ihealthcare.
the class SnomedConcreteValueApiTest method changeConcreteValueModifier.
@Test
public void changeConcreteValueModifier() {
String relationshipId = createNewConcreteValue(branchPath);
Json requestBody = Json.object("modifierId", Concepts.UNIVERSAL_RESTRICTION_MODIFIER, "commitComment", "Updated concrete value modifier");
updateComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId, requestBody).statusCode(204);
getComponent(branchPath, SnomedComponentType.RELATIONSHIP, relationshipId).statusCode(200).body("modifierId", equalTo(Concepts.UNIVERSAL_RESTRICTION_MODIFIER));
}
use of com.b2international.commons.json.Json in project snow-owl by b2ihealthcare.
the class SnomedConcreteValueApiTest method updateReleasedConcreteValueTypeId.
@Test
public void updateReleasedConcreteValueTypeId() throws Exception {
String relationshipId = createNewConcreteValue(branchPath);
Json update = Json.object(// "part of" is the initial type ID
SnomedRf2Headers.FIELD_TYPE_ID, // "part of" is the initial type ID
Concepts.DEFINING_RELATIONSHIP, "commitComment", "Updated released concrete value typeId");
// release component first
createCodeSystemAndVersion(branchPath, "SNOMEDCT-CONCVAL-TYPEID", "v1", LocalDate.parse("2017-03-01"));
// then try to update - it should fail as typeId is immutable
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 SnomedConcreteValueApiTest method createConcreteValue.
@Test
public void createConcreteValue() {
Json requestBody = createConcreteValueRequestBody(Concepts.ROOT_CONCEPT, Concepts.PART_OF, new RelationshipValue("string value")).with("commitComment", "Created new concrete value");
createComponent(branchPath, SnomedComponentType.RELATIONSHIP, requestBody).statusCode(201);
}
use of com.b2international.commons.json.Json in project snow-owl by b2ihealthcare.
the class SnomedConcreteValueApiTest method createConcreteValueNonExistentBranch.
@Test
public void createConcreteValueNonExistentBranch() {
Json requestBody = createConcreteValueRequestBody(Concepts.ROOT_CONCEPT, Concepts.PART_OF, new RelationshipValue("Hello world!")).with("commitComment", "Created new concrete value on non-existent branch");
createComponent(BranchPathUtils.createPath("MAIN/x/y/z"), SnomedComponentType.RELATIONSHIP, requestBody).statusCode(404);
}
Aggregations