use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class ExpansionParameterTest method serializeDateTimeParameter.
@Test
public void serializeDateTimeParameter() throws Exception {
Date date = new SimpleDateFormat(FhirDates.DATE_TIME_FORMAT).parse(TEST_DATE_STRING);
DateTimeParameter parameter = DateTimeParameter.builder().name("paramName").value(date).build();
JsonPath jsonPath = getJsonPath(parameter);
assertThat(jsonPath.getString("name"), equalTo("paramName"));
assertThat(jsonPath.get("valueDateTime"), equalTo(TEST_DATE_STRING));
}
use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class IncludeTest method serialize.
@Test
public void serialize() throws Exception {
JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(include));
assertThat(jsonPath.getString("system"), equalTo("system"));
assertThat(jsonPath.getString("version"), equalTo("version"));
assertThat(jsonPath.getString("valueSet[0]"), equalTo("valueSetUri"));
assertThat(jsonPath.getString("concept[0].code"), equalTo("code"));
assertThat(jsonPath.getString("concept[0].display"), equalTo("display"));
assertThat(jsonPath.getString("concept[0].designation[0].language"), equalTo("gb_en"));
assertThat(jsonPath.getString("concept[0].designation[0].use.code"), equalTo("internal"));
assertThat(jsonPath.getString("concept[0].designation[0].use.system"), equalTo("http://b2i.sg/test"));
assertThat(jsonPath.getString("concept[0].designation[0].value"), equalTo("designationValue"));
assertThat(jsonPath.getString("concept[0].designation[0].languageCode"), equalTo("gb_en"));
assertThat(jsonPath.getString("filter[0].property"), equalTo("filterProperty"));
assertThat(jsonPath.getString("filter[0].value"), equalTo("1234567"));
assertThat(jsonPath.getString("filter[0].op"), equalTo("="));
}
use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class ValueSetFilterTest method serialize.
@Test
public void serialize() throws Exception {
JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(filter));
assertThat(jsonPath.getString("op"), equalTo("="));
assertThat(jsonPath.getString("value"), equalTo("1234567"));
assertThat(jsonPath.getString("property"), equalTo("filterProperty"));
}
use of io.restassured.path.json.JsonPath 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"));
}
use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class ContactDetailTest method serialize.
@Test
public void serialize() throws Exception {
JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(contactDetail));
assertThat(jsonPath.getString("name"), equalTo("name"));
jsonPath.setRoot("telecom[0]");
assertThat(jsonPath.getString("system"), equalTo("system"));
assertThat(jsonPath.getString("period.start"), equalTo(null));
assertThat(jsonPath.getString("value"), equalTo("value"));
assertThat(jsonPath.getInt("rank"), equalTo(1));
}
Aggregations