diff --git a/src/test/java/eu/m724/wtapi/twilight/MockTwilightTimeProvider.java b/src/test/java/eu/m724/wtapi/twilight/MockTwilightTimeProvider.java index 138b21b..dcb27e4 100644 --- a/src/test/java/eu/m724/wtapi/twilight/MockTwilightTimeProvider.java +++ b/src/test/java/eu/m724/wtapi/twilight/MockTwilightTimeProvider.java @@ -6,6 +6,8 @@ import eu.m724.wtapi.provider.twilight.TwilightTimeProvider; import java.time.Duration; import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; public class MockTwilightTimeProvider extends TwilightTimeProvider { @Override @@ -13,8 +15,8 @@ public class MockTwilightTimeProvider extends TwilightTimeProvider { int time = (int) (coordinates.latitude + coordinates.longitude); return new Twilight( date, - Duration.ofMinutes(-time), - Duration.ofMinutes(time) + date.atStartOfDay().plusSeconds(-time), + date.atStartOfDay().plusSeconds(time) ); } } diff --git a/src/test/java/eu/m724/wtapi/twilight/MockTwilightTimeTest.java b/src/test/java/eu/m724/wtapi/twilight/MockTwilightTimeTest.java index 48e3433..3141a36 100644 --- a/src/test/java/eu/m724/wtapi/twilight/MockTwilightTimeTest.java +++ b/src/test/java/eu/m724/wtapi/twilight/MockTwilightTimeTest.java @@ -17,7 +17,10 @@ public class MockTwilightTimeTest { Twilight twilight = provider.calculateTwilightTime(date, coordinates); assert twilight.date().equals(date); - assert twilight.sunrise().getSeconds() == -6840; - assert twilight.sunset().getSeconds() == 6840; + // this might make no sense but just a test remember + assert twilight.sunrise().getDayOfMonth() == 19; + assert twilight.sunrise().toLocalTime().toSecondOfDay() == 86286; + assert twilight.sunset().getDayOfMonth() == 20; + assert twilight.sunset().toLocalTime().toSecondOfDay() == 114; } }