FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: Date test in another Locale by sakebook · Pull Request #327 · firebase/firebase-admin-java · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .java  (3) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;

/**
Expand Down Expand Up @@ -57,9 +58,9 @@ final class DateUtils {
static final String PATTERN_ASCTIME = "EEE MMM d HH:mm:ss yyyy";

private static final SimpleDateFormat[] DEFAULT_PATTERNS = new SimpleDateFormat[] {
new SimpleDateFormat(PATTERN_RFC1123),
new SimpleDateFormat(PATTERN_RFC1036),
new SimpleDateFormat(PATTERN_ASCTIME)
new SimpleDateFormat(PATTERN_RFC1123, Locale.US),
new SimpleDateFormat(PATTERN_RFC1036, Locale.US),
new SimpleDateFormat(PATTERN_ASCTIME, Locale.US)
};

static final TimeZone GMT = TimeZone.getTimeZone("GMT");
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.TimeZone;

import org.junit.Test;

public class RetryUnsuccessfulResponseHandlerTest {
Expand Down Expand Up @@ -137,7 +139,8 @@ public void testRetryAfterGivenAsSeconds() throws IOException {

@Test
public void testRetryAfterGivenAsDate() throws IOException {
SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz");
SimpleDateFormat dateFormat =
new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US);
dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
Date date = new Date(1000);
Clock clock = new FixedClock(date.getTime());
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import org.junit.Test;
Expand Down Expand Up @@ -769,7 +770,7 @@ public void testImageInAndroidNotification() throws IOException {
assertJsonEquals(ImmutableMap.of(
"topic", "test-topic", "notification", notification, "android", androidConfig), message);
}

@Test
public void testImageInApnsNotification() throws IOException {
Message message = Message.builder()
Expand Down Expand Up @@ -799,7 +800,7 @@ public void testImageInApnsNotification() throws IOException {
.build();
assertJsonEquals(expected, message);
}

@Test
public void testInvalidColorInAndroidNotificationLightSettings() throws IOException {
try {
Expand All @@ -814,7 +815,7 @@ public void testInvalidColorInAndroidNotificationLightSettings() throws IOExcept
// expected
}
}

@Test
public void testExtendedAndroidNotificationParameters() throws IOException {
long[] vibrateTimings = {1000L, 1001L};
Expand Down Expand Up @@ -848,7 +849,7 @@ public void testExtendedAndroidNotificationParameters() throws IOException {
.put("title", "title")
.put("body", "body")
.build();
String eventTime = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS'Z'")
String eventTime = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS'Z'", Locale.US)
.format(new Date(1546304523123L));
Map<String, Object> androidConfig = ImmutableMap.<String, Object>builder()
.put("notification", ImmutableMap.<String, Object>builder()
Expand Down

Back | FazBrowse Home | New Git URL