mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-21 18:38:05 +01:00
Migrate VoiceVerificationController to Util#findBestLocale
This commit is contained in:
@@ -5,7 +5,15 @@
|
||||
|
||||
package org.whispersystems.textsecuregcm.tests.controllers;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import io.dropwizard.auth.PolymorphicAuthValueFactoryProvider;
|
||||
import io.dropwizard.testing.FixtureHelpers;
|
||||
import io.dropwizard.testing.junit.ResourceTestRule;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import javax.ws.rs.core.Response;
|
||||
import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
@@ -16,15 +24,6 @@ import org.whispersystems.textsecuregcm.storage.Account;
|
||||
import org.whispersystems.textsecuregcm.tests.util.AuthHelper;
|
||||
import org.whispersystems.textsecuregcm.util.SystemMapper;
|
||||
|
||||
import javax.ws.rs.core.Response;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
|
||||
import io.dropwizard.auth.PolymorphicAuthValueFactoryProvider;
|
||||
import io.dropwizard.testing.FixtureHelpers;
|
||||
import io.dropwizard.testing.junit.ResourceTestRule;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class VoiceVerificationControllerTest {
|
||||
|
||||
@Rule
|
||||
@@ -125,7 +124,18 @@ public class VoiceVerificationControllerTest {
|
||||
.post(null);
|
||||
|
||||
assertThat(response.getStatus()).isEqualTo(400);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTwimlMalformedLocale() {
|
||||
Response response =
|
||||
resources.getJerseyTest()
|
||||
.target("/v1/voice/description/123456")
|
||||
.queryParam("l", "it IT ,")
|
||||
.request()
|
||||
.post(null);
|
||||
|
||||
assertThat(response.getStatus()).isEqualTo(400);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user