use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class CodeableConceptUsageContextTest method serialize.
@Test
public void serialize() throws Exception {
printPrettyJson(usageContext);
JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(usageContext));
assertThat(jsonPath.getString("id"), equalTo("usageContextId"));
assertThat(jsonPath.getString("code.code"), equalTo("coding"));
assertThat(jsonPath.getString("code.display"), equalTo("codingDisplay"));
assertThat(jsonPath.getString("valueCodeableConcept.text"), equalTo("text"));
assertThat(jsonPath.getString("valueCodeableConcept.coding[0].code"), equalTo("1234"));
assertThat(jsonPath.getString("valueCodeableConcept.coding[0].system"), equalTo("http://www.whocc.no/atc"));
assertThat(jsonPath.getString("valueCodeableConcept.coding[0].version"), equalTo("20180131"));
}
use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class DocumentTest method serialize.
@Test
public void serialize() throws Exception {
JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(document));
assertThat(jsonPath.getString("documentation"), equalTo("documentation"));
assertThat(jsonPath.getString("mode"), equalTo("consumer"));
assertThat(jsonPath.getString("profile"), equalTo("profile"));
}
use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class SearchParamTest method serialize.
@Test
public void serialize() throws Exception {
printPrettyJson(searchParam);
JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(searchParam));
assertThat(jsonPath.getString("definition"), equalTo("definition"));
assertThat(jsonPath.getString("documentation"), equalTo("documentation"));
assertThat(jsonPath.getString("name"), equalTo("name"));
assertThat(jsonPath.getString("type"), equalTo("string"));
}
use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class PropertySerializationTest method basicPropertyTest.
@Test
public void basicPropertyTest() throws Exception {
Property property = Property.builder().code("123").valueInteger(2).description("propertyDescription").build();
Fhir fhirParameters = new Parameters.Fhir(property);
JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(fhirParameters));
assertThat(jsonPath.getString("resourceType"), equalTo("Parameters"));
assertThat(jsonPath.getList("parameter").size(), is(3));
assertThat(jsonPath, FhirParameterMatcher.hasParameter("code", FhirDataType.CODE, "123"));
assertThat(jsonPath, FhirParameterMatcher.hasParameter("value", FhirDataType.INTEGER, 2));
assertThat(jsonPath, FhirParameterMatcher.hasParameter("description", FhirDataType.STRING, "propertyDescription"));
}
use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class PropertySerializationTest method minimalPropertyTest.
@Test
public void minimalPropertyTest() throws Exception {
Property property = Property.builder().code("123").build();
Fhir fhirParameters = new Parameters.Fhir(property);
JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(fhirParameters));
assertThat(jsonPath.getString("resourceType"), equalTo("Parameters"));
assertThat(jsonPath.getList("parameter").size(), is(1));
assertThat(jsonPath, FhirParameterMatcher.hasParameter("code", FhirDataType.CODE, "123"));
}
Aggregations