blob: ef6ff6dd9f56a6a9d96e1c6062a1bbf63c2bbbf1 (
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
29
|
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));
var device = encoder.getCacheManager().getObject(Device.class, 1);
when(device.getModel()).thenReturn("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"));
}
}
|