Search in sources :

Example 1 with RoutingSlipHeaderValueMessageProcessor

use of org.springframework.integration.transformer.support.RoutingSlipHeaderValueMessageProcessor in project spring-integration by spring-projects.

the class RoutingSlipTests method testInvalidRoutingSlipRoutStrategy.

@Test
public void testInvalidRoutingSlipRoutStrategy() {
    try {
        new RoutingSlipHeaderValueMessageProcessor(new Date());
        fail("IllegalArgumentException expected");
    } catch (Exception e) {
        assertThat(e, instanceOf(IllegalArgumentException.class));
        assertThat(e.getMessage(), containsString("The RoutingSlip can contain " + "only bean names of MessageChannel or RoutingSlipRouteStrategy, " + "or MessageChannel and RoutingSlipRouteStrategy instances"));
    }
    try {
        this.invalidRoutingSlipChannel.send(new GenericMessage<>("foo"));
        fail("MessagingException expected");
    } catch (Exception e) {
        assertThat(e, instanceOf(MessagingException.class));
        assertThat(e.getMessage(), containsString("replyChannel must be a MessageChannel or String"));
    }
}
Also used : RoutingSlipHeaderValueMessageProcessor(org.springframework.integration.transformer.support.RoutingSlipHeaderValueMessageProcessor) Date(java.util.Date) MessagingException(org.springframework.messaging.MessagingException) Test(org.junit.Test)

Aggregations

Date (java.util.Date)1 Test (org.junit.Test)1 RoutingSlipHeaderValueMessageProcessor (org.springframework.integration.transformer.support.RoutingSlipHeaderValueMessageProcessor)1 MessagingException (org.springframework.messaging.MessagingException)1