Search in sources :

Example 1 with SmsMessage

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");
}
Also used : SmsMessage(org.sagebionetworks.bridge.models.sms.SmsMessage) Test(org.testng.annotations.Test)

Example 2 with SmsMessage

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;
}
Also used : SmsMessage(org.sagebionetworks.bridge.models.sms.SmsMessage)

Example 3 with SmsMessage

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");
}
Also used : SmsMessage(org.sagebionetworks.bridge.models.sms.SmsMessage) Test(org.testng.annotations.Test)

Example 4 with SmsMessage

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");
}
Also used : SmsMessage(org.sagebionetworks.bridge.models.sms.SmsMessage) Test(org.testng.annotations.Test)

Example 5 with SmsMessage

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");
}
Also used : SmsMessage(org.sagebionetworks.bridge.models.sms.SmsMessage) Test(org.testng.annotations.Test)

Aggregations

SmsMessage (org.sagebionetworks.bridge.models.sms.SmsMessage)24 Test (org.testng.annotations.Test)20 QueryResultPage (com.amazonaws.services.dynamodbv2.datamodeling.QueryResultPage)2 DynamoDBQueryExpression (com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBQueryExpression)1 PublishResult (com.amazonaws.services.sns.model.PublishResult)1 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)1 IOException (java.io.IOException)1 DateTime (org.joda.time.DateTime)1 BridgeServiceException (org.sagebionetworks.bridge.exceptions.BridgeServiceException)1 Phone (org.sagebionetworks.bridge.models.accounts.Phone)1 StudyParticipant (org.sagebionetworks.bridge.models.accounts.StudyParticipant)1 App (org.sagebionetworks.bridge.models.apps.App)1 HealthDataSubmission (org.sagebionetworks.bridge.models.healthdata.HealthDataSubmission)1 UploadValidationException (org.sagebionetworks.bridge.upload.UploadValidationException)1