X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflow-protocol-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fopenflowjava%2Fprotocol%2Fimpl%2Fdeserialization%2Ffactories%2FErrorMessageFactoryTest.java;h=55a90b8117c83de4e4617e005b123285edf32568;hb=07de1ed897da9d7dc70c6d550f38c59339ed751e;hp=70e4cb988f548b35861e78444b23f466780c890a;hpb=d9bfb084e625240a4d078975169a6a267c9fd3a1;p=openflowjava.git diff --git a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/ErrorMessageFactoryTest.java b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/ErrorMessageFactoryTest.java index 70e4cb98..55a90b81 100644 --- a/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/ErrorMessageFactoryTest.java +++ b/openflow-protocol-impl/src/test/java/org/opendaylight/openflowjava/protocol/impl/deserialization/factories/ErrorMessageFactoryTest.java @@ -1,10 +1,25 @@ -/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */ +/* + * Copyright (c) 2013 Pantheon Technologies s.r.o. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ + package org.opendaylight.openflowjava.protocol.impl.deserialization.factories; import io.netty.buffer.ByteBuf; import org.junit.Assert; +import org.junit.Before; import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Matchers; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.runners.MockitoJUnitRunner; +import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerRegistry; +import org.opendaylight.openflowjava.protocol.api.extensibility.MessageCodeKey; import org.opendaylight.openflowjava.protocol.impl.util.BufferHelper; import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ErrorMessage; @@ -12,33 +27,322 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731 * @author michal.polkorab * @author timotej.kubas */ +@RunWith(MockitoJUnitRunner.class) public class ErrorMessageFactoryTest { + @Mock DeserializerRegistry registry; + @Mock ErrorMessageFactory deserializer; + + private ErrorMessageFactory errorFactory; + + /** + * Initializes deserializer registry and lookups correct deserializer + */ + @Before + public void startUp() { + errorFactory = new ErrorMessageFactory(); + } + /** * Test of {@link ErrorMessageFactory} for correct translation into POJO */ @Test public void testWithoutData() { - ByteBuf bb = BufferHelper.buildBuffer("00 01 00 02"); - ErrorMessage builtByFactory = BufferHelper.decodeV13( - ErrorMessageFactory.getInstance(), bb); + ByteBuf bb = BufferHelper.buildBuffer("00 00 00 00"); + ErrorMessage builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 0, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "HELLOFAILED", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "INCOMPATIBLE", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 01 00 00"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); BufferHelper.checkHeaderV13(builtByFactory); Assert.assertEquals("Wrong type", 1, builtByFactory.getType().intValue()); - Assert.assertEquals("Wrong code", 2, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue()); Assert.assertEquals("Wrong type string", "BADREQUEST", builtByFactory.getTypeString()); - Assert.assertEquals("Wrong code string", "BADMULTIPART", builtByFactory.getCodeString()); + Assert.assertEquals("Wrong code string", "BADVERSION", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 02 00 00"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 2, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "BADACTION", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "BADTYPE", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 03 00 00"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 3, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "BADINSTRUCTION", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "UNKNOWNINST", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 04 00 00"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 4, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "BADMATCH", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "BADTYPE", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 05 00 00"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 5, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "FLOWMODFAILED", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "UNKNOWN", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 06 00 00"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 6, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "GROUPMODFAILED", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "GROUPEXISTS", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 07 00 00"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 7, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "PORTMODFAILED", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "BADPORT", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 08 00 00"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 8, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "TABLEMODFAILED", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "BADTABLE", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 09 00 00"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 9, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "QUEUEOPFAILED", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "BADPORT", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 0A 00 00"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 10, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "SWITCHCONFIGFAILED", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "BADFLAGS", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 0B 00 00"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 11, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "ROLEREQUESTFAILED", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "STALE", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 0C 00 00"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 12, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "METERMODFAILED", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "UNKNOWN", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 0D 00 00"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 13, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 0, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "TABLEFEATURESFAILED", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "BADTABLE", builtByFactory.getCodeString()); Assert.assertNull("Data is not null", builtByFactory.getData()); } - + + /** + * Test of {@link ErrorMessageFactory} for correct translation into POJO + * - not existing code used + */ + @Test + public void testWithoutData2() { + ByteBuf bb = BufferHelper.buildBuffer("00 00 FF FF"); + ErrorMessage builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 0, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "HELLOFAILED", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 01 FF FF"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 1, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "BADREQUEST", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 02 FF FF"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 2, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "BADACTION", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 03 FF FF"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 3, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "BADINSTRUCTION", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 04 FF FF"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 4, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "BADMATCH", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 05 FF FF"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 5, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "FLOWMODFAILED", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 06 FF FF"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 6, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "GROUPMODFAILED", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 07 FF FF"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 7, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "PORTMODFAILED", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 08 FF FF"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 8, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "TABLEMODFAILED", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 09 FF FF"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 9, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "QUEUEOPFAILED", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 0A FF FF"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 10, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "SWITCHCONFIGFAILED", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 0B FF FF"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 11, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "ROLEREQUESTFAILED", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 0C FF FF"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 12, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "METERMODFAILED", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + + bb = BufferHelper.buildBuffer("00 0D FF FF"); + builtByFactory = BufferHelper.deserialize(errorFactory, bb); + + BufferHelper.checkHeaderV13(builtByFactory); + Assert.assertEquals("Wrong type", 13, builtByFactory.getType().intValue()); + Assert.assertEquals("Wrong code", 65535, builtByFactory.getCode().intValue()); + Assert.assertEquals("Wrong type string", "TABLEFEATURESFAILED", builtByFactory.getTypeString()); + Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString()); + Assert.assertNull("Data is not null", builtByFactory.getData()); + } + /** * Test of {@link ErrorMessageFactory} for correct translation into POJO */ @Test public void testWithData() { ByteBuf bb = BufferHelper.buildBuffer("00 00 00 01 00 01 02 03"); - ErrorMessage builtByFactory = BufferHelper.decodeV13( - ErrorMessageFactory.getInstance(), bb); + ErrorMessage builtByFactory = BufferHelper.deserialize(errorFactory, bb); BufferHelper.checkHeaderV13(builtByFactory); Assert.assertEquals("Wrong type", 0, builtByFactory.getType().intValue()); @@ -47,15 +351,14 @@ public class ErrorMessageFactoryTest { Assert.assertEquals("Wrong code string", "EPERM", builtByFactory.getCodeString()); Assert.assertArrayEquals("Wrong data", new byte[]{0x00, 0x01, 0x02, 0x03}, builtByFactory.getData()); } - + /** * Test of {@link ErrorMessageFactory} for correct translation into POJO */ @Test public void testWithIncorrectTypeEnum() { ByteBuf bb = BufferHelper.buildBuffer("00 20 00 05 00 01 02 03"); - ErrorMessage builtByFactory = BufferHelper.decodeV13( - ErrorMessageFactory.getInstance(), bb); + ErrorMessage builtByFactory = BufferHelper.deserialize(errorFactory, bb); BufferHelper.checkHeaderV13(builtByFactory); Assert.assertEquals("Wrong type", 32, builtByFactory.getType().intValue()); @@ -64,15 +367,14 @@ public class ErrorMessageFactoryTest { Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString()); Assert.assertArrayEquals("Wrong data", new byte[]{0x00, 0x01, 0x02, 0x03}, builtByFactory.getData()); } - + /** * Test of {@link ErrorMessageFactory} for correct translation into POJO */ @Test public void testWithIncorrectCodeEnum() { ByteBuf bb = BufferHelper.buildBuffer("00 03 00 10 00 01 02 03"); - ErrorMessage builtByFactory = BufferHelper.decodeV13( - ErrorMessageFactory.getInstance(), bb); + ErrorMessage builtByFactory = BufferHelper.deserialize(errorFactory, bb); BufferHelper.checkHeaderV13(builtByFactory); Assert.assertEquals("Wrong type", 3, builtByFactory.getType().intValue()); @@ -81,4 +383,17 @@ public class ErrorMessageFactoryTest { Assert.assertEquals("Wrong code string", "UNKNOWN_CODE", builtByFactory.getCodeString()); Assert.assertArrayEquals("Wrong data", new byte[]{0x00, 0x01, 0x02, 0x03}, builtByFactory.getData()); } -} + + /** + * Test of {@link ErrorMessageFactory} for correct translation into POJO + */ + @Test + public void testExperimenterError() { + Mockito.when(registry.getDeserializer(Matchers.any(MessageCodeKey.class))).thenReturn(deserializer); + errorFactory.injectDeserializerRegistry(registry); + ByteBuf bb = BufferHelper.buildBuffer("FF FF 00 00 00 01"); + BufferHelper.deserialize(errorFactory, bb); + + Mockito.verify(deserializer, Mockito.times(1)).deserialize(bb); + } +} \ No newline at end of file