use of org.apache.camel.component.cm.client.SMSMessage in project camel by apache.
the class SMSMessageTest method testIdAsStringMaxLength.
@Test
public void testIdAsStringMaxLength() throws Exception {
String idAsString = "thisistheidastringlengthgreaterthan32";
final SMSMessage m = new SMSMessage(idAsString, "Hello World", validNumber, "MySelf");
final Set<ConstraintViolation<SMSMessage>> constraintViolations = validator.validate(m);
Assert.isTrue(1 == constraintViolations.size());
}
use of org.apache.camel.component.cm.client.SMSMessage in project camel by apache.
the class SMSMessageTest method testE164NoPlusSignedNumberIsInvalid.
@Test
public void testE164NoPlusSignedNumberIsInvalid() throws Exception {
final String phoneNumber = "34600000000";
final SMSMessage m = new SMSMessage("Hello world!", phoneNumber);
final Set<ConstraintViolation<SMSMessage>> constraintViolations = validator.validate(m);
Assert.isTrue(1 == constraintViolations.size());
}
use of org.apache.camel.component.cm.client.SMSMessage in project camel by apache.
the class SMSMessageTest method testNullMessageField.
@Test
public void testNullMessageField() throws Exception {
final SMSMessage m = new SMSMessage(null, validNumber);
final Set<ConstraintViolation<SMSMessage>> constraintViolations = validator.validate(m);
Assert.isTrue(1 == constraintViolations.size());
}
use of org.apache.camel.component.cm.client.SMSMessage 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