@Test
public void storeUserMessage() throws PersistenceException {

    // Store a User Message
    UserMessageEntity userMsg =
            updManager.storeMessageUnit(new org.holodeckb2b.common.messagemodel.UserMessage(TestData.userMsg1));
    assertNotNull(userMsg);
    assertNotNull(userMsg.getOID());
    assertEquals(TestData.userMsg1.getPModeId(), userMsg.getPModeId());
    assertEquals(TestData.userMsg1.getMessageId(), userMsg.getMessageId());
    assertEquals(TestData.userMsg1.getRefToMessageId(), userMsg.getRefToMessageId());
    assertEquals(TestData.userMsg1.getDirection(), userMsg.getDirection());
    assertTrue(CompareUtils.areEqual(TestData.userMsg1.getSender(), userMsg.getSender()));
    assertTrue(CompareUtils.areEqual(TestData.userMsg1.getReceiver(), userMsg.getReceiver()));
    assertFalse(Utils.isNullOrEmpty(userMsg.getProcessingStates()));
    assertEquals(TestData.userMsg1.getCurrentProcessingState().getStartTime(),
            userMsg.getCurrentProcessingState().getStartTime());
    assertEquals(TestData.userMsg1.getCurrentProcessingState().getState(),
            userMsg.getCurrentProcessingState().getState());
    assertFalse(Utils.isNullOrEmpty(userMsg.getPayloads()));
    assertEquals(1, userMsg.getPayloads().size());
    IPayload savedPayload = userMsg.getPayloads().iterator().next();
    IPayload orgPayload = TestData.userMsg1.getPayloads().iterator().next();
    assertEquals(orgPayload.getContainment(), savedPayload.getContainment());
    assertFalse(Utils.isNullOrEmpty(savedPayload.getProperties()));
    assertEquals(1, savedPayload.getProperties().size());
    assertTrue(CompareUtils.areEqual(orgPayload.getProperties().iterator().next(),
            savedPayload.getProperties().iterator().next()));
    assertEquals(orgPayload.getSchemaReference().getNamespace(), savedPayload.getSchemaReference().getNamespace());
    assertNull(savedPayload.getSchemaReference().getLocation());
    assertNotNull(savedPayload.getDescription());
    assertTrue(CompareUtils.areEqual(TestData.userMsg1.getCollaborationInfo().getService(),
            userMsg.getCollaborationInfo().getService()));
    assertFalse(Utils.isNullOrEmpty(userMsg.getMessageProperties()));
    assertEquals(1, userMsg.getMessageProperties().size());
    assertTrue(CompareUtils.areEqual(TestData.userMsg1.getMessageProperties().iterator().next(),
            userMsg.getMessageProperties().iterator().next()));
}