Skip to content

Commit

Permalink
apache#1366 - Added unit test for java.sql.Date
Browse files Browse the repository at this point in the history
  • Loading branch information
Hikarikun92 authored and theit committed May 30, 2023
1 parent 8d23cc6 commit abcb59b
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package org.apache.logging.log4j.message;

import java.math.BigDecimal;
import java.sql.Date;
import java.sql.Time;
import java.util.Arrays;
import java.util.Collections;
Expand Down Expand Up @@ -321,6 +322,14 @@ public void testTime() throws Exception {
message.getFormattedMessage(), "Incorrect time format");
}

@Test
public void testDate() {
final Date date = new Date(System.currentTimeMillis());
final ObjectMapMessage message = new ObjectMapMessage().with("date", date);
assertEquals("date=\"" + date + "\"",
message.getFormattedMessage(), "Incorrect date format");
}

private static final class FormattableTestType implements StringBuilderFormattable {

@Override
Expand Down

0 comments on commit abcb59b

Please sign in to comment.