use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class ConceptMapElementTest method serialize.
@Test
public void serialize() throws Exception {
printPrettyJson(element);
JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(element));
assertThat(jsonPath.getString("code"), equalTo("Code"));
assertThat(jsonPath.getString("display"), equalTo("Display"));
assertThat(jsonPath.get("target.equivalence"), hasItem("Equivalence"));
}
use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class ConceptMapElementTest method serializeWithMissingOptionalFields.
@Test
public void serializeWithMissingOptionalFields() throws Exception {
ConceptMapElement element = ConceptMapElement.builder().build();
JsonPath jsonPath = getJsonPath(element);
assertNull(jsonPath.get("code"));
assertNull(jsonPath.get("display"));
assertNull(jsonPath.get("target"));
assertNull(jsonPath.get("target"));
}
use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class CapabilityStatementTest method serialize.
@Test
public void serialize() throws Exception {
printPrettyJson(capabilityStatement);
JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(capabilityStatement));
assertThat(jsonPath.getString("id"), equalTo("id"));
}
use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class OperationOutcomeTest method serialize.
@Test
public void serialize() throws JsonProcessingException {
OperationOutcome operationOutcome = OperationOutcome.builder().addIssue(Issue.builder().severity(IssueSeverity.ERROR).code(IssueType.REQUIRED).addLocation("location").build()).build();
JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(operationOutcome));
assertThat(jsonPath.getString("resourceType"), equalTo("OperationOutcome"));
jsonPath.setRoot("issue[0]");
assertThat(jsonPath.getString("severity"), equalTo("error"));
assertThat(jsonPath.getString("code"), equalTo("required"));
assertThat(jsonPath.getList("location"), equalTo(Lists.newArrayList("location")));
}
use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.
the class RangeUsageContextTest 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("valueRange.low.id"), equalTo("id"));
assertThat(jsonPath.getDouble("valueRange.low.value"), equalTo(1.0));
assertThat(jsonPath.getString("valueRange.low.unit"), equalTo("ms"));
assertThat(jsonPath.getString("valueRange.low.code"), equalTo("1"));
assertThat(jsonPath.getString("valueRange.high.id"), equalTo("id2"));
assertThat(jsonPath.getDouble("valueRange.high.value"), equalTo(10.0));
assertThat(jsonPath.getString("valueRange.high.unit"), equalTo("ms"));
assertThat(jsonPath.getString("valueRange.high.code"), equalTo("10"));
}
Aggregations