aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/traccar/handler
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-05-30 14:59:09 -0700
committerAnton Tananaev <anton@traccar.org>2022-05-30 14:59:09 -0700
commit85f04c6d30e11d8b748ea2b431dbeffce1126a65 (patch)
treebef590914d97fb830cf5e15bfea15d021f182af3 /src/test/java/org/traccar/handler
parent0202dbf7258df8cbe8168ddc985e774b1cadf964 (diff)
downloadtrackermap-server-85f04c6d30e11d8b748ea2b431dbeffce1126a65.tar.gz
trackermap-server-85f04c6d30e11d8b748ea2b431dbeffce1126a65.tar.bz2
trackermap-server-85f04c6d30e11d8b748ea2b431dbeffce1126a65.zip
Remove test identity manager
Diffstat (limited to 'src/test/java/org/traccar/handler')
-rw-r--r--src/test/java/org/traccar/handler/events/AlertEventHandlerTest.java6
-rw-r--r--src/test/java/org/traccar/handler/events/IgnitionEventHandlerTest.java5
2 files changed, 7 insertions, 4 deletions
diff --git a/src/test/java/org/traccar/handler/events/AlertEventHandlerTest.java b/src/test/java/org/traccar/handler/events/AlertEventHandlerTest.java
index 3f0823245..4934695ad 100644
--- a/src/test/java/org/traccar/handler/events/AlertEventHandlerTest.java
+++ b/src/test/java/org/traccar/handler/events/AlertEventHandlerTest.java
@@ -2,13 +2,14 @@ package org.traccar.handler.events;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.mockito.Mockito.mock;
import java.util.Map;
import org.junit.Test;
import org.traccar.BaseTest;
-import org.traccar.TestIdentityManager;
import org.traccar.config.Config;
+import org.traccar.database.IdentityManager;
import org.traccar.model.Event;
import org.traccar.model.Position;
@@ -17,7 +18,7 @@ public class AlertEventHandlerTest extends BaseTest {
@Test
public void testAlertEventHandler() {
- AlertEventHandler alertEventHandler = new AlertEventHandler(new Config(), new TestIdentityManager());
+ AlertEventHandler alertEventHandler = new AlertEventHandler(new Config(), mock(IdentityManager.class));
Position position = new Position();
position.set(Position.KEY_ALARM, Position.ALARM_GENERAL);
@@ -25,6 +26,7 @@ public class AlertEventHandlerTest extends BaseTest {
assertNotNull(events);
Event event = events.keySet().iterator().next();
assertEquals(Event.TYPE_ALARM, event.getType());
+
}
}
diff --git a/src/test/java/org/traccar/handler/events/IgnitionEventHandlerTest.java b/src/test/java/org/traccar/handler/events/IgnitionEventHandlerTest.java
index dade20fb8..f568b6a74 100644
--- a/src/test/java/org/traccar/handler/events/IgnitionEventHandlerTest.java
+++ b/src/test/java/org/traccar/handler/events/IgnitionEventHandlerTest.java
@@ -1,12 +1,13 @@
package org.traccar.handler.events;
import static org.junit.Assert.assertNull;
+import static org.mockito.Mockito.mock;
import java.util.Map;
import org.junit.Test;
import org.traccar.BaseTest;
-import org.traccar.TestIdentityManager;
+import org.traccar.database.IdentityManager;
import org.traccar.model.Event;
import org.traccar.model.Position;
@@ -15,7 +16,7 @@ public class IgnitionEventHandlerTest extends BaseTest {
@Test
public void testIgnitionEventHandler() {
- IgnitionEventHandler ignitionEventHandler = new IgnitionEventHandler(new TestIdentityManager());
+ IgnitionEventHandler ignitionEventHandler = new IgnitionEventHandler(mock(IdentityManager.class));
Position position = new Position();
position.set(Position.KEY_IGNITION, true);