use of org.sagebionetworks.bridge.models.sms.SmsMessage in project BridgeServer2 by Sage-Bionetworks.
the class SmsMessageValidatorTest method emptyMessageId.
@Test
public void emptyMessageId() {
SmsMessage message = makeValidSmsMessage();
message.setMessageId("");
assertValidatorMessage(SmsMessageValidator.INSTANCE, message, "messageId", "is required");
}
use of org.sagebionetworks.bridge.models.sms.SmsMessage in project BridgeServer2 by Sage-Bionetworks.
the class SmsMessageValidatorTest method makeValidSmsMessage.
private static SmsMessage makeValidSmsMessage() {
SmsMessage message = SmsMessage.create();
message.setPhoneNumber(PHONE_NUMBER);
message.setSentOn(SENT_ON);
message.setMessageId(MESSAGE_ID);
message.setMessageBody(MESSAGE_BODY);
message.setSmsType(SmsType.PROMOTIONAL);
message.setAppId(TEST_APP_ID);
return message;
}
use of org.sagebionetworks.bridge.models.sms.SmsMessage in project BridgeServer2 by Sage-Bionetworks.
the class SmsMessageValidatorTest method zeroSentOn.
@Test
public void zeroSentOn() {
SmsMessage message = makeValidSmsMessage();
message.setSentOn(0);
assertValidatorMessage(SmsMessageValidator.INSTANCE, message, "sentOn", "must be positive");
}
use of org.sagebionetworks.bridge.models.sms.SmsMessage in project BridgeServer2 by Sage-Bionetworks.
the class SmsMessageValidatorTest method emptyPhoneNumber.
@Test
public void emptyPhoneNumber() {
SmsMessage message = makeValidSmsMessage();
message.setPhoneNumber("");
assertValidatorMessage(SmsMessageValidator.INSTANCE, message, "number", "is required");
}
use of org.sagebionetworks.bridge.models.sms.SmsMessage in project BridgeServer2 by Sage-Bionetworks.
the class SmsMessageValidatorTest method nullMessageBody.
@Test
public void nullMessageBody() {
SmsMessage message = makeValidSmsMessage();
message.setMessageBody(null);
assertValidatorMessage(SmsMessageValidator.INSTANCE, message, "messageBody", "is required");
}
Aggregations