diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/sms/SenderIdSupplier.java b/service/src/main/java/org/whispersystems/textsecuregcm/sms/SenderIdSupplier.java index 479f89284..a6aa75565 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/sms/SenderIdSupplier.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/sms/SenderIdSupplier.java @@ -37,12 +37,11 @@ class SenderIdSupplier { } Optional get(@NotNull String destination) { - /* final String countryCode = Util.getCountryCode(destination); + final String countryCode = Util.getCountryCode(destination); if (countryCodesWithoutSenderId.contains(countryCode)) { return Optional.empty(); } - return Optional.ofNullable(StringUtils.stripToNull(countrySpecificSenderIds.getOrDefault(countryCode, defaultSenderId))); */ - return Optional.empty(); + return Optional.ofNullable(StringUtils.stripToNull(countrySpecificSenderIds.getOrDefault(countryCode, defaultSenderId))); } } diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/tests/sms/TwilioSmsSenderTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/tests/sms/TwilioSmsSenderTest.java index 0fbb4761d..d551e436b 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/tests/sms/TwilioSmsSenderTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/tests/sms/TwilioSmsSenderTest.java @@ -6,7 +6,6 @@ package org.whispersystems.textsecuregcm.tests.sms; import com.github.tomakehurst.wiremock.junit.WireMockRule; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.whispersystems.textsecuregcm.configuration.TwilioConfiguration; @@ -215,7 +214,6 @@ public class TwilioSmsSenderTest { .withRequestBody(equalTo(expectedRequestBody))); } - @Ignore @Test public void testSendAlphaIdByCountryCode() { runSenderIdTest("+85278675309", "SIGNAL", () -> { @@ -228,7 +226,6 @@ public class TwilioSmsSenderTest { }); } - @Ignore @Test public void testDefaultSenderId() { runSenderIdTest("+14098675309", "SIGNALFOO", () -> { @@ -238,7 +235,6 @@ public class TwilioSmsSenderTest { }); } - @Ignore @Test public void testDefaultSenderIdWithDisabledCountry() { final Supplier senderIdConfigurationSupplier = () -> { @@ -251,7 +247,6 @@ public class TwilioSmsSenderTest { runSenderIdTest("+447911123456", "SIGNALBAR", senderIdConfigurationSupplier); } - @Ignore @Test public void testDefaultSenderIdWithOverriddenCountry() { final Supplier senderIdConfigurationSupplier = () -> { @@ -267,7 +262,6 @@ public class TwilioSmsSenderTest { runSenderIdTest("+6433456789", "JUSTREADTHEINSTRUCTIONS", senderIdConfigurationSupplier); } - @Ignore @Test public void testSenderIdWithAllFieldsPopulated() { final Supplier senderIdConfigurationSupplier = () -> { @@ -310,7 +304,6 @@ public class TwilioSmsSenderTest { .withRequestBody(equalTo("MessagingServiceSid=test_messaging_services_id&To=%2B14153333333&Body=%3C%23%3E+Verify+on+AndroidNg%3A+123-456%0A%0Acharacters"))); } - @Ignore @Test public void testRetrySmsOnUnreachableErrorCodeSkipsSenderIdSecondTime() { wireMockRule.stubFor(post(urlEqualTo("/2010-04-01/Accounts/" + ACCOUNT_ID + "/Messages.json"))