Search in sources :

Example 1 with StubSerializableMessage

use of com.adaptris.core.stubs.StubSerializableMessage in project interlok by adaptris.

the class WorkflowManagerTest method createSM.

private SerializableMessage createSM(String msgUniqueId) {
    SerializableMessage msg = new StubSerializableMessage();
    msg.setUniqueId(msgUniqueId);
    msg.setContent(PAYLOAD);
    msg.setContentEncoding(PAYLOAD_ENCODING);
    msg.addMessageHeader(METADATA_KEY, METADATA_VALUE);
    return msg;
}
Also used : StubSerializableMessage(com.adaptris.core.stubs.StubSerializableMessage) SerializableMessage(com.adaptris.interlok.types.SerializableMessage) StubSerializableMessage(com.adaptris.core.stubs.StubSerializableMessage)

Example 2 with StubSerializableMessage

use of com.adaptris.core.stubs.StubSerializableMessage in project interlok by adaptris.

the class SerializableAdaptrisMessageTest method testConstructors.

@Test
public void testConstructors() throws Exception {
    SerializableAdaptrisMessage message = new SerializableAdaptrisMessage(testName.getMethodName());
    assertEquals(testName.getMethodName(), message.getUniqueId());
    assertEquals(0, message.getMetadata().size());
    assertNull(message.getContent());
    assertEquals("", message.getNextServiceId());
    message = new SerializableAdaptrisMessage(testName.getMethodName(), "my payload");
    assertEquals(testName.getMethodName(), message.getUniqueId());
    assertEquals(0, message.getMetadata().size());
    assertEquals("my payload", message.getContent());
    assertEquals("", message.getNextServiceId());
    SerializableMessage stub = new StubSerializableMessage();
    stub.setUniqueId(testName.getMethodName());
    stub.setContent("my payload");
    message = new SerializableAdaptrisMessage(stub);
    assertEquals(testName.getMethodName(), message.getUniqueId());
    assertEquals(0, message.getMetadata().size());
    assertEquals("my payload", message.getContent());
    assertEquals("", message.getNextServiceId());
}
Also used : SerializableMessage(com.adaptris.interlok.types.SerializableMessage) StubSerializableMessage(com.adaptris.core.stubs.StubSerializableMessage) StubSerializableMessage(com.adaptris.core.stubs.StubSerializableMessage) Test(org.junit.Test)

Aggregations

StubSerializableMessage (com.adaptris.core.stubs.StubSerializableMessage)2 SerializableMessage (com.adaptris.interlok.types.SerializableMessage)2 Test (org.junit.Test)1