AndrewJSchofield commented on code in PR #18611:
URL: https://github.com/apache/kafka/pull/18611#discussion_r2333529829


##########
connect/api/src/test/java/org/apache/kafka/connect/data/ValuesTest.java:
##########
@@ -901,8 +903,10 @@ public void shouldConvertDateValues() {
         assertEquals(currentDate, d2);
 
         // ISO8601 strings - accept a string matching pattern "yyyy-MM-dd"
+        LocalDateTime localTimeTruncated = 
localTime.truncatedTo(ChronoUnit.DAYS);
         java.util.Date d3 = Values.convertToDate(Date.SCHEMA, 
LocalDate.ofEpochDay(days).format(DateTimeFormatter.ISO_LOCAL_DATE));

Review Comment:
   Were you thinking something like this?
   
   ```
           java.util.Date d3 = Values.convertToDate(Date.SCHEMA, 
localTime.format(DateTimeFormatter.ISO_LOCAL_DATE));
           LocalDateTime date3 = 
LocalDateTime.ofInstant(Instant.ofEpochMilli(d3.getTime()), 
ZoneId.systemDefault());
           LocalDateTime localTimeTruncated = 
localTime.truncatedTo(ChronoUnit.DAYS);
           assertEquals(localTimeTruncated, date3);
   ```



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