Added test
This commit is contained in:
parent
efae1b5e5f
commit
d68ee68b5d
|
@ -4,6 +4,8 @@ import ca.uhn.fhir.context.FhirContext;
|
||||||
import org.hl7.fhir.r4.model.Address;
|
import org.hl7.fhir.r4.model.Address;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||||
|
|
||||||
|
@ -12,7 +14,7 @@ public class PropertyModifyingHelperTest {
|
||||||
private static FhirContext ourContext = FhirContext.forR4();
|
private static FhirContext ourContext = FhirContext.forR4();
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test() {
|
public void testSetAndGet() {
|
||||||
Address address = new Address();
|
Address address = new Address();
|
||||||
|
|
||||||
PropertyModifyingHelper helper = new PropertyModifyingHelper(ourContext, address);
|
PropertyModifyingHelper helper = new PropertyModifyingHelper(ourContext, address);
|
||||||
|
@ -25,6 +27,11 @@ public class PropertyModifyingHelperTest {
|
||||||
assertEquals(2, address.getLine().size());
|
assertEquals(2, address.getLine().size());
|
||||||
assertEquals("city", address.getCity());
|
assertEquals("city", address.getCity());
|
||||||
assertNull(address.getCountry());
|
assertNull(address.getCountry());
|
||||||
|
|
||||||
|
helper.setDelimiter(";");
|
||||||
|
assertEquals("line1;line2;city", helper.getFields("line", "city"));
|
||||||
|
List<String> lines = helper.getMultiple("line");
|
||||||
|
assertEquals("[line1, line2]", lines.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue