Add a test

This commit is contained in:
James Agnew 2019-07-22 18:53:22 -04:00
parent 60ea922e8d
commit b1e409519d
1 changed files with 23 additions and 0 deletions

View File

@ -257,6 +257,29 @@ public class FhirResourceDaoR4CreateTest extends BaseJpaR4Test {
} }
@Test
public void testTagsInContainedResourcesPreserved() {
Patient p = new Patient();
p.setActive(true);
Organization o = new Organization();
o.getMeta().addTag("http://foo", "bar", "FOOBAR");
p.getManagingOrganization().setResource(o);
ourLog.info("Input: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(p));
IIdType id = myPatientDao.create(p).getId().toUnqualifiedVersionless();
p = myPatientDao.read(id);
ourLog.info("Output: {}", myFhirCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(p));
Organization org = (Organization) p.getManagingOrganization().getResource();
assertEquals("#1", org.getId());
assertEquals(1, org.getMeta().getTag().size());
}
@AfterClass @AfterClass
public static void afterClassClearContext() { public static void afterClassClearContext() {