package org.traccar.protocol;
import io.netty.handler.codec.http.HttpMethod;
import org.junit.jupiter.api.Test;
import org.traccar.ProtocolTest;
public class GlobalstarProtocolDecoderTest extends ProtocolTest {
@Test
public void testDecode() throws Exception {
var decoder = inject(new GlobalstarProtocolDecoder(null));
decoder.setModelOverride("AtlasTrax");
verifyNull(decoder, request(HttpMethod.POST, "/", buffer(
"\n",
"\n",
"\n",
"0-4325340\n",
"1600220003\n",
"N\n",
"0x63FFFF1BB4FFFFFFFF\n",
"\n",
"")));
decoder.setModelOverride(null);
verifyPositions(decoder, request(HttpMethod.POST, "/", buffer(
"",
"",
"",
"0-2682225",
"1585105370",
"N",
"0x00C583EACD37210A00",
"",
"")));
verifyPositions(decoder, request(HttpMethod.POST, "/", buffer(
"",
"",
"",
"0-2654816",
"1550440592",
"N",
"0x00337BA619B7250A00",
"",
"")));
}
}