use of org.springframework.integration.channel.TestChannelResolver in project spring-integration by spring-projects.
the class MethodInvokingRouterTests method channelInstanceResolutionByPayloadConfiguredByMethodReference.
@Test
public void channelInstanceResolutionByPayloadConfiguredByMethodReference() throws Exception {
TestChannelResolver channelResolver = new TestChannelResolver();
SingleChannelInstanceRoutingTestBean testBean = new SingleChannelInstanceRoutingTestBean(channelResolver);
Method routingMethod = testBean.getClass().getMethod("routePayload", String.class);
MethodInvokingRouter router = new MethodInvokingRouter(testBean, routingMethod);
this.doTestChannelInstanceResolutionByPayload(router, channelResolver);
}
use of org.springframework.integration.channel.TestChannelResolver in project spring-integration by spring-projects.
the class MethodInvokingRouterTests method multiChannelListResolutionByMessageConfiguredByMethodReference.
@Test
public void multiChannelListResolutionByMessageConfiguredByMethodReference() throws Exception {
TestChannelResolver channelResolver = new TestChannelResolver();
MultiChannelInstanceRoutingTestBean testBean = new MultiChannelInstanceRoutingTestBean(channelResolver);
Method routingMethod = testBean.getClass().getMethod("routeMessage", Message.class);
MethodInvokingRouter router = new MethodInvokingRouter(testBean, routingMethod);
this.doTestMultiChannelListResolutionByMessage(router, channelResolver);
}
use of org.springframework.integration.channel.TestChannelResolver in project spring-integration by spring-projects.
the class MethodInvokingRouterTests method multiChannelArrayResolutionByMessageConfiguredByMethodName.
@Test
public void multiChannelArrayResolutionByMessageConfiguredByMethodName() {
TestChannelResolver channelResolver = new TestChannelResolver();
MultiChannelInstanceRoutingTestBean testBean = new MultiChannelInstanceRoutingTestBean(channelResolver);
MethodInvokingRouter router = new MethodInvokingRouter(testBean, "routeMessageToArray");
this.doTestMultiChannelArrayResolutionByMessage(router, channelResolver);
}
use of org.springframework.integration.channel.TestChannelResolver in project spring-integration by spring-projects.
the class MethodInvokingRouterTests method multiChannelArrayResolutionByMessageConfiguredByMethodReference.
@Test
public void multiChannelArrayResolutionByMessageConfiguredByMethodReference() throws Exception {
TestChannelResolver channelResolver = new TestChannelResolver();
MultiChannelInstanceRoutingTestBean testBean = new MultiChannelInstanceRoutingTestBean(channelResolver);
Method routingMethod = testBean.getClass().getMethod("routeMessageToArray", Message.class);
MethodInvokingRouter router = new MethodInvokingRouter(testBean, routingMethod);
this.doTestMultiChannelArrayResolutionByMessage(router, channelResolver);
}
use of org.springframework.integration.channel.TestChannelResolver in project spring-integration by spring-projects.
the class MethodInvokingRouterTests method channelNameResolutionByPayloadConfiguredByMethodReference.
@Test
public void channelNameResolutionByPayloadConfiguredByMethodReference() throws Exception {
QueueChannel barChannel = new QueueChannel();
TestChannelResolver channelResolver = new TestChannelResolver();
channelResolver.addChannel("bar-channel", barChannel);
SingleChannelNameRoutingTestBean testBean = new SingleChannelNameRoutingTestBean();
Method routingMethod = testBean.getClass().getMethod("routePayload", String.class);
MethodInvokingRouter router = new MethodInvokingRouter(testBean, routingMethod);
router.setChannelResolver(channelResolver);
Message<String> message = new GenericMessage<String>("bar");
router.handleMessage(message);
Message<?> replyMessage = barChannel.receive();
assertNotNull(replyMessage);
assertEquals(message, replyMessage);
}
Aggregations