diff options
author | Renaud Allard <renaud@allard.it> | 2016-10-19 15:10:07 +0200 |
---|---|---|
committer | Renaud Allard <renaud@allard.it> | 2016-10-19 15:10:07 +0200 |
commit | e7a545ee8b6d03ab085896ac162da7ae12e5557d (patch) | |
tree | aff7b64dea5d480b6ed576822db2e4467cb508c9 /test/org | |
parent | bc40685dca74e5026d529456ee01e6a7627fb85e (diff) | |
download | trackermap-server-e7a545ee8b6d03ab085896ac162da7ae12e5557d.tar.gz trackermap-server-e7a545ee8b6d03ab085896ac162da7ae12e5557d.tar.bz2 trackermap-server-e7a545ee8b6d03ab085896ac162da7ae12e5557d.zip |
Log device uniqueId in filters logging
This combined with another commit to traccar-web makes it easier to
see which device has been filtered.
Diffstat (limited to 'test/org')
-rw-r--r-- | test/org/traccar/FilterHandlerTest.java | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/test/org/traccar/FilterHandlerTest.java b/test/org/traccar/FilterHandlerTest.java index bb7e69dc0..9c2ce416e 100644 --- a/test/org/traccar/FilterHandlerTest.java +++ b/test/org/traccar/FilterHandlerTest.java @@ -6,10 +6,46 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import org.junit.Before; import org.junit.Test; +import org.traccar.database.IdentityManager; import org.traccar.model.Position; +import org.traccar.model.Device; public class FilterHandlerTest { + 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; + } + + }); + } + private FilterHandler filtingHandler; private FilterHandler passingHandler; @@ -32,7 +68,7 @@ public class FilterHandlerTest { filtingHandler = null; passingHandler = null; } - + private Position createPosition( long deviceId, Date time, |