From c5bfaf57bb0423c8e5af757c15abd3b3e729dce6 Mon Sep 17 00:00:00 2001 From: Jesse Hills Date: Thu, 1 Aug 2019 09:19:22 +1200 Subject: Add simple unit test --- .../protocol/LeafSpyProtocolDecoderTest.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/test/java/org/traccar/protocol/LeafSpyProtocolDecoderTest.java (limited to 'src/test/java/org/traccar/protocol') diff --git a/src/test/java/org/traccar/protocol/LeafSpyProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/LeafSpyProtocolDecoderTest.java new file mode 100644 index 000000000..7fe405ea8 --- /dev/null +++ b/src/test/java/org/traccar/protocol/LeafSpyProtocolDecoderTest.java @@ -0,0 +1,21 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; + +public class LeafSpyProtocolDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + LeafSpyProtocolDecoder decoder = new LeafSpyProtocolDecoder(null); + + verifyNull(decoder, request( + "/?Lat=60.0&Long=30.0")); + + verifyPosition(decoder, request( + "/?user=driver&pass=123456&DevBat=80&Gids=200&Lat=60.0&Long=30.0&Elv=5&Seq=50&Trip=1&Odo=10000&SOC=99.99&AHr=55.00&BatTemp=15.2&Amb=12.0&Wpr=12&PlugState=0&ChrgMode=0&ChrgPwr=0&VIN=ZE0-000000&PwrSw=1&Tunits=C&RPM=1000")); + + } + +} -- cgit v1.2.3