Skip to content

Commit

Permalink
fix: Enforce Locale.US for AwsRequestSignerTest (#1111)
Browse files Browse the repository at this point in the history
Date parsing can fail in other locales.

Specifically, in `en-CA` (Canada), the tests's defined date `Mon, 09 Sep 2011 23:36:00 GMT` won't
parse correctly, as the weekday short name for the locale is `Mon.` (extra period).
  • Loading branch information
jmahonin committed Dec 14, 2022
1 parent 977ee31 commit aeb1218
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import java.net.URI;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
Expand All @@ -64,6 +65,8 @@ public class AwsRequestSignerTest {

@Before
public void setUp() throws IOException {
// Required for date parsing when run in different Locales
Locale.setDefault(Locale.US);
awsSecurityCredentials = retrieveAwsSecurityCredentials();
}

Expand Down

0 comments on commit aeb1218

Please sign in to comment.