Search in sources :

Example 1 with UnroutableMessageExceptionSender

use of org.apache.camel.component.cm.test.mocks.cmsender.UnroutableMessageExceptionSender in project camel by apache.

the class CMTest method testUnroutableMessageException.

@Test(expected = UnroutableMessageException.class)
public void testUnroutableMessageException() throws Exception {
    // Change sending strategy
    CMEndpoint endpoint = (CMEndpoint) camelContext.getEndpoint(applicationContext.getBean(CamelTestConfiguration.class).getUri());
    CMProducer producer = endpoint.createProducer();
    producer.setSender(new UnroutableMessageExceptionSender());
    // Body
    final SMSMessage smsMessage = new SMSMessage(generateIdAsString(), generateUnicodeMessage(), validNumber, null);
    send(producer, smsMessage);
}
Also used : CMEndpoint(org.apache.camel.component.cm.CMEndpoint) SMSMessage(org.apache.camel.component.cm.client.SMSMessage) UnroutableMessageExceptionSender(org.apache.camel.component.cm.test.mocks.cmsender.UnroutableMessageExceptionSender) CMProducer(org.apache.camel.component.cm.CMProducer) Test(org.junit.Test)

Aggregations

CMEndpoint (org.apache.camel.component.cm.CMEndpoint)1 CMProducer (org.apache.camel.component.cm.CMProducer)1 SMSMessage (org.apache.camel.component.cm.client.SMSMessage)1 UnroutableMessageExceptionSender (org.apache.camel.component.cm.test.mocks.cmsender.UnroutableMessageExceptionSender)1 Test (org.junit.Test)1