nkuprins commented on PR #1033:
URL: https://github.com/apache/fesod/pull/1033#issuecomment-5641135657

   2 new methods were added to `DateUtils` by your last refactoring. However, 
no new tests for them were added to `DateUtilsTest`? Maybe we can add something 
like this to `DateUtilsTest`:
   
   ```java
   @Test
   void test_parseOffsetDateTime() {
       OffsetDateTime expected = OffsetDateTime.of(2020, 1, 2, 3, 4, 5, 0, 
ZoneOffset.ofHours(8));
       Assertions.assertEquals(expected, 
DateUtils.parseOffsetDateTime("2020-01-02T03:04:05+08:00", null, Locale.US));
       Assertions.assertEquals(expected, 
DateUtils.parseOffsetDateTime("2020-01-02T03:04:05+08:00", "", Locale.US));
       Assertions.assertEquals(
               expected,
               DateUtils.parseOffsetDateTime("02 Januar 2020 03:04:05 +08:00", 
"dd MMMM yyyy HH:mm:ss XXX", Locale.GERMAN));
       Assertions.assertThrows(
               DateTimeParseException.class,
               () -> DateUtils.parseOffsetDateTime("2020-01-02T03:04:05", null, 
Locale.US));
   }
   
   @Test
   void test_format_OffsetDateTime() {
       OffsetDateTime value = OffsetDateTime.of(2020, 1, 2, 3, 4, 5, 0, 
ZoneOffset.ofHours(8));
       Assertions.assertNull(DateUtils.format((OffsetDateTime) null, null, 
Locale.US));
       Assertions.assertEquals("2020-01-02T03:04:05+08:00", 
DateUtils.format(value, null, Locale.US));
       Assertions.assertEquals("2020-01-02T03:04:05+08:00", 
DateUtils.format(value, "", Locale.US));
       Assertions.assertEquals(
               "02 Januar 2020 03:04:05 +08:00", DateUtils.format(value, "dd 
MMMM yyyy HH:mm:ss XXX", Locale.GERMAN));
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to