Search in sources :

Example 1 with NoAccountFoundForProductTokenExceptionSender

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

the class CMTest method testNoAccountFoundForProductTokenException.

@Test(expected = NoAccountFoundForProductTokenException.class)
public void testNoAccountFoundForProductTokenException() throws Exception {
    // Change sending strategy
    CMEndpoint endpoint = (CMEndpoint) camelContext.getEndpoint(applicationContext.getBean(CamelTestConfiguration.class).getUri());
    CMProducer producer = endpoint.createProducer();
    producer.setSender(new NoAccountFoundForProductTokenExceptionSender());
    // Body
    final SMSMessage smsMessage = new SMSMessage(generateIdAsString(), generateGSM0338Message(), validNumber, null);
    send(producer, smsMessage);
}
Also used : CMEndpoint(org.apache.camel.component.cm.CMEndpoint) NoAccountFoundForProductTokenExceptionSender(org.apache.camel.component.cm.test.mocks.cmsender.NoAccountFoundForProductTokenExceptionSender) SMSMessage(org.apache.camel.component.cm.client.SMSMessage) 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 NoAccountFoundForProductTokenExceptionSender (org.apache.camel.component.cm.test.mocks.cmsender.NoAccountFoundForProductTokenExceptionSender)1 Test (org.junit.Test)1