Search in sources :

Example 1 with TestMpWithReturn

use of net.dempsy.lifecycle.annotations.TestMps.TestMpWithReturn in project Dempsy by Dempsy.

the class MessageProcessMessageHandlingTest method testMpMessageTypeInfoOnReturn.

@Test
public void testMpMessageTypeInfoOnReturn() throws Exception {
    final MessageProcessor<TestMpWithReturn> helper = new MessageProcessor<TestMpWithReturn>(new TestMpWithReturn());
    helper.validate();
    final Message m = new Message("yo");
    final TestMpWithReturn instance = helper.newInstance();
    final List<KeyedMessageWithType> kms = helper.invoke(instance, km(m));
    assertEquals(1, kms.size());
    assertNotNull(kms.get(0).messageTypes);
    assertEquals(1, kms.get(0).messageTypes.length);
}
Also used : KeyedMessageWithType(net.dempsy.messages.KeyedMessageWithType) Message(net.dempsy.lifecycle.annotations.TestMps.Message) MessageProcessor(net.dempsy.lifecycle.annotation.MessageProcessor) TestMpWithReturn(net.dempsy.lifecycle.annotations.TestMps.TestMpWithReturn) Test(org.junit.Test)

Aggregations

MessageProcessor (net.dempsy.lifecycle.annotation.MessageProcessor)1 Message (net.dempsy.lifecycle.annotations.TestMps.Message)1 TestMpWithReturn (net.dempsy.lifecycle.annotations.TestMps.TestMpWithReturn)1 KeyedMessageWithType (net.dempsy.messages.KeyedMessageWithType)1 Test (org.junit.Test)1