aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/traccar/handler/MotionHandlerTest.java
diff options
context:
space:
mode:
authorcasswarry0 <casswarry0@gmail.com>2023-01-17 17:14:53 -0700
committercasswarry0 <casswarry0@gmail.com>2023-01-17 17:14:53 -0700
commit7338b8730949ed027b3f8b31d7dca20687ebbb8b (patch)
treec2d171e6121818ab511460a786f69aab97a2a628 /src/test/java/org/traccar/handler/MotionHandlerTest.java
parentcdecd3fa4427a382c0b09f8ad9d69ec14388960a (diff)
parent85501f9cf4918d5eee345f83aed7a31eecb26b8d (diff)
downloadtrackermap-server-7338b8730949ed027b3f8b31d7dca20687ebbb8b.tar.gz
trackermap-server-7338b8730949ed027b3f8b31d7dca20687ebbb8b.tar.bz2
trackermap-server-7338b8730949ed027b3f8b31d7dca20687ebbb8b.zip
Merge branch 'master' into develop
Diffstat (limited to 'src/test/java/org/traccar/handler/MotionHandlerTest.java')
-rw-r--r--src/test/java/org/traccar/handler/MotionHandlerTest.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/test/java/org/traccar/handler/MotionHandlerTest.java b/src/test/java/org/traccar/handler/MotionHandlerTest.java
index 9e0859664..93fd16206 100644
--- a/src/test/java/org/traccar/handler/MotionHandlerTest.java
+++ b/src/test/java/org/traccar/handler/MotionHandlerTest.java
@@ -1,16 +1,22 @@
package org.traccar.handler;
-import static org.junit.Assert.assertEquals;
-
import org.junit.Test;
import org.traccar.model.Position;
+import org.traccar.reports.common.TripsConfig;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
public class MotionHandlerTest {
@Test
public void testCalculateMotion() {
- MotionHandler motionHandler = new MotionHandler(0.01);
+ TripsConfig tripsConfig = mock(TripsConfig.class);
+ when(tripsConfig.getSpeedThreshold()).thenReturn(0.01);
+
+ MotionHandler motionHandler = new MotionHandler(tripsConfig);
Position position = motionHandler.handlePosition(new Position());