use of org.apache.camel.component.cm.client.SMSMessage in project camel by apache.
the class CMTest method testSendInvalidPayload.
@Test(expected = InvalidPayloadRuntimeException.class)
public void testSendInvalidPayload() throws Exception {
// Body
final SMSMessage smsMessage = new SMSMessage(generateIdAsString(), generateGSM0338Message(), null, null);
cmProxy.send(smsMessage);
}
use of org.apache.camel.component.cm.client.SMSMessage in project camel by apache.
the class SMSMessageTest method testE164IsValid.
@Test
public void testE164IsValid() throws Exception {
final SMSMessage m = new SMSMessage("Hello world!", validNumber);
final Set<ConstraintViolation<SMSMessage>> constraintViolations = validator.validate(m);
Assert.isTrue(0 == constraintViolations.size());
}
use of org.apache.camel.component.cm.client.SMSMessage in project camel by apache.
the class SMSMessageTest method testDynamicFromFieldMaxLength.
@Test
public void testDynamicFromFieldMaxLength() throws Exception {
String dynamicFrom = "messagelengthgreaterthan12";
final SMSMessage m = new SMSMessage("idAsString", "Hello World", validNumber, dynamicFrom);
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 testDynamicFromFieldZeroLength.
@Test
public void testDynamicFromFieldZeroLength() throws Exception {
String zeroLengthDynamicFrom = "";
final SMSMessage m = new SMSMessage("idAsString", "Hello World", validNumber, zeroLengthDynamicFrom);
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 testSMSMessageConstructor.
// @After
// public void afterTest() {
@Test
public void testSMSMessageConstructor() throws Throwable {
// Coverage ;)
SMSMessage message = new SMSMessage(null, null);
Assert.isNull(message.getMessage());
Assert.isNull(message.getPhoneNumber());
message = new SMSMessage("idAsString", null, null, "MySelf");
Assert.isTrue(message.getId().equals("idAsString"));
Assert.isTrue(message.getFrom().equals("MySelf"));
}
Aggregations