diff options
Diffstat (limited to 'test/org/traccar/helper/DecoderVerifier.java')
-rw-r--r-- | test/org/traccar/helper/DecoderVerifier.java | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/test/org/traccar/helper/DecoderVerifier.java b/test/org/traccar/helper/DecoderVerifier.java index 17b4f9633..28220b711 100644 --- a/test/org/traccar/helper/DecoderVerifier.java +++ b/test/org/traccar/helper/DecoderVerifier.java @@ -2,7 +2,10 @@ package org.traccar.helper; import java.util.Date; import java.util.List; -import static org.junit.Assert.*; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import org.traccar.model.Data; import org.traccar.model.Position; public class DecoderVerifier { @@ -40,6 +43,14 @@ public class DecoderVerifier { assertNotNull(position.getAttributes()); } + + private static void verifyData(Data data) { + + assertNotNull(data.getDeviceId()); + + assertNotNull(data.getAttributes()); + + } public static void verify(Object object) { @@ -47,13 +58,19 @@ public class DecoderVerifier { if (object instanceof Position) { verifyPosition((Position) object); + } else if (object instanceof Data) { + verifyData((Data) object); } else if (object instanceof List) { - List<Position> positions = (List<Position>) object; + List positions = (List) object; assertFalse(positions.isEmpty()); - for (Position position : positions) { - verifyPosition(position); + for (Object item : positions) { + if (item instanceof Position) { + verifyPosition((Position) item); + } else if (item instanceof Data) { + verifyData((Data) item); + } } } |