use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class ExtensionTest method serialize.
@Test
public void serialize() throws Exception {
Extension<Integer> extension = IntegerExtension.builder().url("ID").value(1).build();
JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(extension));
assertThat(jsonPath.getString("url"), equalTo("ID"));
assertThat(jsonPath.getInt("valueInteger"), equalTo(1));
}
use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class CodeSystemTest method serializeMinimalCodeSystem.
@Test
public void serializeMinimalCodeSystem() throws Exception {
CodeSystem codeSystem = CodeSystem.builder().status(PublicationStatus.ACTIVE).content(CodeSystemContentMode.COMPLETE).build();
applyFilter(codeSystem);
JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(codeSystem));
assertThat(jsonPath.getString("resourceType"), equalTo("CodeSystem"));
assertThat(jsonPath.getString("status"), equalTo("active"));
assertThat(jsonPath.getString("content"), equalTo("complete"));
String expectedJson = "{\"resourceType\":\"CodeSystem\"," + "\"status\":\"active\"," + "\"content\":\"complete\"}";
assertEquals(expectedJson, objectMapper.writeValueAsString(codeSystem));
}
use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class ConceptTest method serialize.
@Test
public void serialize() throws Exception {
printPrettyJson(concept);
JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(concept));
assertThat(jsonPath.getString("code"), equalTo("conceptCode"));
assertThat(jsonPath.getString("display"), equalTo("Label"));
assertThat(jsonPath.getString("definition"), equalTo("Definition"));
assertThat(jsonPath.getString("designation[0].language"), equalTo("uk_en"));
assertThat(jsonPath.getString("designation[0].use.code"), equalTo("internal"));
assertThat(jsonPath.getString("property[0].code"), equalTo("childConcept"));
}
use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class IssueTest method serialize.
@Test
public void serialize() throws Exception {
Issue issue = Issue.builder().severity(IssueSeverity.ERROR).code(IssueType.REQUIRED).addExpression("Issue expression").addLocation("Issue location").details(CodeableConcept.builder().addCoding(Coding.builder().code("A").display("A display").build()).text("Text").build()).build();
JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(issue));
assertThat(jsonPath.getString("severity"), equalTo("error"));
assertThat(jsonPath.getString("code"), equalTo("required"));
assertThat(jsonPath.getList("expression"), equalTo(Lists.newArrayList("Issue expression")));
assertThat(jsonPath.getList("location"), equalTo(Lists.newArrayList("Issue location")));
jsonPath.setRoot("details");
assertThat(jsonPath.getString("text"), equalTo("Text"));
jsonPath.setRoot("details.coding[0]");
assertThat(jsonPath.getString("code"), equalTo("A"));
assertThat(jsonPath.getString("display"), equalTo("A display"));
}
use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class QuantityUsageContextTest 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("valueQuantity.value"), equalTo("1.0"));
assertThat(jsonPath.getString("valueQuantity.comparator"), equalTo(">"));
assertThat(jsonPath.getString("valueQuantity.unit"), equalTo("ms"));
assertThat(jsonPath.getString("valueQuantity.code"), equalTo("valueCode"));
}
Aggregations