use of org.springframework.integration.channel.TestChannelResolver in project spring-integration by spring-projects.
the class RouterTests method nullChannelIdentifierUsingChannelResolverRaisesMessageDeliveryExceptionByDefault.
@Test(expected = MessageDeliveryException.class)
public void nullChannelIdentifierUsingChannelResolverRaisesMessageDeliveryExceptionByDefault() {
AbstractMappingMessageRouter router = new AbstractMappingMessageRouter() {
@Override
protected List<Object> getChannelKeys(Message<?> message) {
return null;
}
};
TestChannelResolver channelResolver = new TestChannelResolver();
router.setChannelResolver(channelResolver);
Message<String> message = new GenericMessage<String>("test");
router.handleMessage(message);
}
use of org.springframework.integration.channel.TestChannelResolver in project spring-integration by spring-projects.
the class RouterTests method nullChannelIdentifierInListRaisesMessageDeliveryExceptionByDefault.
@Test(expected = MessageDeliveryException.class)
public void nullChannelIdentifierInListRaisesMessageDeliveryExceptionByDefault() {
AbstractMappingMessageRouter router = new AbstractMappingMessageRouter() {
@Override
protected List<Object> getChannelKeys(Message<?> message) {
return Collections.singletonList(null);
}
};
TestChannelResolver channelResolver = new TestChannelResolver();
router.setChannelResolver(channelResolver);
Message<String> message = new GenericMessage<String>("test");
router.handleMessage(message);
}
use of org.springframework.integration.channel.TestChannelResolver in project spring-integration by spring-projects.
the class MethodInvokingRouterTests method multiChannelListResolutionByPayloadConfiguredByMethodReference.
@Test
public void multiChannelListResolutionByPayloadConfiguredByMethodReference() throws Exception {
TestChannelResolver channelResolver = new TestChannelResolver();
MultiChannelInstanceRoutingTestBean testBean = new MultiChannelInstanceRoutingTestBean(channelResolver);
Method routingMethod = testBean.getClass().getMethod("routePayload", String.class);
MethodInvokingRouter router = new MethodInvokingRouter(testBean, routingMethod);
this.doTestMultiChannelListResolutionByPayload(router, channelResolver);
}
use of org.springframework.integration.channel.TestChannelResolver in project spring-integration by spring-projects.
the class MethodInvokingRouterTests method channelInstanceResolutionByPayloadConfiguredByMethodName.
@Test
public void channelInstanceResolutionByPayloadConfiguredByMethodName() {
TestChannelResolver channelResolver = new TestChannelResolver();
SingleChannelInstanceRoutingTestBean testBean = new SingleChannelInstanceRoutingTestBean(channelResolver);
MethodInvokingRouter router = new MethodInvokingRouter(testBean, "routePayload");
this.doTestChannelInstanceResolutionByPayload(router, channelResolver);
}
use of org.springframework.integration.channel.TestChannelResolver in project spring-integration by spring-projects.
the class MethodInvokingRouterTests method channelInstanceResolutionByMessageConfiguredByMethodReference.
@Test
public void channelInstanceResolutionByMessageConfiguredByMethodReference() throws Exception {
TestChannelResolver channelResolver = new TestChannelResolver();
SingleChannelInstanceRoutingTestBean testBean = new SingleChannelInstanceRoutingTestBean(channelResolver);
Method routingMethod = testBean.getClass().getMethod("routeMessage", Message.class);
MethodInvokingRouter router = new MethodInvokingRouter(testBean, routingMethod);
this.doTestChannelInstanceResolutionByMessage(router, channelResolver);
}
Aggregations