Github user ashutakGG commented on a diff in the pull request:
https://github.com/apache/incubator-griffin/pull/435#discussion_r224461713
--- Diff:
service/src/test/java/org/apache/griffin/core/util/TimeUtilTest.java ---
@@ -110,4 +111,36 @@ public void testFormatWithIllegalException() {
TimeUtil.format(format, time, TimeZone.getTimeZone(timeZone));
}
+ @Test
+ public void testGetTimeZone() {
+ HashMap<String, String> tests = new HashMap<>();
+ tests.put("", TimeZone.getDefault().getID());
+ // standard cases
+ tests.put("GMT", "GMT");
+ tests.put("GMT+1", "GMT+01:00");
+ tests.put("GMT+1:00", "GMT+01:00");
+ tests.put("GMT+01:00", "GMT+01:00");
+ tests.put("GMT-1", "GMT-01:00");
+ tests.put("GMT-1:00", "GMT-01:00");
+ tests.put("GMT-01:00", "GMT-01:00");
+ // values pushed by UI for jobs
+ tests.put("GMT1", "GMT");
+ tests.put("GMT1:00", "GMT");
+ tests.put("GMT01:00", "GMT");
+ // values generated by UI for datasets in a past
+ tests.put("UTC1", "GMT");
+ tests.put("UTC1:00", "GMT");
+ tests.put("UTC01:00", "GMT");
+ tests.put("UTC-1", "GMT");
+ tests.put("UTC-1:00", "GMT");
+ tests.put("UTC-01:00", "GMT");
+ for (HashMap.Entry<String, String> e: tests.entrySet()) {
--- End diff --
Consider
```
tests.entrySet().forEach(e -> {...}
```
as an option.
---