@Test(expected = MessagingException.class) public void methodWithReturnValue() { Message<?> message = new GenericMessage<String>("test"); try { MethodInvokingMessageHandler handler = new MethodInvokingMessageHandler(new TestSink(), "methodWithReturnValue"); handler.handleMessage(message); } catch (MessagingException e) { assertEquals(e.getFailedMessage(), message); throw e; } }
@Test public void validMethod() { MethodInvokingMessageHandler handler = new MethodInvokingMessageHandler(new TestSink(), "validMethod"); handler.handleMessage(new GenericMessage<String>("test")); }