diff options
author | Anton Tananaev <atananaev@lyft.com> | 2020-12-29 10:46:33 -0800 |
---|---|---|
committer | Anton Tananaev <atananaev@lyft.com> | 2020-12-29 10:46:33 -0800 |
commit | 20c24364739c794f3c005c1e070247e9bb6573f3 (patch) | |
tree | a37457c0e3869396f8bfb1aae172419d99267364 /src | |
parent | 2a61abfed15c12893290ee1d217103744f2697a6 (diff) | |
download | trackermap-server-20c24364739c794f3c005c1e070247e9bb6573f3.tar.gz trackermap-server-20c24364739c794f3c005c1e070247e9bb6573f3.tar.bz2 trackermap-server-20c24364739c794f3c005c1e070247e9bb6573f3.zip |
Fix tests
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/traccar/protocol/IotmProtocolDecoder.java | 4 | ||||
-rw-r--r-- | src/test/java/org/traccar/protocol/IotmProtocolDecoderTest.java | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/protocol/IotmProtocolDecoder.java b/src/main/java/org/traccar/protocol/IotmProtocolDecoder.java index 0c8954ae9..ac92b299f 100644 --- a/src/main/java/org/traccar/protocol/IotmProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/IotmProtocolDecoder.java @@ -117,10 +117,10 @@ public class IotmProtocolDecoder extends BaseProtocolDecoder { } else if (msg instanceof MqttSubscribeMessage) { - MqttPublishMessage message = (MqttPublishMessage) msg; + MqttSubscribeMessage message = (MqttSubscribeMessage) msg; MqttMessage response = MqttMessageBuilders.subAck() - .packetId((short) message.variableHeader().packetId()) + .packetId((short) message.variableHeader().messageId()) .build(); if (channel != null) { diff --git a/src/test/java/org/traccar/protocol/IotmProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/IotmProtocolDecoderTest.java index 1c783b355..9647b3723 100644 --- a/src/test/java/org/traccar/protocol/IotmProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/IotmProtocolDecoderTest.java @@ -16,10 +16,10 @@ public class IotmProtocolDecoderTest extends ProtocolTest { "123456789012345").build()); verifyPositions(decoder, false, MqttMessageBuilders.publish().payload(binary( - "020208009188752DE7120300013A002000AD59050030B135030340030C300301A00302A00E00D0B9AB5B420334C04100001F060000320004072064008C000162002000C004476F6F440109002100AD59050030BA359B")).qos(MqttQoS.EXACTLY_ONCE).build()); + "020208009188752DE7120300013A002000AD59050030B135030340030C300301A00302A00E00D0B9AB5B420334C04100001F060000320004072064008C000162002000C004476F6F440109002100AD59050030BA359B")).qos(MqttQoS.EXACTLY_ONCE).messageId(1).build()); verifyPositions(decoder, false, MqttMessageBuilders.publish().payload(binary( - "020208009188752DE71203000109002000AD590500309635F3")).qos(MqttQoS.EXACTLY_ONCE).build()); + "020208009188752DE71203000109002000AD590500309635F3")).qos(MqttQoS.EXACTLY_ONCE).messageId(1).build()); } |