use of com.nedap.archie.rm.ehr.Ehr in project openEHR_SDK by ehrbase.
the class CanonicalJsonMarshallingTest method marshallEhr.
@Test
public void marshallEhr() {
List<ObjectRef<? extends ObjectId>> compositions = new ArrayList<>();
compositions.add(new ObjectRef<>(new HierObjectId("COMPOSITION"), "local", "b5c4aaed-2adc-4c56-9005-e21ff3cca62a::local.ehrbase.org::2"));
List<ObjectRef<? extends ObjectId>> contributions = new ArrayList<>();
contributions.add(new ObjectRef<>(new HierObjectId("COMPOSITION"), "local", "b5c4aaed-2adc-4c56-9005-e21ff3cca62a::local.ehrbase.org::2"));
List<ObjectRef<? extends ObjectId>> folders = new ArrayList<>();
folders.add(new ObjectRef<>(new HierObjectId("COMPOSITION"), "local", "b5c4aaed-2adc-4c56-9005-e21ff3cca62a::local.ehrbase.org::2"));
Ehr expected = new Ehr();
expected.setCompositions(compositions);
expected.setContributions(contributions);
expected.setFolders(folders);
CanonicalJson cut = new CanonicalJson();
String json = cut.marshal(expected);
Ehr actual = cut.unmarshal(json, Ehr.class);
Assert.assertEquals(actual, expected);
}
Aggregations