use of org.apache.camel.component.cm.client.SMSMessage 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.client.SMSMessage 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.client.SMSMessage 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.client.SMSMessage 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.client.SMSMessage in project camel by apache.
the class CMTest method testAsPartOfARoute.
// @DirtiesContext
@Test(expected = NoAccountFoundForProductTokenException.class)
public void testAsPartOfARoute() throws Exception {
// Body
final SMSMessage smsMessage = new SMSMessage(generateIdAsString(), generateUnicodeMessage(), validNumber, null);
cmProxy.send(smsMessage);
}
Aggregations