Search in sources :

Example 6 with TranslateResult

use of com.b2international.snowowl.fhir.core.model.conceptmap.TranslateResult in project snow-owl by b2ihealthcare.

the class TranslateResultSerializationTest method falseResultTest.

@Test
public void falseResultTest() throws Exception {
    TranslateResult translateResult = TranslateResult.builder().build();
    Fhir fhirParameters = new Parameters.Fhir(translateResult);
    JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(fhirParameters));
    assertThat(jsonPath.getString("resourceType"), equalTo("Parameters"));
    assertThat(jsonPath.getList("parameter").size(), is(1));
    assertThat(jsonPath, FhirParameterMatcher.hasParameter("result", FhirDataType.BOOLEAN, false));
}
Also used : TranslateResult(com.b2international.snowowl.fhir.core.model.conceptmap.TranslateResult) Fhir(com.b2international.snowowl.fhir.core.model.dt.Parameters.Fhir) JsonPath(io.restassured.path.json.JsonPath) FhirTest(com.b2international.snowowl.fhir.tests.FhirTest) Test(org.junit.Test)

Example 7 with TranslateResult

use of com.b2international.snowowl.fhir.core.model.conceptmap.TranslateResult in project snow-owl by b2ihealthcare.

the class TranslateResultSerializationTest method parameterizedTest.

@Test
public void parameterizedTest() throws Exception {
    TranslateResult translateResult = TranslateResult.builder().build();
    Fhir fhirParameters = new Parameters.Fhir(translateResult);
    JsonPath jsonPath = JsonPath.from(objectMapper.writeValueAsString(fhirParameters));
    assertThat(jsonPath.getString("resourceType"), equalTo("Parameters"));
    assertThat(jsonPath.getList("parameter").size(), is(1));
    assertThat(jsonPath, FhirParameterMatcher.hasParameter("result", FhirDataType.BOOLEAN, false));
}
Also used : TranslateResult(com.b2international.snowowl.fhir.core.model.conceptmap.TranslateResult) Fhir(com.b2international.snowowl.fhir.core.model.dt.Parameters.Fhir) JsonPath(io.restassured.path.json.JsonPath) FhirTest(com.b2international.snowowl.fhir.tests.FhirTest) Test(org.junit.Test)

Aggregations

TranslateResult (com.b2international.snowowl.fhir.core.model.conceptmap.TranslateResult)7 Fhir (com.b2international.snowowl.fhir.core.model.dt.Parameters.Fhir)7 Test (org.junit.Test)7 Match (com.b2international.snowowl.fhir.core.model.conceptmap.Match)5 Parameters (com.b2international.snowowl.fhir.core.model.dt.Parameters)5 Json (com.b2international.snowowl.fhir.core.model.dt.Parameters.Json)4 FhirRestTest (com.b2international.snowowl.fhir.tests.FhirRestTest)4 FhirTest (com.b2international.snowowl.fhir.tests.FhirTest)3 IBranchPath (com.b2international.snowowl.core.api.IBranchPath)2 FhirTestConcepts (com.b2international.snowowl.fhir.tests.FhirTestConcepts)2 Concepts (com.b2international.snowowl.snomed.common.SnomedConstants.Concepts)2 SnomedUri (com.b2international.snowowl.snomed.fhir.SnomedUri)2 RestExtensions.givenAuthenticatedRequest (com.b2international.snowowl.test.commons.rest.RestExtensions.givenAuthenticatedRequest)2 JsonPath (io.restassured.path.json.JsonPath)2 Collection (java.util.Collection)2 List (java.util.List)2 Optional (java.util.Optional)2 CoreMatchers.equalTo (org.hamcrest.CoreMatchers.equalTo)2 Assert.assertEquals (org.junit.Assert.assertEquals)2 Assert.assertTrue (org.junit.Assert.assertTrue)2