aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/EventHandlerTest.java
blob: 423a5084fcce5738b2a45f3892e35563daf0ae46 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package org.traccar;

import org.traccar.database.IdentityManager;
import org.traccar.model.Device;
import org.traccar.model.Position;

public class EventHandlerTest {
    
    static {
        Context.init(new IdentityManager() {

            private Device createDevice() {
                Device device = new Device();
                device.setId(1);
                device.setName("test");
                device.setUniqueId("123456789012345");
                return device;
            }

            @Override
            public Device getDeviceById(long id) {
                return createDevice();
            }

            @Override
            public Device getDeviceByUniqueId(String uniqueId) {
                return createDevice();
            }
            
            @Override
            public Position getLastPosition(long deviceId) {
                return null;
            }
            
            @Override
            public boolean isLatestPosition(Position position) {
                return true;
            }

        });
    }

}