Search in sources :

Example 1 with TestMpWithMultiLevelMessageTypeParameter

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

the class MessageProcessMessageHandlingTest method testMpMessageTypeInfoOnParameter.

@Test
public void testMpMessageTypeInfoOnParameter() throws Exception {
    final MessageProcessor<TestMpWithMultiLevelMessageTypeParameter> helper = new MessageProcessor<TestMpWithMultiLevelMessageTypeParameter>(new TestMpWithMultiLevelMessageTypeParameter());
    helper.validate();
    final Set<String> mts = helper.messagesTypesHandled();
    assertEquals(1, mts.size());
    exception.expect(IllegalArgumentException.class);
    exception.expectMessage("no handler for messages of type");
    final Message m = new Message("yo");
    final TestMpWithMultiLevelMessageTypeParameter instance = helper.newInstance();
    helper.invoke(instance, km(m));
}
Also used : TestMpWithMultiLevelMessageTypeParameter(net.dempsy.lifecycle.annotations.TestMps.TestMpWithMultiLevelMessageTypeParameter) Message(net.dempsy.lifecycle.annotations.TestMps.Message) MessageProcessor(net.dempsy.lifecycle.annotation.MessageProcessor) Test(org.junit.Test)

Aggregations

MessageProcessor (net.dempsy.lifecycle.annotation.MessageProcessor)1 Message (net.dempsy.lifecycle.annotations.TestMps.Message)1 TestMpWithMultiLevelMessageTypeParameter (net.dempsy.lifecycle.annotations.TestMps.TestMpWithMultiLevelMessageTypeParameter)1 Test (org.junit.Test)1