aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/ProtocolTest.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-05-19 16:31:55 +0500
committerAbyss777 <abyss@fox5.ru>2017-05-19 16:31:55 +0500
commitab46ebf23066f91369b0d037f273bed1ea814d82 (patch)
tree5e7de0a5669fb22af0bd3d2b70a5847113d37f80 /test/org/traccar/ProtocolTest.java
parent9e758d437c048b954d224935664b76d6f6f8416c (diff)
downloadtrackermap-server-ab46ebf23066f91369b0d037f273bed1ea814d82.tar.gz
trackermap-server-ab46ebf23066f91369b0d037f273bed1ea814d82.tar.bz2
trackermap-server-ab46ebf23066f91369b0d037f273bed1ea814d82.zip
Fixed optional values
Diffstat (limited to 'test/org/traccar/ProtocolTest.java')
-rw-r--r--test/org/traccar/ProtocolTest.java5
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) {