use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class QuantityTest 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("comparator"), equalTo(">="));
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 EndpointTest method serialize.
@Test
public void serialize() throws Exception {
printPrettyJson(endpoint);
JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(endpoint));
assertThat(jsonPath.getString("address"), equalTo("address"));
assertThat(jsonPath.getString("protocol.code"), equalTo("code"));
}
use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class OperationTest method serialize.
@Test
public void serialize() throws Exception {
printPrettyJson(operation);
JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(operation));
assertThat(jsonPath.getString("name"), equalTo("name"));
assertThat(jsonPath.getString("definition"), equalTo("definition"));
assertThat(jsonPath.getString("documentation"), equalTo("documentation"));
}
use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class LookupResultSerializationTest method lookupResultTest.
@Test
public void lookupResultTest() throws Exception {
LookupResult lookupResult = LookupResult.builder().name("test").display("display").designation(List.of(Designation.builder().value("dValue").languageCode("uk").build())).property(List.of(Property.builder().code("1234").description("propDescription").valueString("sds").addSubProperty(SubProperty.builder().code("subCode").description("subDescription").valueInteger(1).build()).build())).build();
Fhir fhirParameters = new Parameters.Fhir(lookupResult);
JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(fhirParameters));
assertThat(jsonPath.getString("resourceType"), equalTo("Parameters"));
assertThat(jsonPath.getList("parameter.name"), hasItems("name", "display", "designation", "property"));
assertThat(jsonPath, FhirParameterMatcher.hasParameter("name", FhirDataType.STRING, "test"));
assertThat(jsonPath, FhirParameterMatcher.hasParameter("display", FhirDataType.STRING, "display"));
assertThat(jsonPath.getString("parameter[2].name"), equalTo("designation"));
assertThat(jsonPath.getString("parameter[2].part[0].name"), equalTo("language"));
assertThat(jsonPath.getString("parameter[2].part[0].valueCode"), equalTo("uk"));
assertThat(jsonPath.getString("parameter[2].part[1].name"), equalTo("value"));
assertThat(jsonPath.getString("parameter[2].part[1].valueString"), equalTo("dValue"));
assertThat(jsonPath.getString("parameter[3].name"), equalTo("property"));
assertThat(jsonPath.getString("parameter[3].part[0].name"), equalTo("code"));
assertThat(jsonPath.getString("parameter[3].part[0].valueCode"), equalTo("1234"));
assertThat(jsonPath.getString("parameter[3].part[1].name"), equalTo("value"));
assertThat(jsonPath.getString("parameter[3].part[1].valueString"), equalTo("sds"));
assertThat(jsonPath.getString("parameter[3].part[2].name"), equalTo("description"));
assertThat(jsonPath.getString("parameter[3].part[2].valueString"), equalTo("propDescription"));
assertThat(jsonPath.getString("parameter[3].part[3].name"), equalTo("subproperty"));
assertThat(jsonPath.getString("parameter[3].part[3].part[0].name"), equalTo("code"));
assertThat(jsonPath.getString("parameter[3].part[3].part[0].valueCode"), equalTo("subCode"));
assertThat(jsonPath.getString("parameter[3].part[3].part[1].name"), equalTo("value"));
assertThat(jsonPath.getInt("parameter[3].part[3].part[1].valueInteger"), equalTo(1));
assertThat(jsonPath.getString("parameter[3].part[3].part[2].name"), equalTo("description"));
assertThat(jsonPath.getString("parameter[3].part[3].part[2].valueString"), equalTo("subDescription"));
}
use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class ValueSetConceptTest method serialize.
@Test
public void serialize() throws Exception {
JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(concept));
assertThat(jsonPath.getString("code"), equalTo("code"));
assertThat(jsonPath.getString("display"), equalTo("display"));
assertThat(jsonPath.getString("designation[0].language"), equalTo("gb_en"));
assertThat(jsonPath.getString("designation[0].use.code"), equalTo("internal"));
assertThat(jsonPath.getString("designation[0].use.system"), equalTo("http://b2i.sg/test"));
assertThat(jsonPath.getString("designation[0].value"), equalTo("designationValue"));
assertThat(jsonPath.getString("designation[0].languageCode"), equalTo("gb_en"));
}
Aggregations