aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/traccar/protocol/AdmFrameDecoderTest.java
blob: 02d42447e4eb5c12d4ad2fa0eec4d202c3593fed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package org.traccar.protocol;

import org.junit.Test;
import org.traccar.ProtocolTest;

public class AdmFrameDecoderTest extends ProtocolTest {

    @Test
    public void testDecode() throws Exception {

        var decoder = inject(new AdmFrameDecoder());

        verifyFrame(
                binary("38363931353330343235323337383400003728e000001402441d5f42c3711642930d000000c7000a461954f25fd82ed508000000000000000044000000010000000000140000"),
                decoder.decode(null, null, binary("38363931353330343235323337383400003728e000001402441d5f42c3711642930d000000c7000a461954f25fd82ed508000000000000000044000000010000000000140000")));

        verifyFrame(
                binary("000042033836393135333034323532333738340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000078"),
                decoder.decode(null, null, binary("000042033836393135333034323532333738340000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000078")));

        verifyFrame(
                binary("010022003300072020000000000000000044062A330000000000107F10565D4A8310"),
                decoder.decode(null, null, binary("010022003300072020000000000000000044062A330000000000107F10565D4A8310")));

    }

}