use of com.b2international.commons.json.Json in project snow-owl by b2ihealthcare.
the class SnomedDescriptionApiTest method updateReleasedDescriptionLanguageCode.
@Test
public void updateReleasedDescriptionLanguageCode() throws Exception {
String descriptionId = createNewDescription(branchPath);
Json update = Json.object(SnomedRf2Headers.FIELD_LANGUAGE_CODE, "hu", "commitComment", "Update unreleased description languageCode");
// release component
createCodeSystemAndVersion(branchPath, "SNOMEDCT-RELDESC-LANGCODE", "v1", LocalDate.parse("2017-03-01"));
updateComponent(branchPath, SnomedComponentType.DESCRIPTION, descriptionId, update).statusCode(400);
getComponent(branchPath, SnomedComponentType.DESCRIPTION, descriptionId).statusCode(200).body(SnomedRf2Headers.FIELD_LANGUAGE_CODE, equalTo(SnomedRestFixtures.DEFAULT_LANGUAGE_CODE));
}
use of com.b2international.commons.json.Json in project snow-owl by b2ihealthcare.
the class SnomedDescriptionApiTest method updateAcceptabilityWithMemberReactivation.
@Test
public void updateAcceptabilityWithMemberReactivation() throws Exception {
changeToAcceptable(branchPath, Concepts.ROOT_CONCEPT, Concepts.REFSET_LANGUAGE_TYPE_UK);
String descriptionId = createNewDescription(branchPath, Concepts.ROOT_CONCEPT, Concepts.SYNONYM, SnomedApiTestConstants.UK_PREFERRED_MAP);
SnomedReferenceSetMembers members = getComponent(branchPath, SnomedComponentType.DESCRIPTION, descriptionId, "members()").statusCode(200).extract().as(SnomedDescription.class).getMembers();
// Inactivate the reference set member
members.forEach(m -> {
Json requestBody = Json.object("active", false, "commitComment", "Inactivate language reference set member");
updateRefSetComponent(branchPath, SnomedComponentType.MEMBER, m.getId(), requestBody, false).statusCode(204);
});
Json requestBody = Json.object("acceptability", Json.object(Concepts.REFSET_LANGUAGE_TYPE_UK, Acceptability.PREFERRED, Concepts.REFSET_LANGUAGE_TYPE_US, Acceptability.PREFERRED), "commitComment", "Reactivated UK, added US acceptability to description");
updateComponent(branchPath, SnomedComponentType.DESCRIPTION, descriptionId, requestBody).statusCode(204);
members = getComponent(branchPath, SnomedComponentType.DESCRIPTION, descriptionId, "members()").statusCode(200).body("members.items.refsetId", hasItems(Concepts.REFSET_LANGUAGE_TYPE_UK, Concepts.REFSET_LANGUAGE_TYPE_US)).extract().as(SnomedDescription.class).getMembers();
assertEquals(2, members.getTotal());
members.forEach(m -> assertEquals("Reference set member should be active", Boolean.TRUE, m.isActive()));
}
use of com.b2international.commons.json.Json in project snow-owl by b2ihealthcare.
the class SnomedDescriptionApiTest method createDescriptionInvalidConcept.
@Test
public void createDescriptionInvalidConcept() {
Json requestBody = createDescriptionRequestBody("11110000").with("commitComment", "Created new description with invalid conceptId");
createComponent(branchPath, SnomedComponentType.DESCRIPTION, requestBody).statusCode(400);
}
use of com.b2international.commons.json.Json in project snow-owl by b2ihealthcare.
the class SnomedRefSetMemberApiTest method deleteReferringMRCMDomainRefsetMember.
@Test
public void deleteReferringMRCMDomainRefsetMember() {
String newIdentifierConceptId = createNewConcept(branchPath, SnomedRefSetUtil.getParentConceptId(SnomedRefSetType.MRCM_DOMAIN));
createNewRefSet(branchPath, SnomedRefSetType.MRCM_DOMAIN, newIdentifierConceptId);
String conceptId = createNewConcept(branchPath);
Json requestBody = createRefSetMemberRequestBody(newIdentifierConceptId, conceptId).with(Json.object(SnomedRf2Headers.FIELD_MRCM_DOMAIN_CONSTRAINT, "domainConstraint", SnomedRf2Headers.FIELD_MRCM_PROXIMAL_PRIMITIVE_CONSTRAINT, "proximalPrimitiveConstraint", SnomedRf2Headers.FIELD_MRCM_DOMAIN_TEMPLATE_FOR_PRECOORDINATION, "domainTemplateForPrecoordination", SnomedRf2Headers.FIELD_MRCM_DOMAIN_TEMPLATE_FOR_POSTCOORDINATION, "domainTemplateForPostcoordination", "commitComment", "Created new MRCM domain reference set member"));
String memberId = assertCreated(createComponent(branchPath, SnomedComponentType.MEMBER, requestBody));
getComponent(branchPath, SnomedComponentType.MEMBER, memberId).statusCode(200);
deleteComponent(branchPath, SnomedComponentType.CONCEPT, conceptId, false).statusCode(204);
getComponent(branchPath, SnomedComponentType.CONCEPT, conceptId).statusCode(404);
getComponent(branchPath, SnomedComponentType.MEMBER, memberId).statusCode(404);
}
use of com.b2international.commons.json.Json in project snow-owl by b2ihealthcare.
the class SnomedRefSetMemberApiTest method createConcreteDomainMemberInvalidValue.
@Test
public void createConcreteDomainMemberInvalidValue() {
createConcreteDomainParentConcept(branchPath);
String refSetId = createConcreteDomainRefSet(branchPath, DataType.INTEGER);
Json requestBody = createRefSetMemberRequestBody(refSetId, Concepts.ROOT_CONCEPT).with(Json.object(SnomedRf2Headers.FIELD_TYPE_ID, Concepts.REFSET_ATTRIBUTE, SnomedRf2Headers.FIELD_RELATIONSHIP_GROUP, 0, SnomedRf2Headers.FIELD_CHARACTERISTIC_TYPE_ID, Concepts.STATED_RELATIONSHIP, // bad
SnomedRf2Headers.FIELD_VALUE, // bad
"five", "commitComment", "Created new reference set member"));
createComponent(branchPath, SnomedComponentType.MEMBER, requestBody).statusCode(400);
}
Aggregations