diff --git a/org.hl7.fhir.dstu3/src/test/java/org/hl7/fhir/dstu3/utils/FhirPathTests.java b/org.hl7.fhir.dstu3/src/test/java/org/hl7/fhir/dstu3/utils/FhirPathTests.java index 800668cc6..f595e238a 100644 --- a/org.hl7.fhir.dstu3/src/test/java/org/hl7/fhir/dstu3/utils/FhirPathTests.java +++ b/org.hl7.fhir.dstu3/src/test/java/org/hl7/fhir/dstu3/utils/FhirPathTests.java @@ -1,15 +1,22 @@ package org.hl7.fhir.dstu3.utils; - import org.hl7.fhir.dstu3.context.IWorkerContext; import org.hl7.fhir.dstu3.model.Base; import org.hl7.fhir.dstu3.model.ExpressionNode; +import org.hl7.fhir.dstu3.model.StringType; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.junit.jupiter.MockitoExtension; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.times; + @ExtendWith(MockitoExtension.class) public class FhirPathTests { @@ -43,7 +50,12 @@ public class FhirPathTests { expressionNode.getParameters().add(expressionNodeB); expressionNode.getParameters().add(expressionNodeC); - engine.evaluate(appContext, resource, base, expressionNode); + List result = engine.evaluate(appContext, resource, base, expressionNode); + assertEquals(1, result.size()); + Base onlyResult = result.get(0); + assertTrue(onlyResult instanceof StringType); + assertEquals("base", ((StringType)result.get(0)).asStringValue()); + Mockito.verify(engine, times(2)).convertToString(any()); } } \ No newline at end of file