Search in sources :

Example 1 with Target

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

the class TargetTest method deserialize.

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

Example 2 with Target

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

the class TargetTest method serializeWithMissingOptionalFields.

@Test
public void serializeWithMissingOptionalFields() throws Exception {
    Target target = Target.builder().build();
    JsonPath jsonPath = getJsonPath(target);
    assertNull(jsonPath.get("code"));
    assertNull(jsonPath.get("display"));
    assertNull(jsonPath.get("equivalence"));
    assertNull(jsonPath.get("comment"));
    assertNull(jsonPath.get("dependsOn"));
    assertNull(jsonPath.get("product"));
}
Also used : Target(com.b2international.snowowl.fhir.core.model.conceptmap.Target) JsonPath(io.restassured.path.json.JsonPath) FhirTest(com.b2international.snowowl.fhir.tests.FhirTest) Test(org.junit.Test)

Example 3 with Target

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

the class ConceptMapElementTest method validate.

private void validate(ConceptMapElement element) {
    assertEquals("Code", element.getCode().getCodeValue());
    assertEquals("Display", element.getDisplay());
    Target target = element.getTargets().iterator().next();
    assertEquals("TargetDisplay", target.getDisplay());
    assertEquals("TargetCode", target.getCode().getCodeValue());
}
Also used : Target(com.b2international.snowowl.fhir.core.model.conceptmap.Target)

Aggregations

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