aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/processing
diff options
context:
space:
mode:
Diffstat (limited to 'test/org/traccar/processing')
-rw-r--r--test/org/traccar/processing/PopulateDriverTest.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/org/traccar/processing/PopulateDriverTest.java b/test/org/traccar/processing/PopulateDriverTest.java
new file mode 100644
index 000000000..7c6ee9f06
--- /dev/null
+++ b/test/org/traccar/processing/PopulateDriverTest.java
@@ -0,0 +1,21 @@
+package org.traccar.processing;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.traccar.model.Position;
+
+public class PopulateDriverTest {
+
+ @Test
+ public void testPopulateDriver() {
+ Position position = new Position();
+ PopulateDriverHandler populateDriverHandler = new PopulateDriverHandler();
+ Assert.assertNull(populateDriverHandler.handlePosition(position).getString(Position.KEY_DRIVER_UNIQUE_ID));
+ position.set(Position.KEY_DRIVER_UNIQUE_ID, "123");
+ Assert.assertEquals("123",
+ populateDriverHandler.handlePosition(position).getString(Position.KEY_DRIVER_UNIQUE_ID));
+ position.set(Position.KEY_RFID, "321");
+ Assert.assertEquals("321",
+ populateDriverHandler.handlePosition(position).getString(Position.KEY_DRIVER_UNIQUE_ID));
+ }
+}