diff options
Diffstat (limited to 'test/org/traccar/ProtocolTest.java')
-rw-r--r-- | test/org/traccar/ProtocolTest.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/org/traccar/ProtocolTest.java b/test/org/traccar/ProtocolTest.java index 1725e31be..94c5edb9f 100644 --- a/test/org/traccar/ProtocolTest.java +++ b/test/org/traccar/ProtocolTest.java @@ -192,6 +192,16 @@ public class ProtocolTest extends BaseTest { Assert.assertTrue(attributes.get(Position.KEY_FUEL_LEVEL) instanceof Number); } + if (attributes.containsKey(Position.KEY_BATTERY)) { + Assert.assertTrue(attributes.get(Position.KEY_BATTERY) instanceof Number); + } + + if (attributes.containsKey(Position.KEY_BATTERY_LEVEL)) { + Object batteryLevel = attributes.get(Position.KEY_BATTERY_LEVEL); + Assert.assertTrue(batteryLevel instanceof Number); + Assert.assertTrue(((Number) batteryLevel).intValue() <=100 && ((Number) batteryLevel).intValue() >= 0); + } + if (position.getNetwork() != null && position.getNetwork().getCellTowers() != null) { for (CellTower cellTower : position.getNetwork().getCellTowers()) { checkInteger(cellTower.getMobileCountryCode(), 0, 999); |