Search in sources :

Example 86 with JsonPath

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

the class ValueSetTest method serialize.

@Test
public void serialize() throws Exception {
    JsonPath jsonPath = getJsonPath(valueSet);
    assertThat(jsonPath.getString("url"), equalTo("http://who.org"));
    assertThat(jsonPath.getString("version"), equalTo("20130131"));
    assertThat(jsonPath.getString("name"), equalTo("refsetName"));
    assertThat(jsonPath.getString("description"), equalTo("descriptionString"));
    assertThat(jsonPath.getString("title"), equalTo("refsetTitle"));
    assertThat(jsonPath.get("expansion.parameter.name"), hasItem("paramName"));
    assertThat(jsonPath.get("expansion.contains.system"), hasItem("systemUri"));
}
Also used : JsonPath(io.restassured.path.json.JsonPath) FhirTest(com.b2international.snowowl.fhir.tests.FhirTest) Test(org.junit.Test)

Example 87 with JsonPath

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

the class StructureViewTest method serialize.

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

Example 88 with JsonPath

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

the class ComposeTest method serialize.

@Test
public void serialize() throws Exception {
    printPrettyJson(compose);
    JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(compose));
    assertThat(jsonPath.getString("include[0].system"), equalTo("includeSystem"));
    assertThat(jsonPath.getString("exclude[0].system"), equalTo("excludeSystem"));
}
Also used : JsonPath(io.restassured.path.json.JsonPath) FhirTest(com.b2international.snowowl.fhir.tests.FhirTest) Test(org.junit.Test)

Example 89 with JsonPath

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

the class GroupTest method serializeWithMissingOptionalFields.

@Test
public void serializeWithMissingOptionalFields() throws Exception {
    Group group = Group.builder().addElement(ConceptMapElement.builder().code("ElementCode").display("ElementDisplay").build()).build();
    JsonPath jsonPath = getJsonPath(group);
    assertNull(jsonPath.get("source"));
    assertNull(jsonPath.get("sourceVersion"));
    assertNull(jsonPath.get("target"));
    assertNull(jsonPath.get("targetVersion"));
    assertThat(jsonPath.get("element.code"), hasItem("ElementCode"));
    assertThat(jsonPath.get("element.display"), hasItem("ElementDisplay"));
    assertNull(jsonPath.get("unmapped"));
}
Also used : Group(com.b2international.snowowl.fhir.core.model.conceptmap.Group) JsonPath(io.restassured.path.json.JsonPath) FhirTest(com.b2international.snowowl.fhir.tests.FhirTest) Test(org.junit.Test)

Example 90 with JsonPath

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

the class UnMappedTest method serializeWithMissingOptionalFields.

@Test
public void serializeWithMissingOptionalFields() throws Exception {
    UnMapped unMapped = UnMapped.builder().mode("Mode").build();
    JsonPath jsonPath = getJsonPath(unMapped);
    assertNull(jsonPath.get("code"));
}
Also used : JsonPath(io.restassured.path.json.JsonPath) UnMapped(com.b2international.snowowl.fhir.core.model.conceptmap.UnMapped) 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