use of org.apache.camel.component.cm.CMProducer in project camel by apache.
the class CMTest method testInsufficientBalanceException.
@Test(expected = InsufficientBalanceException.class)
public void testInsufficientBalanceException() throws Exception {
// Change sending strategy
CMEndpoint endpoint = (CMEndpoint) camelContext.getEndpoint(applicationContext.getBean(CamelTestConfiguration.class).getUri());
CMProducer producer = endpoint.createProducer();
producer.setSender(new InsufficientBalanceExceptionSender());
// Body
final SMSMessage smsMessage = new SMSMessage(generateIdAsString(), generateGSM0338Message(), validNumber, null);
send(producer, smsMessage);
}
use of org.apache.camel.component.cm.CMProducer in project camel by apache.
the class CMTest method testUnknownErrorException.
@Test(expected = UnknownErrorException.class)
public void testUnknownErrorException() throws Exception {
// Change sending strategy
CMEndpoint endpoint = (CMEndpoint) camelContext.getEndpoint(applicationContext.getBean(CamelTestConfiguration.class).getUri());
CMProducer producer = endpoint.createProducer();
producer.setSender(new UnknownErrorExceptionSender());
// Body
final SMSMessage smsMessage = new SMSMessage(generateIdAsString(), generateGSM0338Message(), validNumber, null);
send(producer, smsMessage);
}
use of org.apache.camel.component.cm.CMProducer in project camel by apache.
the class CMTest method testInvalidMSISDNException.
@Test(expected = InvalidMSISDNException.class)
public void testInvalidMSISDNException() throws Exception {
// Change sending strategy
CMEndpoint endpoint = (CMEndpoint) camelContext.getEndpoint(applicationContext.getBean(CamelTestConfiguration.class).getUri());
CMProducer producer = endpoint.createProducer();
producer.setSender(new InvalidMSISDNExceptionSender());
// Body
final SMSMessage smsMessage = new SMSMessage(generateIdAsString(), generateUnicodeMessage(), validNumber, null);
send(producer, smsMessage);
}
use of org.apache.camel.component.cm.CMProducer in project camel by apache.
the class CMTest method testNotPhoneNumberFoundException.
@Test(expected = NotPhoneNumberFoundException.class)
public void testNotPhoneNumberFoundException() throws Exception {
// Change sending strategy
CMEndpoint endpoint = (CMEndpoint) camelContext.getEndpoint(applicationContext.getBean(CamelTestConfiguration.class).getUri());
CMProducer producer = endpoint.createProducer();
producer.setSender(new NotPhoneNumberFoundExceptionSender());
// Body
final SMSMessage smsMessage = new SMSMessage(generateIdAsString(), generateUnicodeMessage(), validNumber, null);
send(producer, smsMessage);
}
use of org.apache.camel.component.cm.CMProducer 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);
}
Aggregations