Search in sources :

Example 1 with Contribution

use of com.nedap.archie.rm.changecontrol.Contribution in project openEHR_SDK by ehrbase.

the class CanonicalJsonMarshallingTest method marshallContribution.

@Test
public void marshallContribution() {
    List<ObjectRef<? extends ObjectId>> versions = new ArrayList<>();
    versions.add(new ObjectRef<>(new HierObjectId("COMPOSITION"), "local", "b5c4aaed-2adc-4c56-9005-e21ff3cca62a::local.ehrbase.org::2"));
    Contribution expected = new Contribution();
    expected.setUid(new HierObjectId("bbf60d27-9200-4995-a950-279f889d1050"));
    expected.setVersions(versions);
    CanonicalJson cut = new CanonicalJson();
    String json = cut.marshal(expected);
    Contribution actual = cut.unmarshal(json, Contribution.class);
    Assert.assertEquals(actual, expected);
}
Also used : ObjectId(com.nedap.archie.rm.support.identification.ObjectId) HierObjectId(com.nedap.archie.rm.support.identification.HierObjectId) ArrayList(java.util.ArrayList) ObjectRef(com.nedap.archie.rm.support.identification.ObjectRef) HierObjectId(com.nedap.archie.rm.support.identification.HierObjectId) Contribution(com.nedap.archie.rm.changecontrol.Contribution) Test(org.junit.Test)

Aggregations

Contribution (com.nedap.archie.rm.changecontrol.Contribution)1 HierObjectId (com.nedap.archie.rm.support.identification.HierObjectId)1 ObjectId (com.nedap.archie.rm.support.identification.ObjectId)1 ObjectRef (com.nedap.archie.rm.support.identification.ObjectRef)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1