aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/traccar/handler/MotionHandlerTest.java
blob: fdbd48334b50091af2bdec167c3d8c4248905f7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package org.traccar.handler;

import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.*;

import org.junit.Test;
import org.traccar.model.Position;
import org.traccar.reports.model.TripsConfig;

public class MotionHandlerTest {

    @Test
    public void testCalculateMotion() {

        TripsConfig tripsConfig = mock(TripsConfig.class);
        when(tripsConfig.getSpeedThreshold()).thenReturn(0.01);

        MotionHandler motionHandler = new MotionHandler(tripsConfig);

        Position position = motionHandler.handlePosition(new Position());

        assertEquals(false, position.getAttributes().get(Position.KEY_MOTION));

    }

}