diff --git a/src/main/com/sailthru/client/params/User.java b/src/main/com/sailthru/client/params/User.java index 312c5d9..08bae19 100644 --- a/src/main/com/sailthru/client/params/User.java +++ b/src/main/com/sailthru/client/params/User.java @@ -103,8 +103,9 @@ public ApiAction getApiCall() { public enum OptOutType { OPT_OUT_TYPE_STOP("opt-out"), - OPT_OUT_TYPE_START("opt-in"); - + OPT_OUT_TYPE_START("opt-in"), + OPT_OUT_TYPE_PENDING("pending"), + OPT_OUT_TYPE_DOUBLE_OPT_IN("double-opt-in"); public final String optOutTypeStr; OptOutType(String optOutTypeStr) { diff --git a/src/test/com/sailthru/client/params/UserTest.java b/src/test/com/sailthru/client/params/UserTest.java index ba1766a..fe4f4f2 100644 --- a/src/test/com/sailthru/client/params/UserTest.java +++ b/src/test/com/sailthru/client/params/UserTest.java @@ -118,7 +118,7 @@ public void testSetOptoutSmsStatus() { assertEquals(expected, result); } - public void testSetSmsMarketingStatus() { + public void testSetSmsMarketingStatusTypeStart() { user.setSmsMarketingStatus(User.OptOutType.OPT_OUT_TYPE_START); String expected = "{\"sms_marketing_status\":\"opt-in\"}"; @@ -126,7 +126,7 @@ public void testSetSmsMarketingStatus() { assertEquals(expected, result); } - public void testSetSmsTransactionalStatus() { + public void testSetSmsTransactionalStatusTypeStart() { user.setSmsTransactionalStatus(User.OptOutType.OPT_OUT_TYPE_START); String expected = "{\"sms_transactional_status\":\"opt-in\"}"; @@ -134,6 +134,54 @@ public void testSetSmsTransactionalStatus() { assertEquals(expected, result); } + public void testSetSmsMarketingStatusTypeStop() { + user.setSmsMarketingStatus(User.OptOutType.OPT_OUT_TYPE_STOP); + + String expected = "{\"sms_marketing_status\":\"opt-out\"}"; + String result = gson.toJson(user); + assertEquals(expected, result); + } + + public void testSetSmsTransactionalStatusTypeStop() { + user.setSmsTransactionalStatus(User.OptOutType.OPT_OUT_TYPE_STOP); + + String expected = "{\"sms_transactional_status\":\"opt-out\"}"; + String result = gson.toJson(user); + assertEquals(expected, result); + } + + public void testSetSmsMarketingStatusTypePending() { + user.setSmsMarketingStatus(User.OptOutType.OPT_OUT_TYPE_PENDING); + + String expected = "{\"sms_marketing_status\":\"pending\"}"; + String result = gson.toJson(user); + assertEquals(expected, result); + } + + public void testSetSmsTransactionalStatusTypePending() { + user.setSmsTransactionalStatus(User.OptOutType.OPT_OUT_TYPE_PENDING); + + String expected = "{\"sms_transactional_status\":\"pending\"}"; + String result = gson.toJson(user); + assertEquals(expected, result); + } + + public void testSetSmsMarketingStatusTypeDoubleOptIn() { + user.setSmsMarketingStatus(User.OptOutType.OPT_OUT_TYPE_DOUBLE_OPT_IN); + + String expected = "{\"sms_marketing_status\":\"double-opt-in\"}"; + String result = gson.toJson(user); + assertEquals(expected, result); + } + + public void testSetSmsTransactionalStatusTypeDoubleOptIn() { + user.setSmsTransactionalStatus(User.OptOutType.OPT_OUT_TYPE_DOUBLE_OPT_IN); + + String expected = "{\"sms_transactional_status\":\"double-opt-in\"}"; + String result = gson.toJson(user); + assertEquals(expected, result); + } + public void testSetLogin() { Map login = new HashMap(); login.put("ip", "123.456.789.0");