use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class MetaTest method serialize.
@Test
public void serialize() throws Exception {
JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(meta));
assertThat(jsonPath.getString("versionId"), equalTo("VersionID"));
assertThat(jsonPath.getString("lastUpdated"), equalTo("2018-03-23T07:49:40Z"));
assertThat(jsonPath.getString("security[0].code"), equalTo("A"));
assertThat(jsonPath.getString("tag[0].code"), equalTo("TagA"));
assertThat(jsonPath.getString("profile[0]"), equalTo("profile"));
}
use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class ReferenceTest method serialize.
@Test
public void serialize() throws Exception {
String expected = "{\"reference\":\"reference url\"," + "\"identifier\":{\"system\":\"system\"}," + "\"display\":\"displayString\"}";
JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(reference));
assertThat(jsonPath.getString("reference"), equalTo("reference url"));
assertThat(jsonPath.getString("identifier.system"), equalTo("system"));
assertThat(jsonPath.getString("display"), equalTo("displayString"));
assertEquals(expected, objectMapper.writeValueAsString(reference));
}
use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class SimpleQuantityTest method serialize.
@Test
public void serialize() throws Exception {
JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(quantity));
assertThat(jsonPath.getDouble("value"), equalTo(12.3));
assertThat(jsonPath.getString("unit"), equalTo("mg"));
assertThat(jsonPath.getString("system"), equalTo("uri:LOINC"));
assertThat(jsonPath.getString("code"), equalTo("code"));
}
use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class ContactPointTest method serialize.
@Test
public void serialize() throws Exception {
JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(contactPoint));
assertThat(jsonPath.getString("id"), equalTo("element_id"));
assertThat(jsonPath.getString("system"), equalTo("system"));
assertThat(jsonPath.getString("value"), equalTo("value"));
assertThat(jsonPath.getInt("rank"), equalTo(1));
assertThat(jsonPath.get("period.start"), equalTo(null));
assertThat(jsonPath.get("period.end"), equalTo(null));
assertThat(jsonPath.getString("extension[0].url"), equalTo("url"));
assertThat(jsonPath.getInt("extension[0].valueInteger"), equalTo(1));
assertThat(jsonPath.getString("extension[1].url"), equalTo("url2"));
assertThat(jsonPath.getInt("extension[1].valueInteger"), equalTo(2));
}
use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class RangeTest method serialize.
@Test
public void serialize() throws Exception {
JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(range));
assertThat(jsonPath.getDouble("low.value"), equalTo(12.3));
assertThat(jsonPath.getString("low.unit"), equalTo("mg"));
assertThat(jsonPath.getString("low.system"), equalTo("uri:LOINC"));
assertThat(jsonPath.getString("low.code"), equalTo("code1"));
assertThat(jsonPath.getDouble("high.value"), equalTo(120.3));
assertThat(jsonPath.getString("high.unit"), equalTo("mg"));
assertThat(jsonPath.getString("high.system"), equalTo("uri:LOINC"));
assertThat(jsonPath.getString("high.code"), equalTo("code2"));
}
Aggregations