diff options
author | Abyss777 <abyss@fox5.ru> | 2017-05-19 16:31:55 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-05-19 16:31:55 +0500 |
commit | ab46ebf23066f91369b0d037f273bed1ea814d82 (patch) | |
tree | 5e7de0a5669fb22af0bd3d2b70a5847113d37f80 /test/org | |
parent | 9e758d437c048b954d224935664b76d6f6f8416c (diff) | |
download | traccar-server-ab46ebf23066f91369b0d037f273bed1ea814d82.tar.gz traccar-server-ab46ebf23066f91369b0d037f273bed1ea814d82.tar.bz2 traccar-server-ab46ebf23066f91369b0d037f273bed1ea814d82.zip |
Fixed optional values
Diffstat (limited to 'test/org')
-rw-r--r-- | test/org/traccar/ProtocolTest.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/test/org/traccar/ProtocolTest.java b/test/org/traccar/ProtocolTest.java index 94c5edb9f..c9d4ceeb2 100644 --- a/test/org/traccar/ProtocolTest.java +++ b/test/org/traccar/ProtocolTest.java @@ -197,9 +197,8 @@ public class ProtocolTest extends BaseTest { } 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); + int batteryLevel = ((Number) attributes.get(Position.KEY_BATTERY_LEVEL)).intValue(); + Assert.assertTrue(batteryLevel <= 100 && batteryLevel >= 0); } if (position.getNetwork() != null && position.getNetwork().getCellTowers() != null) { |