Search in sources :

Example 1 with Group

use of com.b2international.snowowl.fhir.core.model.conceptmap.Group in project snow-owl by b2ihealthcare.

the class GroupTest method deserialize.

@Test
public void deserialize() throws Exception {
    Group readGroup = objectMapper.readValue(objectMapper.writeValueAsString(group), Group.class);
    validate(readGroup);
}
Also used : Group(com.b2international.snowowl.fhir.core.model.conceptmap.Group) FhirTest(com.b2international.snowowl.fhir.tests.FhirTest) Test(org.junit.Test)

Example 2 with Group

use of com.b2international.snowowl.fhir.core.model.conceptmap.Group in project snow-owl by b2ihealthcare.

the class GroupTest method serializeWithMissingOptionalFields.

@Test
public void serializeWithMissingOptionalFields() throws Exception {
    Group group = Group.builder().addElement(ConceptMapElement.builder().code("ElementCode").display("ElementDisplay").build()).build();
    JsonPath jsonPath = getJsonPath(group);
    assertNull(jsonPath.get("source"));
    assertNull(jsonPath.get("sourceVersion"));
    assertNull(jsonPath.get("target"));
    assertNull(jsonPath.get("targetVersion"));
    assertThat(jsonPath.get("element.code"), hasItem("ElementCode"));
    assertThat(jsonPath.get("element.display"), hasItem("ElementDisplay"));
    assertNull(jsonPath.get("unmapped"));
}
Also used : Group(com.b2international.snowowl.fhir.core.model.conceptmap.Group) JsonPath(io.restassured.path.json.JsonPath) FhirTest(com.b2international.snowowl.fhir.tests.FhirTest) Test(org.junit.Test)

Aggregations

Group (com.b2international.snowowl.fhir.core.model.conceptmap.Group)2 FhirTest (com.b2international.snowowl.fhir.tests.FhirTest)2 Test (org.junit.Test)2 JsonPath (io.restassured.path.json.JsonPath)1