use of javax.validation.ConstraintViolation in project camel by apache.
the class CMConfigurationTest method testNullDefaultFrom.
@Test
public void testNullDefaultFrom() throws Exception {
final CMConfiguration configuration = new CMConfiguration();
// length: 1-11
configuration.setDefaultFrom(null);
configuration.setProductToken(UUID.randomUUID().toString());
configuration.setDefaultMaxNumberOfParts(8);
configuration.setTestConnectionOnStartup(false);
final Set<ConstraintViolation<CMConfiguration>> constraintViolations = validator.validate(configuration);
Assert.isTrue(1 == constraintViolations.size());
}
use of javax.validation.ConstraintViolation in project camel by apache.
the class CMConfigurationTest method testDefaultFromFieldMaxLength.
@Test
public void testDefaultFromFieldMaxLength() throws Exception {
final CMConfiguration configuration = new CMConfiguration();
// length: 1-11
configuration.setDefaultFrom("123456789012");
configuration.setProductToken(UUID.randomUUID().toString());
configuration.setDefaultMaxNumberOfParts(8);
configuration.setTestConnectionOnStartup(false);
final Set<ConstraintViolation<CMConfiguration>> constraintViolations = validator.validate(configuration);
Assert.isTrue(1 == constraintViolations.size());
}
use of javax.validation.ConstraintViolation 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 javax.validation.ConstraintViolation 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 javax.validation.ConstraintViolation 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());
}
Aggregations