tanclary commented on code in PR #3609:
URL: https://github.com/apache/calcite/pull/3609#discussion_r1442023114


##########
core/src/test/java/org/apache/calcite/util/format/FormatElementEnumTest.java:
##########
@@ -28,150 +28,87 @@
  * Unit test for {@link FormatElementEnum}.
  */
 class FormatElementEnumTest {
+
   @Test void testDay() {
-    final String date = "2014-09-30T10:00:00Z";
-    StringBuilder ts = new StringBuilder();
-    FormatElementEnum.DAY.format(ts, Date.from(Instant.parse(date)));
-    assertThat(ts, hasToString("Tuesday"));
+    assertFormatElement(FormatElementEnum.DAY, "2014-09-30T10:00:00Z", 
"Tuesday");
   }
-
   @Test void testD() {
-    final String date = "2014-09-30T10:00:00Z";
-    StringBuilder ts = new StringBuilder();
-    FormatElementEnum.D.format(ts, Date.from(Instant.parse(date)));
-    assertThat(ts, hasToString("3"));
+    assertFormatElement(FormatElementEnum.D, "2014-09-30T10:00:00Z", "3");
   }
-
   @Test void testDD() {
-    final String date = "2014-09-30T10:00:00Z";
-    StringBuilder ts = new StringBuilder();
-    FormatElementEnum.DD.format(ts, Date.from(Instant.parse(date)));
-    assertThat(ts, hasToString("30"));
+    assertFormatElement(FormatElementEnum.DD, "2014-09-30T10:00:00Z", "30");
   }
-
   @Test void testDDD() {
-    final String date = "2014-09-30T10:00:00Z";
-    StringBuilder ts = new StringBuilder();
-    FormatElementEnum.DDD.format(ts, Date.from(Instant.parse(date)));
-    assertThat(ts, hasToString("273"));
+    assertFormatElement(FormatElementEnum.DDD, "2014-09-30T10:00:00Z", "273");
   }
-
   @Test void testDY() {
-    final String date = "2014-09-30T10:00:00Z";
-    StringBuilder ts = new StringBuilder();
-    FormatElementEnum.DY.format(ts, Date.from(Instant.parse(date)));
-    assertThat(ts, hasToString("Tue"));
+    assertFormatElement(FormatElementEnum.DY, "2014-09-30T10:00:00Z", "Tue");
   }
-
   @Test void testFF1() {
-    final String date = "2014-09-30T10:00:00.123456Z";
-    StringBuilder ts = new StringBuilder();
-    FormatElementEnum.FF1.format(ts, Date.from(Instant.parse(date)));
-    assertThat(ts, hasToString("123"));
+    assertFormatElement(FormatElementEnum.FF1, "2014-09-30T10:00:00.123456Z", 
"123");
   }
-

Review Comment:
   I don't think we need to remove the line breaks between tests.



-- 
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]

Reply via email to