From efae1b5e5fc727cabfc49a44101698472b7412e6 Mon Sep 17 00:00:00 2001 From: Nick Goupinets Date: Thu, 11 Mar 2021 17:44:34 -0500 Subject: [PATCH] Added test --- .../util/PropertyModifyingHelperTest.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/util/PropertyModifyingHelperTest.java diff --git a/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/util/PropertyModifyingHelperTest.java b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/util/PropertyModifyingHelperTest.java new file mode 100644 index 00000000000..85342f75024 --- /dev/null +++ b/hapi-fhir-structures-r4/src/test/java/ca/uhn/fhir/util/PropertyModifyingHelperTest.java @@ -0,0 +1,30 @@ +package ca.uhn.fhir.util; + +import ca.uhn.fhir.context.FhirContext; +import org.hl7.fhir.r4.model.Address; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; + +public class PropertyModifyingHelperTest { + + private static FhirContext ourContext = FhirContext.forR4(); + + @Test + public void test() { + Address address = new Address(); + + PropertyModifyingHelper helper = new PropertyModifyingHelper(ourContext, address); + helper.set("line", "line1"); + helper.set("line", "line2"); + helper.set("city", "city"); + + address = (Address) helper.getBase(); + + assertEquals(2, address.getLine().size()); + assertEquals("city", address.getCity()); + assertNull(address.getCountry()); + } + +}