use of org.apache.camel.component.cm.client.SMSMessage in project camel by apache.
the class SMSMessageTest method testIdAsStringFieldZeroLength.
@Test
public void testIdAsStringFieldZeroLength() throws Exception {
String zeroLengthIdAsString = "";
final SMSMessage m = new SMSMessage(zeroLengthIdAsString, "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 testNullPhoneNumber.
@Test
public void testNullPhoneNumber() throws Exception {
final SMSMessage m = new SMSMessage("Hello world!", null);
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 testE164NumberWithPlusSignIsInvalid.
@Test
public void testE164NumberWithPlusSignIsInvalid() throws Exception {
final String phoneNumber = "+34 600 00 00 00";
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 testE164NullNumberIsInValid.
@Test
public void testE164NullNumberIsInValid() throws Exception {
final String phoneNumber = null;
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 testE164NoPlusSignedNumberBut00IsInvalid.
@Test
public void testE164NoPlusSignedNumberBut00IsInvalid() throws Exception {
final String phoneNumber = new PhoneNumber().setCountryCodeSource(CountryCodeSource.FROM_NUMBER_WITHOUT_PLUS_SIGN).setNationalNumber(0034600000000).toString();
final SMSMessage m = new SMSMessage("Hello world!", phoneNumber);
final Set<ConstraintViolation<SMSMessage>> constraintViolations = validator.validate(m);
Assert.isTrue(1 == constraintViolations.size());
}
Aggregations