diff options
Diffstat (limited to 'src/test/java/org/traccar/handler/events')
-rw-r--r-- | src/test/java/org/traccar/handler/events/AlertEventHandlerTest.java | 6 | ||||
-rw-r--r-- | src/test/java/org/traccar/handler/events/IgnitionEventHandlerTest.java | 5 |
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); |