Search in sources :

Example 36 with JsonPath

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

the class ExampleTest method serialize.

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

Example 37 with JsonPath

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

the class TypeTest method serialize.

@Test
public void serialize() throws Exception {
    printPrettyJson(type);
    JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(type));
    assertThat(jsonPath.getString("id"), equalTo("id"));
    assertThat(jsonPath.getString("code"), equalTo("code"));
    assertThat(jsonPath.getString("profile"), equalTo("profile"));
    assertThat(jsonPath.getString("targetProfile"), equalTo("targetProfile"));
    assertThat(jsonPath.getString("aggregation[0]"), equalTo("bundled"));
    assertThat(jsonPath.getString("versioning"), equalTo("either"));
}
Also used : JsonPath(io.restassured.path.json.JsonPath) FhirTest(com.b2international.snowowl.fhir.tests.FhirTest) Test(org.junit.Test)

Example 38 with JsonPath

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

the class ContainsTest method serialize.

@Test
public void serialize() throws Exception {
    printPrettyJson(contains);
    JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(contains));
    assertThat(jsonPath.getString("system"), equalTo("systemUri"));
    assertThat(jsonPath.getString("inactive"), equalTo("false"));
    assertThat(jsonPath.getString("abstract"), equalTo("true"));
    assertThat(jsonPath.getString("version"), equalTo("20140131"));
    assertThat(jsonPath.getString("code"), equalTo("Code"));
    assertThat(jsonPath.getString("display"), equalTo("displayValue"));
    assertThat(jsonPath.getString("contains[0].code"), equalTo("nestedContains"));
    assertThat(jsonPath.getString("designation[0].language"), equalTo("en-us"));
    assertThat(jsonPath.getString("designation[0].value"), equalTo("pt"));
    assertThat(jsonPath.getString("designation[0].languageCode"), equalTo("en-us"));
}
Also used : JsonPath(io.restassured.path.json.JsonPath) FhirTest(com.b2international.snowowl.fhir.tests.FhirTest) Test(org.junit.Test)

Example 39 with JsonPath

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

the class MappingElementTest method serialize.

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

Example 40 with JsonPath

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

the class SlicingTest method serialize.

@Test
public void serialize() throws Exception {
    printPrettyJson(slicing);
    JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(slicing));
    assertThat(jsonPath.getBoolean("ordered"), equalTo(true));
    assertThat(jsonPath.getString("rules"), equalTo("open"));
    assertThat(jsonPath.getString("discriminator[0].id"), equalTo("id"));
    assertThat(jsonPath.getString("discriminator[0].type"), equalTo("value"));
    assertThat(jsonPath.getString("discriminator[0].path"), equalTo("path"));
}
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