use of org.apache.camel.component.cm.CMProducer in project camel by apache.
the class CMTest method testCMResponseException.
/*
* 3. CM Responses (Faking Exceptions)
*/
@Test(expected = CMResponseException.class)
public void testCMResponseException() throws Exception {
// Change sending strategy
CMEndpoint endpoint = (CMEndpoint) camelContext.getEndpoint(applicationContext.getBean(CamelTestConfiguration.class).getUri());
CMProducer producer = endpoint.createProducer();
producer.setSender(new CMResponseExceptionSender());
// 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 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);
}
use of org.apache.camel.component.cm.CMProducer in project camel by apache.
the class CMTest method testNoMessageException.
@Test(expected = NoMessageException.class)
public void testNoMessageException() throws Exception {
// Change sending strategy
CMEndpoint endpoint = (CMEndpoint) camelContext.getEndpoint(applicationContext.getBean(CamelTestConfiguration.class).getUri());
CMProducer producer = endpoint.createProducer();
producer.setSender(new NoMessageExceptionSender());
// 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 testInvalidProductTokenException.
@Test(expected = InvalidProductTokenException.class)
public void testInvalidProductTokenException() throws Exception {
// Change sending strategy
CMEndpoint endpoint = (CMEndpoint) camelContext.getEndpoint(applicationContext.getBean(CamelTestConfiguration.class).getUri());
CMProducer producer = endpoint.createProducer();
producer.setSender(new InvalidProductTokenExceptionSender());
// Body
final SMSMessage smsMessage = new SMSMessage(generateIdAsString(), generateUnicodeMessage(), validNumber, null);
send(producer, smsMessage);
}
Aggregations