diff options
author | Abyss777 <abyss@fox5.ru> | 2017-07-12 14:22:03 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-07-12 15:20:07 +0500 |
commit | b19f1a505f7088ff48f467b32b5f1c207aa3be01 (patch) | |
tree | 663ef14ec15af04e5d9062c2185cd020fb5b9e42 /test/org/traccar/processing/PopulateDriverTest.java | |
parent | 4f3830d844dd0542e9e7b09e7a6c17ffbb796264 (diff) | |
download | trackermap-server-b19f1a505f7088ff48f467b32b5f1c207aa3be01.tar.gz trackermap-server-b19f1a505f7088ff48f467b32b5f1c207aa3be01.tar.bz2 trackermap-server-b19f1a505f7088ff48f467b32b5f1c207aa3be01.zip |
- Handle rfid attributes and populate driverUniqueId
- Add Driver Name to Trip report
Diffstat (limited to 'test/org/traccar/processing/PopulateDriverTest.java')
-rw-r--r-- | test/org/traccar/processing/PopulateDriverTest.java | 21 |
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)); + } +} |