diff options
author | wkhaksar <31837615+wkhaksar@users.noreply.github.com> | 2022-06-29 09:02:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-29 09:02:59 +0200 |
commit | 8032eb77ae55a4814c523131ad1aaba9a7556056 (patch) | |
tree | b24be396a3bc7f323224e04661dbbde906a55573 | |
parent | 7899f1ffbb0e00243d2b4cf72ffe9bc59bb920bc (diff) | |
download | trackermap-server-8032eb77ae55a4814c523131ad1aaba9a7556056.tar.gz trackermap-server-8032eb77ae55a4814c523131ad1aaba9a7556056.tar.bz2 trackermap-server-8032eb77ae55a4814c523131ad1aaba9a7556056.zip |
test assertion for mac address with zero value
-rw-r--r-- | src/test/java/org/traccar/ProtocolTest.java | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/test/java/org/traccar/ProtocolTest.java b/src/test/java/org/traccar/ProtocolTest.java index 353593c29..3e27bbe28 100644 --- a/src/test/java/org/traccar/ProtocolTest.java +++ b/src/test/java/org/traccar/ProtocolTest.java @@ -14,6 +14,7 @@ import org.traccar.helper.DataConverter; import org.traccar.model.CellTower; import org.traccar.model.Command; import org.traccar.model.Position; +import org.traccar.model.WifiAccessPoint; import java.nio.charset.StandardCharsets; import java.text.DateFormat; @@ -310,12 +311,20 @@ public class ProtocolTest extends BaseTest { assertTrue(attributes.get(Position.KEY_RESULT) instanceof String); } - if (position.getNetwork() != null && position.getNetwork().getCellTowers() != null) { - for (CellTower cellTower : position.getNetwork().getCellTowers()) { - checkInteger(cellTower.getMobileCountryCode(), 0, 999); - checkInteger(cellTower.getMobileNetworkCode(), 0, 999); - checkInteger(cellTower.getLocationAreaCode(), 1, 65535); - checkInteger(cellTower.getCellId(), 0, 268435455); + if (position.getNetwork() != null) { + if (position.getNetwork().getCellTowers() != null) { + for (CellTower cellTower : position.getNetwork().getCellTowers()) { + checkInteger(cellTower.getMobileCountryCode(), 0, 999); + checkInteger(cellTower.getMobileNetworkCode(), 0, 999); + checkInteger(cellTower.getLocationAreaCode(), 1, 65535); + checkInteger(cellTower.getCellId(), 0, 268435455); + } + } + + if (position.getNetwork().getWifiAccessPoints() != null) { + for (WifiAccessPoint wifiAccessPoint : position.getNetwork().getWifiAccessPoints()) { + assertTrue("validation failed for mac address with zero value", !wifiAccessPoint.getMacAddress().equals("0")); + } } } |