aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/traccar/calendar
diff options
context:
space:
mode:
authorAaron Donnelly <126603683+Aaron-Donnelly@users.noreply.github.com>2023-05-03 14:27:45 +0100
committerGitHub <noreply@github.com>2023-05-03 14:27:45 +0100
commit442806299eb328b5b41882d04c3dd65650715647 (patch)
treece471e548ade4a971ce1569ffa07661b49533e57 /src/test/java/org/traccar/calendar
parentbeb43ba371de5862a7ca6579daef20c8ffd83f2d (diff)
parentbb6964f03867d039a547c103cd16390f78688022 (diff)
downloadtrackermap-server-442806299eb328b5b41882d04c3dd65650715647.tar.gz
trackermap-server-442806299eb328b5b41882d04c3dd65650715647.tar.bz2
trackermap-server-442806299eb328b5b41882d04c3dd65650715647.zip
Merge branch 'traccar:master' into Teltonika-io30-faultCount
Diffstat (limited to 'src/test/java/org/traccar/calendar')
-rw-r--r--src/test/java/org/traccar/calendar/CalendarTest.java15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/test/java/org/traccar/calendar/CalendarTest.java b/src/test/java/org/traccar/calendar/CalendarTest.java
index 6f4b30370..4106f89a9 100644
--- a/src/test/java/org/traccar/calendar/CalendarTest.java
+++ b/src/test/java/org/traccar/calendar/CalendarTest.java
@@ -11,6 +11,7 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
+import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class CalendarTest {
@@ -45,14 +46,12 @@ public class CalendarTest {
calendar.setData(calendarString.getBytes());
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ssX");
- Date date = format.parse("2016-12-13 22:59:59+05");
- assertTrue(!calendar.checkMoment(date));
- date = format.parse("2016-12-13 23:00:01+05");
- assertTrue(calendar.checkMoment(date));
+ assertFalse(calendar.checkMoment(format.parse("2016-12-13 22:59:59+05")));
+ assertTrue(calendar.checkMoment(format.parse("2016-12-13 23:00:01+05")));
+ assertTrue(calendar.checkMoment(format.parse("2016-12-13 06:59:59+05")));
+ assertFalse(calendar.checkMoment(format.parse("2016-12-13 07:00:01+05")));
- date = format.parse("2016-12-13 06:59:59+05");
- assertTrue(calendar.checkMoment(date));
- date = format.parse("2016-12-13 07:00:01+05");
- assertTrue(!calendar.checkMoment(date));
+ var periods = calendar.findPeriods(format.parse("2016-12-13 06:59:59+05"));
+ assertFalse(periods.isEmpty());
}
}