From 2cd7e378fd1414c04276d943c4310ea8bcc38725 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 16 Aug 2020 17:47:52 -0700 Subject: Minor code cleanup --- src/main/java/org/traccar/protocol/SpotProtocolDecoder.java | 6 +++--- src/test/java/org/traccar/protocol/SigfoxProtocolDecoderTest.java | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/main/java/org/traccar/protocol/SpotProtocolDecoder.java b/src/main/java/org/traccar/protocol/SpotProtocolDecoder.java index da36c2048..34417d95f 100644 --- a/src/main/java/org/traccar/protocol/SpotProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/SpotProtocolDecoder.java @@ -42,9 +42,9 @@ import java.util.List; public class SpotProtocolDecoder extends BaseHttpProtocolDecoder { - private DocumentBuilder documentBuilder; - private XPath xPath; - private XPathExpression messageExpression; + private final DocumentBuilder documentBuilder; + private final XPath xPath; + private final XPathExpression messageExpression; public SpotProtocolDecoder(Protocol protocol) { super(protocol); diff --git a/src/test/java/org/traccar/protocol/SigfoxProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/SigfoxProtocolDecoderTest.java index 53f03730a..f31773e0c 100644 --- a/src/test/java/org/traccar/protocol/SigfoxProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/SigfoxProtocolDecoderTest.java @@ -12,7 +12,8 @@ public class SigfoxProtocolDecoderTest extends ProtocolTest { SigfoxProtocolDecoder decoder = new SigfoxProtocolDecoder(null); - verifyPosition(decoder, request(HttpMethod.POST, "/", buffer("{ \"device\":\"BFE47E\", \"time\":1590497040, \"data\":\"10297eb01e621122070000be\", \"seqNumber\":8, \"deviceTypeId\":\"5ecb8bfac563d620cc9e6798\", \"ack\":false }"))); + verifyPosition(decoder, request(HttpMethod.POST, "/", + buffer("{ \"device\":\"BFE47E\", \"time\":1590497040, \"data\":\"10297eb01e621122070000be\", \"seqNumber\":8, \"deviceTypeId\":\"5ecb8bfac563d620cc9e6798\", \"ack\":false }"))); verifyAttributes(decoder, request(HttpMethod.POST, "/", buffer("{\"messageType\":\"accelerometer\",\"deviceId\":\"testdev001\",\"snr\":\"1234\",\"rssi\":\"-120.00\",\"station\":\"5678\",\"seqNum\":\"9123\",\"newPosition\":false,\"latitude\":\"null\",\"longitude\":\"null\",\"positionTime\":\"null\",\"moving\":true,\"magChange\":\"true\",\"magStatus\":\"true\",\"temperature\":\"7.5\",\"battery\":\"null\",\"batteryPercentage\":\"null\",\"lastSeen\":\"1582560425\",\"fwVersion\":\"null\",\"dlConfig\":\"null\",\"recievedPayload\":\"cb020051\"}"))); -- cgit v1.2.3