mirror of
https://github.com/aljazceru/lnd-manageJ.git
synced 2026-01-30 19:24:29 +01:00
test that zero seconds are included in output
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
package de.cotto.lndmanagej.controller.dto;
|
||||
|
||||
import de.cotto.lndmanagej.model.OnlineReport;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.time.ZoneOffset;
|
||||
import java.time.ZonedDateTime;
|
||||
|
||||
import static de.cotto.lndmanagej.model.OnlineReportFixtures.ONLINE_REPORT;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -21,4 +25,11 @@ class OnlineReportDtoTest {
|
||||
void since() {
|
||||
assertThat(OnlineReportDto.createFromModel(ONLINE_REPORT).since()).isEqualTo("2021-12-23T01:02:03Z");
|
||||
}
|
||||
|
||||
@Test
|
||||
void since_zero_seconds() {
|
||||
ZonedDateTime timeWithZeroSeconds = ZonedDateTime.of(2021, 12, 23, 1, 2, 0, 0, ZoneOffset.UTC);
|
||||
OnlineReport onlineReport = new OnlineReport(true, timeWithZeroSeconds, 77);
|
||||
assertThat(OnlineReportDto.createFromModel(onlineReport).since()).isEqualTo("2021-12-23T01:02:00Z");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user