Search in sources :

Example 1 with PhoneNumber

use of com.google.i18n.phonenumbers.Phonenumber.PhoneNumber 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());
}
Also used : SMSMessage(org.apache.camel.component.cm.client.SMSMessage) ConstraintViolation(javax.validation.ConstraintViolation) PhoneNumber(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber) Test(org.junit.Test)

Aggregations

PhoneNumber (com.google.i18n.phonenumbers.Phonenumber.PhoneNumber)1 ConstraintViolation (javax.validation.ConstraintViolation)1 SMSMessage (org.apache.camel.component.cm.client.SMSMessage)1 Test (org.junit.Test)1