Skip to content

Commit

Permalink
use system default timezone for unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasMLK committed Aug 29, 2023
1 parent 7985013 commit 3357588
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/test/java/io/xdag/cli/CommandsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,12 @@ public void testPrintBlockInfo() {
BlockInfo blockInfo = new BlockInfo();
blockInfo.setDifficulty(BigInteger.ZERO);

long time = XdagTime.xdagTimestampToMs(blockInfo.getTimestamp());
String st = FastDateFormat.getInstance("yyyy-MM-dd HH:mm:ss.SSS", TimeZone.getDefault()).format(time);
mainblock.setInfo(blockInfo);
String str = commands.printBlockInfo(mainblock, false);
assertEquals("""
time: 1970-01-01 08:00:00.000
assertEquals(String.format("""
time: %s
timestamp: 0
flags: 0
state: Pending
Expand All @@ -237,7 +239,7 @@ public void testPrintBlockInfo() {
block as address: details
direction address amount time
""", str);
""", st), str);
}

@Test
Expand Down

0 comments on commit 3357588

Please sign in to comment.