blob: 41568d0c1af99e63c99449577ebcd0422978cbb1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
package org.traccar.protocol;
import io.netty.handler.codec.mqtt.MqttMessageBuilders;
import io.netty.handler.codec.mqtt.MqttQoS;
import org.junit.jupiter.api.Test;
import org.traccar.ProtocolTest;
public class PuiProtocolDecoderTest extends ProtocolTest {
@Test
public void testDecode() throws Exception {
var decoder = inject(new PuiProtocolDecoder(null));
verifyNull(decoder, MqttMessageBuilders.connect().clientId(
"123456789012345").build());
verifyPosition(decoder, MqttMessageBuilders.publish().payload(buffer(
"{ \"id\": \"015262001044848\", \"ts\": \"20190109T021918.312Z\", \"rpt\": \"hf\", \"location\": { \"lat\": 33.91233, \"lon\": -84.20784 }, \"bear\": 70, \"spd\": 2482, \"ign\": \"on\" }")).qos(MqttQoS.EXACTLY_ONCE).messageId(1).build());
}
}
|