Add a test
This commit is contained in:
parent
d6e47002c0
commit
c8db7fe035
|
@ -1765,7 +1765,6 @@ public abstract class BaseHapiFhirDao<T extends IBaseResource> implements IDao,
|
|||
|
||||
ourLog.debug("Starting entity update");
|
||||
|
||||
i
|
||||
/*
|
||||
* This should be the very first thing..
|
||||
*/
|
||||
|
|
|
@ -188,6 +188,26 @@ public class XmlParserR4Test {
|
|||
));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEncodeNewLineInString() {
|
||||
Observation o = new Observation();
|
||||
o.setComment("123\n456");
|
||||
String encoded = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(o);
|
||||
ourLog.info(encoded);
|
||||
|
||||
FhirContext
|
||||
.forR4()
|
||||
.newRestfulGenericClient("http://hapi.fhir.org/baseR4")
|
||||
.create()
|
||||
.resource(o)
|
||||
.execute();
|
||||
|
||||
assertThat(encoded, containsString("<comment value=\"123
456\"/>"));
|
||||
|
||||
o = ourCtx.newXmlParser().parseResource(Observation.class, encoded);
|
||||
assertEquals("123\n456", o.getComment());
|
||||
}
|
||||
|
||||
/**
|
||||
* See #11
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue