From 362fb75ec0ff6f6c615f07abde917cb55da4de5c Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 1 Aug 2015 11:56:39 +1200 Subject: Add specific other field setters --- test/org/traccar/protocol/Gps103ProtocolEncoderTest.java | 8 +------- test/org/traccar/protocol/TotemProtocolEncoderTest.java | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) (limited to 'test') diff --git a/test/org/traccar/protocol/Gps103ProtocolEncoderTest.java b/test/org/traccar/protocol/Gps103ProtocolEncoderTest.java index 1fd93ede4..9274c1a26 100644 --- a/test/org/traccar/protocol/Gps103ProtocolEncoderTest.java +++ b/test/org/traccar/protocol/Gps103ProtocolEncoderTest.java @@ -1,7 +1,5 @@ package org.traccar.protocol; -import java.util.HashMap; -import java.util.Map; import org.junit.Assert; import org.junit.Test; import org.traccar.model.Command; @@ -16,11 +14,7 @@ public class Gps103ProtocolEncoderTest { Command command = new Command(); command.setDeviceId(1); command.setType(Command.TYPE_POSITION_PERIODIC); - - Map other = new HashMap<>(); - other.put(Command.KEY_FREQUENCY, 300l); - - command.setOther(other); + command.set(Command.KEY_FREQUENCY, 300); Assert.assertEquals("**,imei:123456789012345,C,05m;", encoder.encodeCommand(command)); diff --git a/test/org/traccar/protocol/TotemProtocolEncoderTest.java b/test/org/traccar/protocol/TotemProtocolEncoderTest.java index ce5574bb1..840165070 100644 --- a/test/org/traccar/protocol/TotemProtocolEncoderTest.java +++ b/test/org/traccar/protocol/TotemProtocolEncoderTest.java @@ -15,8 +15,6 @@ */ package org.traccar.protocol; -import java.util.HashMap; -import java.util.Map; import org.junit.Assert; import org.junit.Test; import org.traccar.model.Command; @@ -30,11 +28,7 @@ public class TotemProtocolEncoderTest { Command command = new Command(); command.setDeviceId(2); command.setType(Command.TYPE_ENGINE_STOP); - - Map other = new HashMap<>(); - other.put(Command.KEY_DEVICE_PASSWORD, "000000"); - - command.setOther(other); + command.set(Command.KEY_DEVICE_PASSWORD, "000000"); Assert.assertEquals("*000000,025,C,1#", encoder.encodeCommand(command)); -- cgit v1.2.3