From 1ca95d099df96d576a0eaddc6e42b5b41aed3e06 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 22 Oct 2015 15:26:17 +1300 Subject: Refactor protocol unit testing --- test/org/traccar/protocol/Gt02ProtocolDecoderTest.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'test/org/traccar/protocol/Gt02ProtocolDecoderTest.java') diff --git a/test/org/traccar/protocol/Gt02ProtocolDecoderTest.java b/test/org/traccar/protocol/Gt02ProtocolDecoderTest.java index 17c557c69..76590fe3f 100644 --- a/test/org/traccar/protocol/Gt02ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Gt02ProtocolDecoderTest.java @@ -1,10 +1,9 @@ package org.traccar.protocol; import org.jboss.netty.buffer.ChannelBuffers; -import static org.junit.Assert.assertNull; import org.junit.Test; +import org.traccar.ProtocolDecoderTest; import org.traccar.helper.ChannelBufferTools; -import static org.traccar.helper.DecoderVerifier.verify; public class Gt02ProtocolDecoderTest extends ProtocolDecoderTest { @@ -13,14 +12,14 @@ public class Gt02ProtocolDecoderTest extends ProtocolDecoderTest { Gt02ProtocolDecoder decoder = new Gt02ProtocolDecoder(new Gt02Protocol()); - verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( - "68682500000123456789012345000110010101010101026B3F3E026B3F3E000000000000000000010D0A")))); + verifyPosition(decoder, binary( + "68682500000123456789012345000110010101010101026B3F3E026B3F3E000000000000000000010D0A")); - assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( - "6868110603035889905101276600001a0402292d0d0a")))); + verifyNothing(decoder, binary( + "6868110603035889905101276600001a0402292d0d0a")); - verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( - "68682500a403588990510127660001100e09060a1d1b00ade1c90b79ea3000011b000000000000050d0a")))); + verifyPosition(decoder, binary( + "68682500a403588990510127660001100e09060a1d1b00ade1c90b79ea3000011b000000000000050d0a")); } -- cgit v1.2.3