use of com.b2international.snowowl.fhir.core.model.dt.CodeableConcept in project snow-owl by b2ihealthcare.
the class CodeableConcepTest method serialize.
@Test
public void serialize() throws Exception {
Coding coding = Coding.builder().code("1234").system("http://www.whocc.no/atc").version("20180131").build();
CodeableConcept cc = CodeableConcept.builder().addCoding(coding).text("text").build();
JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(cc));
assertThat(jsonPath.getString("text"), equalTo("text"));
assertThat(jsonPath.getString("coding[0].code"), equalTo("1234"));
assertThat(jsonPath.getString("coding[0].system"), equalTo("http://www.whocc.no/atc"));
assertThat(jsonPath.getString("coding[0].version"), equalTo("20180131"));
}
Aggregations