Skip to content

Commit

Permalink
test(NotificationUtils): Add tests for getting Twilio locale.
Browse files Browse the repository at this point in the history
  • Loading branch information
binh-dam-ibigroup committed Nov 8, 2023
1 parent e241a45 commit e280eea
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package org.opentripplanner.middleware.utils;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import static org.opentripplanner.middleware.utils.NotificationUtils.getTwilioLocale;

/**
* Contains tests for the various notification utilities.
* Tests in this file do not require specific environment variables
* and do not contain end-to-end notification actions.
*/
class NotificationUtilsTest {
@Test
void canGetTwilioLocale() {
Assertions.assertEquals("en", getTwilioLocale("en"));
Assertions.assertEquals("en", getTwilioLocale("en-US"));
Assertions.assertEquals("en-GB", getTwilioLocale("en-GB"));
Assertions.assertEquals("fr", getTwilioLocale("fr-FR"));
Assertions.assertEquals("zh", getTwilioLocale("zh"));
Assertions.assertEquals("zh-HK", getTwilioLocale("zh-HK"));
Assertions.assertEquals("pt", getTwilioLocale("pt"));
Assertions.assertEquals("pt-BR", getTwilioLocale("pt-BR"));
}
}

0 comments on commit e280eea

Please sign in to comment.