aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/traccar/protocol/Minifinder2ProtocolEncoderTest.java
blob: 32c8a9ce68d0465c8689ab012e4653d4134d2dc1 (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
28
package org.traccar.protocol;

import org.junit.jupiter.api.Test;
import org.traccar.ProtocolTest;
import org.traccar.model.Command;
import org.traccar.model.Device;

import static org.mockito.Mockito.when;

public class Minifinder2ProtocolEncoderTest extends ProtocolTest {

    @Test
    public void testEncodeNano() throws Exception {

        var encoder = inject(new Minifinder2ProtocolEncoder(null));

        encoder.setModelOverride("Nano");

        Command command = new Command();
        command.setDeviceId(1);
        command.setType(Command.TYPE_FIRMWARE_UPDATE);
        command.set(Command.KEY_DATA, "https://example.com");

        verifyCommand(encoder, command, binary("ab00160059d2010004143068747470733a2f2f6578616d706c652e636f6d"));

    }

}