X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflowjava%2Fopenflow-protocol-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fopenflowjava%2Fprotocol%2Fimpl%2Fcore%2FOFDecoderTest.java;h=84d17d8b8790e54a2c40e838a0812c2adba66a82;hb=59bf5b768c4bcc0a7d25101e8b25d82e5af4be38;hp=090ab2dc5e3ac92e7757aefb6c77f726d06b52ea;hpb=2fdde79d3bc5b5e2e54992e3c4b8c52e9131a48f;p=openflowplugin.git diff --git a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/OFDecoderTest.java b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/OFDecoderTest.java index 090ab2dc5e..84d17d8b87 100644 --- a/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/OFDecoderTest.java +++ b/openflowjava/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/core/OFDecoderTest.java @@ -10,7 +10,6 @@ package org.opendaylight.openflowjava.protocol.impl.core; import static org.junit.Assert.assertEquals; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyShort; import static org.mockito.Mockito.when; import io.netty.buffer.ByteBuf; @@ -24,6 +23,7 @@ import org.mockito.MockitoAnnotations; import org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializationFactory; import org.opendaylight.openflowjava.util.ByteBufUtils; import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint8; /** * Unit tests for OFDecoder. @@ -50,13 +50,13 @@ public class OFDecoderTest { ofDecoder = new OFDecoder(); ofDecoder.setDeserializationFactory(mockDeserializationFactory); writeObj = ByteBufUtils.hexStringToByteBuf("16 03 01 00"); - inMsg = new VersionMessageWrapper((short) 8, writeObj); + inMsg = new VersionMessageWrapper(Uint8.valueOf(8), writeObj); outList = new ArrayList<>(); } @Test public void testDecode() { - when(mockDeserializationFactory.deserialize(any(ByteBuf.class), anyShort())).thenReturn(mockDataObject); + when(mockDeserializationFactory.deserialize(any(ByteBuf.class), any(Uint8.class))).thenReturn(mockDataObject); ofDecoder.decode(mockChHndlrCtx, inMsg, outList); @@ -67,7 +67,7 @@ public class OFDecoderTest { @Test public void testDecodeDeserializeException() { - when(mockDeserializationFactory.deserialize(any(ByteBuf.class), anyShort())) + when(mockDeserializationFactory.deserialize(any(ByteBuf.class), any(Uint8.class))) .thenThrow(new IllegalArgumentException()); ofDecoder.decode(mockChHndlrCtx, inMsg, outList); @@ -79,7 +79,7 @@ public class OFDecoderTest { @Test public void testDecodeDeserializeNull() { - when(mockDeserializationFactory.deserialize(any(ByteBuf.class), anyShort())).thenReturn(null); + when(mockDeserializationFactory.deserialize(any(ByteBuf.class), any(Uint8.class))).thenReturn(null); ofDecoder.decode(mockChHndlrCtx, inMsg, outList);