Search in sources :

Example 46 with JsonPath

use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.

the class SecurityTest method serialize.

@Test
public void serialize() throws Exception {
    printPrettyJson(security);
    JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(security));
    assertThat(jsonPath.getString("description"), equalTo("description"));
    assertThat(jsonPath.getBoolean("cors"), equalTo(true));
    assertThat(jsonPath.getString("service[0].text"), equalTo("codingText"));
}
Also used : JsonPath(io.restassured.path.json.JsonPath) FhirTest(com.b2international.snowowl.fhir.tests.FhirTest) Test(org.junit.Test)

Example 47 with JsonPath

use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.

the class SupportedMessageTest method serialize.

@Test
public void serialize() throws Exception {
    printPrettyJson(supportedMessage);
    JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(supportedMessage));
    assertThat(jsonPath.getString("mode"), equalTo("receiver"));
    assertThat(jsonPath.getString("definition"), equalTo("definition"));
}
Also used : JsonPath(io.restassured.path.json.JsonPath) FhirTest(com.b2international.snowowl.fhir.tests.FhirTest) Test(org.junit.Test)

Example 48 with JsonPath

use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.

the class ConceptPropertyTest method serializeCodingConceptProperty.

@Test
public void serializeCodingConceptProperty() throws Exception {
    CodingConceptProperty conceptProperty = CodingConceptProperty.builder().code(CommonConceptProperties.CHILD.getCode()).value(new Coding.Builder().code("codingCode").system("uri").build()).build();
    JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(conceptProperty));
    assertThat(jsonPath.getString("code"), equalTo("child"));
    jsonPath.setRoot("valueCoding");
    assertThat(jsonPath.getString("code"), equalTo("codingCode"));
    assertThat(jsonPath.getString("system"), equalTo("uri"));
}
Also used : Coding(com.b2international.snowowl.fhir.core.model.dt.Coding) JsonPath(io.restassured.path.json.JsonPath) FhirTest(com.b2international.snowowl.fhir.tests.FhirTest) Test(org.junit.Test)

Example 49 with JsonPath

use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.

the class ConceptMapTest method serialize.

@Test
public void serialize() throws Exception {
    printPrettyJson(conceptMap);
    JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(conceptMap));
    assertThat(jsonPath.getString("id"), equalTo("-1"));
}
Also used : JsonPath(io.restassured.path.json.JsonPath) FhirTest(com.b2international.snowowl.fhir.tests.FhirTest) Test(org.junit.Test)

Example 50 with JsonPath

use of io.restassured.path.json.JsonPath in project snow-owl by b2ihealthcare.

the class TargetTest method serialize.

@Test
public void serialize() throws Exception {
    printPrettyJson(target);
    JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(target));
    assertThat(jsonPath.getString("code"), equalTo("code"));
    assertThat(jsonPath.getString("display"), equalTo("Display"));
    assertThat(jsonPath.getString("equivalence"), equalTo("Equivalence"));
}
Also used : JsonPath(io.restassured.path.json.JsonPath) FhirTest(com.b2international.snowowl.fhir.tests.FhirTest) Test(org.junit.Test)

Aggregations

JsonPath (io.restassured.path.json.JsonPath)117 Test (org.junit.Test)101 FhirTest (com.b2international.snowowl.fhir.tests.FhirTest)82 Response (io.restassured.response.Response)9 Fhir (com.b2international.snowowl.fhir.core.model.dt.Parameters.Fhir)8 Date (java.util.Date)6 Property (com.b2international.snowowl.fhir.core.model.codesystem.Property)4 Coding (com.b2international.snowowl.fhir.core.model.dt.Coding)4 SubProperty (com.b2international.snowowl.fhir.core.model.dt.SubProperty)4 CodeSystem (com.b2international.snowowl.fhir.core.model.codesystem.CodeSystem)3 Uri (com.b2international.snowowl.fhir.core.model.dt.Uri)3 HashMap (java.util.HashMap)3 TranslateResult (com.b2international.snowowl.fhir.core.model.conceptmap.TranslateResult)2 BigDecimal (java.math.BigDecimal)2 SimpleDateFormat (java.text.SimpleDateFormat)2 ArrayList (java.util.ArrayList)2 AbstractIntegrationTest (org.codice.ddf.itests.common.AbstractIntegrationTest)2 MappingJackson2HttpMessageConverter (org.springframework.http.converter.json.MappingJackson2HttpMessageConverter)2 MockMvc (org.springframework.test.web.servlet.MockMvc)2 OperationOutcomeCode (com.b2international.snowowl.fhir.core.codesystems.OperationOutcomeCode)1