Bug 5610: PCRpt message with vendor specific object throws exception 84/42584/3
authorOmair <of8826@att.com>
Tue, 26 Jul 2016 16:10:12 +0000 (09:10 -0700)
committerMilos Fabian <milfabia@cisco.com>
Tue, 26 Jul 2016 19:38:20 +0000 (19:38 +0000)
Make sure Vendor Information Object registry is always
available. Extend Object registry to provide Vendor
Information registry services.

Fix already present in Beryllium. This ports the fix to master branch.

Change-Id: I8a47b54324bdbdefea6193628c947318f6ed65bb
Signed-off-by: Omair <of8826@att.com>
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/BaseParserExtensionActivator.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/message/PCEPMonitoringRequestMessageParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/message/PCEPReplyMessageParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/message/PCEPRequestMessageParser.java
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPValidatorTest.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/AbstractMessageParser.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/ObjectRegistry.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimpleObjectRegistry.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimplePCEPExtensionProviderContext.java
pcep/spi/src/test/java/org/opendaylight/protocol/pcep/spi/AbstractMessageParserTest.java

index 957944b2a85c3fb6db716cec9e7cbabadd5ea00e..5f60154a598723727568c4ce07130e47b9ce55d6 100644 (file)
@@ -82,7 +82,6 @@ import org.opendaylight.protocol.pcep.spi.LabelRegistry;
 import org.opendaylight.protocol.pcep.spi.ObjectRegistry;
 import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext;
 import org.opendaylight.protocol.pcep.spi.TlvRegistry;
-import org.opendaylight.protocol.pcep.spi.VendorInformationObjectRegistry;
 import org.opendaylight.protocol.pcep.spi.VendorInformationTlvRegistry;
 import org.opendaylight.protocol.pcep.spi.pojo.AbstractPCEPExtensionProviderActivator;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Close;
@@ -149,7 +148,6 @@ public final class BaseParserExtensionActivator extends AbstractPCEPExtensionPro
         registerObjectParsers(regs, context);
 
         final ObjectRegistry objReg = context.getObjectHandlerRegistry();
-        final VendorInformationObjectRegistry viObjReg = context.getVendorInformationObjectRegistry();
         final PCEPOpenMessageParser openParser = new PCEPOpenMessageParser(objReg);
         regs.add(context.registerMessageParser(PCEPOpenMessageParser.TYPE, openParser));
         regs.add(context.registerMessageSerializer(
@@ -160,11 +158,11 @@ public final class BaseParserExtensionActivator extends AbstractPCEPExtensionPro
         regs.add(context.registerMessageParser(PCEPKeepAliveMessageParser.TYPE, kaParser));
         regs.add(context.registerMessageSerializer(Keepalive.class, kaParser));
 
-        final PCEPRequestMessageParser reqParser = new PCEPRequestMessageParser(objReg, viObjReg);
+        final PCEPRequestMessageParser reqParser = new PCEPRequestMessageParser(objReg);
         regs.add(context.registerMessageParser(PCEPRequestMessageParser.TYPE, reqParser));
         regs.add(context.registerMessageSerializer(Pcreq.class, reqParser));
 
-        final PCEPReplyMessageParser repParser = new PCEPReplyMessageParser(objReg, viObjReg);
+        final PCEPReplyMessageParser repParser = new PCEPReplyMessageParser(objReg);
         regs.add(context.registerMessageParser(PCEPReplyMessageParser.TYPE, repParser));
         regs.add(context.registerMessageSerializer(Pcrep.class, repParser));
 
@@ -184,7 +182,7 @@ public final class BaseParserExtensionActivator extends AbstractPCEPExtensionPro
         regs.add(context.registerMessageParser(PCEPMonitoringReplyMessageParser.TYPE, monRepParser));
         regs.add(context.registerMessageSerializer(Pcmonrep.class, monRepParser));
 
-        final PCEPMonitoringRequestMessageParser monReqParser = new PCEPMonitoringRequestMessageParser(objReg, viObjReg);
+        final PCEPMonitoringRequestMessageParser monReqParser = new PCEPMonitoringRequestMessageParser(objReg);
         regs.add(context.registerMessageParser(PCEPMonitoringRequestMessageParser.TYPE, monReqParser));
         regs.add(context.registerMessageSerializer(Pcmonreq.class, monReqParser));
 
index c9bc7ea4b17f3f462a25edf130dd894592756ffd..5ab85a13b645b94de4abe7cf3ba038c63ee75aa8 100644 (file)
@@ -17,7 +17,6 @@ import org.opendaylight.protocol.pcep.spi.MessageUtil;
 import org.opendaylight.protocol.pcep.spi.ObjectRegistry;
 import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
-import org.opendaylight.protocol.pcep.spi.VendorInformationObjectRegistry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Pcmonreq;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.PcmonreqBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Message;
@@ -37,8 +36,8 @@ public class PCEPMonitoringRequestMessageParser extends PCEPRequestMessageParser
 
     public static final int TYPE = 8;
 
-    public PCEPMonitoringRequestMessageParser(final ObjectRegistry registry, final VendorInformationObjectRegistry viRegistry) {
-        super(registry, viRegistry);
+    public PCEPMonitoringRequestMessageParser(final ObjectRegistry registry) {
+        super(registry);
     }
 
     @Override
index 968c500cdb61e78457975fbde2f22b79aed6c8fa..8e89fe8043acb10b3f1728057c42edabc8c9b370 100644 (file)
@@ -19,7 +19,6 @@ import org.opendaylight.protocol.pcep.spi.MessageUtil;
 import org.opendaylight.protocol.pcep.spi.ObjectRegistry;
 import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
-import org.opendaylight.protocol.pcep.spi.VendorInformationObjectRegistry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Pcrep;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.PcrepBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Message;
@@ -58,8 +57,8 @@ public class PCEPReplyMessageParser extends AbstractMessageParser {
 
     public static final int TYPE = 4;
 
-    public PCEPReplyMessageParser(final ObjectRegistry registry, final VendorInformationObjectRegistry viRegistry) {
-        super(registry, viRegistry);
+    public PCEPReplyMessageParser(final ObjectRegistry registry) {
+        super(registry);
     }
 
     @Override
index 9033fafc36b0f48bed7f9c041ae9b4cbce559057..edb5f3b44d9f7a6597a4afc1d8b92c805368db4d 100644 (file)
@@ -18,7 +18,6 @@ import org.opendaylight.protocol.pcep.spi.MessageUtil;
 import org.opendaylight.protocol.pcep.spi.ObjectRegistry;
 import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
-import org.opendaylight.protocol.pcep.spi.VendorInformationObjectRegistry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Pcreq;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.PcreqBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Message;
@@ -67,8 +66,8 @@ public class PCEPRequestMessageParser extends AbstractMessageParser {
 
     public static final int TYPE = 3;
 
-    public PCEPRequestMessageParser(final ObjectRegistry registry, final VendorInformationObjectRegistry viRegistry) {
-        super(registry, viRegistry);
+    public PCEPRequestMessageParser(final ObjectRegistry registry) {
+        super(registry);
     }
 
     @Override
index 2587e78492dfff8cac475afa633f86205eb2e25b..dbf4a56b3dbac3a580b46a271df29c9523e0c30f 100644 (file)
@@ -34,7 +34,6 @@ import org.opendaylight.protocol.pcep.parser.message.PCEPRequestMessageParser;
 import org.opendaylight.protocol.pcep.parser.message.PCEPStartTLSMessageParser;
 import org.opendaylight.protocol.pcep.spi.ObjectRegistry;
 import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
-import org.opendaylight.protocol.pcep.spi.VendorInformationObjectRegistry;
 import org.opendaylight.protocol.pcep.spi.pojo.SimplePCEPExtensionProviderContext;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
@@ -143,7 +142,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev
 public class PCEPValidatorTest {
 
     private ObjectRegistry objectRegistry;
-    private VendorInformationObjectRegistry viObjRegistry;
 
     private Open open;
     private Rp rpTrue;
@@ -177,7 +175,6 @@ public class PCEPValidatorTest {
         this.act.start(this.ctx);
         this.viObjAct.start(this.ctx);
         this.objectRegistry = this.ctx.getObjectHandlerRegistry();
-        this.viObjRegistry = this.ctx.getVendorInformationObjectRegistry();
         final RpBuilder rpBuilder = new RpBuilder();
         rpBuilder.setProcessingRule(true);
         rpBuilder.setIgnore(false);
@@ -387,7 +384,7 @@ public class PCEPValidatorTest {
     public void testRequestMsg() throws IOException, PCEPDeserializerException {
         ByteBuf result = Unpooled.wrappedBuffer(ByteArray.fileToBytes("src/test/resources/PCEPRequestMessage1.bin"));
 
-        final PCEPRequestMessageParser parser = new PCEPRequestMessageParser(this.objectRegistry, this.viObjRegistry);
+        final PCEPRequestMessageParser parser = new PCEPRequestMessageParser(this.objectRegistry);
 
         final PcreqMessageBuilder builder = new PcreqMessageBuilder();
         final List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcreq.message.pcreq.message.Requests> reqs1 = Lists.newArrayList();
@@ -444,7 +441,7 @@ public class PCEPValidatorTest {
         // only RP
         ByteBuf result = Unpooled.wrappedBuffer(ByteArray.fileToBytes("src/test/resources/PCRep.1.bin"));
 
-        final PCEPReplyMessageParser parser = new PCEPReplyMessageParser(this.objectRegistry, this.viObjRegistry);
+        final PCEPReplyMessageParser parser = new PCEPReplyMessageParser(this.objectRegistry);
 
         final PcrepMessageBuilder builder = new PcrepMessageBuilder();
         RepliesBuilder rBuilder = new RepliesBuilder();
@@ -634,7 +631,7 @@ public class PCEPValidatorTest {
     @Test
     public void testReqMsgWithVendorInfoObjects() throws IOException, PCEPDeserializerException {
         final ByteBuf result = Unpooled.wrappedBuffer(ByteArray.fileToBytes("src/test/resources/PCReq.7.bin"));
-        final PCEPRequestMessageParser parser = new PCEPRequestMessageParser(this.objectRegistry, this.viObjRegistry);
+        final PCEPRequestMessageParser parser = new PCEPRequestMessageParser(this.objectRegistry);
 
         final PcreqMessageBuilder builder = new PcreqMessageBuilder();
         final List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcreq.message.pcreq.message.Requests> reqs1 = Lists.newArrayList();
@@ -659,7 +656,7 @@ public class PCEPValidatorTest {
 
     @Test
     public void testRepMsgWithVendorInforObjects() throws IOException, PCEPDeserializerException {
-        final PCEPReplyMessageParser parser = new PCEPReplyMessageParser(this.objectRegistry, this.viObjRegistry);
+        final PCEPReplyMessageParser parser = new PCEPReplyMessageParser(this.objectRegistry);
 
         final PcrepMessageBuilder builder = new PcrepMessageBuilder();
         RepliesBuilder rBuilder = new RepliesBuilder();
@@ -730,7 +727,7 @@ public class PCEPValidatorTest {
 
     @Test
     public void testRepWithMonitoring() throws IOException, PCEPDeserializerException {
-        final PCEPReplyMessageParser parser = new PCEPReplyMessageParser(this.objectRegistry, this.viObjRegistry);
+        final PCEPReplyMessageParser parser = new PCEPReplyMessageParser(this.objectRegistry);
 
         final PcrepMessageBuilder builder = new PcrepMessageBuilder();
         RepliesBuilder rBuilder = new RepliesBuilder();
@@ -765,7 +762,7 @@ public class PCEPValidatorTest {
     public void testReqWithMonitoring() throws IOException, PCEPDeserializerException {
         final ByteBuf result = Unpooled.wrappedBuffer(ByteArray.fileToBytes("src/test/resources/PCReq.8.bin"));
 
-        final PCEPRequestMessageParser parser = new PCEPRequestMessageParser(this.objectRegistry, this.viObjRegistry);
+        final PCEPRequestMessageParser parser = new PCEPRequestMessageParser(this.objectRegistry);
 
         final PcreqMessageBuilder builder = new PcreqMessageBuilder();
         final List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcreq.message.pcreq.message.Requests> reqs1 = Lists.newArrayList();
@@ -790,7 +787,7 @@ public class PCEPValidatorTest {
 
     @Test
     public void testMonReqMsg() throws PCEPDeserializerException, IOException {
-        final PCEPMonitoringRequestMessageParser parser = new PCEPMonitoringRequestMessageParser(this.objectRegistry, this.viObjRegistry);
+        final PCEPMonitoringRequestMessageParser parser = new PCEPMonitoringRequestMessageParser(this.objectRegistry);
 
         final PcreqMessageBuilder builder = new PcreqMessageBuilder();
         final MonitoringRequestBuilder monReqBuilder = new MonitoringRequestBuilder();
index e4929b2aa7488b813546f465b440c13310ee4546..ba0cc4e6bed9fdf042efc482292849521f1ccad0 100644 (file)
@@ -48,16 +48,9 @@ public abstract class AbstractMessageParser implements MessageParser, MessageSer
     private static final int IGNORED = 7;
 
     private final ObjectRegistry registry;
-    private final VendorInformationObjectRegistry viRegistry;
 
     protected AbstractMessageParser(final ObjectRegistry registry) {
         this.registry = Preconditions.checkNotNull(registry);
-        this.viRegistry = null;
-    }
-
-    protected AbstractMessageParser(final ObjectRegistry registry, final VendorInformationObjectRegistry viRegistry) {
-        this.registry = Preconditions.checkNotNull(registry);
-        this.viRegistry = Preconditions.checkNotNull(viRegistry);
     }
 
     /**
@@ -97,9 +90,8 @@ public abstract class AbstractMessageParser implements MessageParser, MessageSer
             final ObjectHeader header = new ObjectHeaderImpl(flags.get(PROCESSED), flags.get(IGNORED));
 
             if (VendorInformationUtil.isVendorInformationObject(objClass, objType)) {
-                Preconditions.checkState(this.viRegistry != null);
                 final EnterpriseNumber enterpriseNumber = new EnterpriseNumber(bytesToPass.readUnsignedInt());
-                final Optional<? extends Object> obj = this.viRegistry.parseVendorInformationObject(enterpriseNumber, header, bytesToPass);
+                final Optional<? extends Object> obj = this.registry.parseVendorInformationObject(enterpriseNumber, header, bytesToPass);
                 if (obj.isPresent()) {
                     objs.add(obj.get());
                 }
@@ -143,7 +135,7 @@ public abstract class AbstractMessageParser implements MessageParser, MessageSer
     protected final void serializeVendorInformationObjects(final List<VendorInformationObject> viObjects, final ByteBuf buffer) {
         if (viObjects != null) {
             for (final VendorInformationObject viObject : viObjects) {
-                this.viRegistry.serializeVendorInformationObject(viObject, buffer);
+                this.registry.serializeVendorInformationObject(viObject, buffer);
             }
         }
     }
index 0051abf2392cfa6b94bd696c48ade92728ae5eec..38a339824b75c4fe8f07e4d9c98de8236b937f63 100644 (file)
@@ -11,7 +11,7 @@ import io.netty.buffer.ByteBuf;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.ObjectHeader;
 
-public interface ObjectRegistry {
+public interface ObjectRegistry extends VendorInformationObjectRegistry {
     /**
      * Finds parser for given object type and class in the registry. Delegates parsing to found parser.
      *
index 81f989a11e36274c2c54e1da170b7cbb4f1cb3b9..db43cb9907f3e3abcc80665e39cd1b230413d027 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.protocol.pcep.spi.pojo;
 
+import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.protocol.concepts.HandlerRegistry;
@@ -16,9 +17,12 @@ import org.opendaylight.protocol.pcep.spi.ObjectSerializer;
 import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
 import org.opendaylight.protocol.pcep.spi.UnknownObject;
+import org.opendaylight.protocol.pcep.spi.VendorInformationObjectRegistry;
 import org.opendaylight.protocol.util.Values;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.iana.rev130816.EnterpriseNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.ObjectHeader;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.vendor.information.objects.VendorInformationObject;
 import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 /**
@@ -28,7 +32,13 @@ public final class SimpleObjectRegistry implements ObjectRegistry {
     private final HandlerRegistry<DataContainer, ObjectParser, ObjectSerializer> handlers = new HandlerRegistry<>();
 
     private static final int MAX_OBJECT_TYPE = 15;
-    private static final int MAX_OBJECT_CLASS = 4;
+    private static final int MAX_OBJECT_CLASS = 4;   
+    private final VendorInformationObjectRegistry viRegistry;
+
+    public SimpleObjectRegistry(final VendorInformationObjectRegistry viRegistry) {
+        this.viRegistry = viRegistry;
+
+    }
 
     private static int createKey(final int objectClass, final int objectType) {
         Preconditions.checkArgument(objectClass >= 0 && objectClass <= Values.UNSIGNED_BYTE_MAX_VALUE);
@@ -75,5 +85,15 @@ public final class SimpleObjectRegistry implements ObjectRegistry {
             return;
         }
         serializer.serializeObject(object, buffer);
+    }   
+    @Override
+    public Optional<? extends Object> parseVendorInformationObject(final EnterpriseNumber enterpriseNumber,
+            final ObjectHeader header, final ByteBuf buffer) throws PCEPDeserializerException {
+        return this.viRegistry.parseVendorInformationObject(enterpriseNumber, header, buffer);
+    }
+
+    @Override
+    public void serializeVendorInformationObject(final VendorInformationObject viObject, final ByteBuf buffer) {
+        this.viRegistry.serializeVendorInformationObject(viObject, buffer);
     }
 }
index 968f15630999e9dd3937f0937ab2d2970453e52d..baf31761c58fdf415ffee6401beb8893283638aa 100644 (file)
@@ -48,13 +48,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev
 public class SimplePCEPExtensionProviderContext implements PCEPExtensionProviderContext {
     private final SimpleLabelRegistry labelReg = new SimpleLabelRegistry();
     private final SimpleMessageRegistry msgReg = new SimpleMessageRegistry();
-    private final SimpleObjectRegistry objReg = new SimpleObjectRegistry();
+    private final SimpleVendorInformationObjectRegistry viObjReg = new SimpleVendorInformationObjectRegistry();
+    private final SimpleObjectRegistry objReg = new SimpleObjectRegistry(this.viObjReg);
     private final SimpleEROSubobjectRegistry eroSubReg = new SimpleEROSubobjectRegistry();
     private final SimpleRROSubobjectRegistry rroSubReg = new SimpleRROSubobjectRegistry();
     private final SimpleXROSubobjectRegistry xroSubReg = new SimpleXROSubobjectRegistry();
     private final SimpleTlvRegistry tlvReg = new SimpleTlvRegistry();
     private final SimpleVendorInformationTlvRegistry viTlvReg = new SimpleVendorInformationTlvRegistry();
-    private final SimpleVendorInformationObjectRegistry viObjReg = new SimpleVendorInformationObjectRegistry();
 
     @Override
     public final LabelRegistry getLabelHandlerRegistry() {
index dadbe468741ffbce9996cf6623e7befc57d6b1cb..258b70706c0291424e8242fce405e8450bf370a9 100644 (file)
@@ -45,19 +45,12 @@ public class AbstractMessageParserTest {
     @Mock
     private ObjectRegistry registry;
 
-    @Mock
-    private VendorInformationObjectRegistry viRegistry;
-
     private class Abs extends AbstractMessageParser {
 
         protected Abs(final ObjectRegistry registry) {
             super(registry);
         }
 
-        protected Abs(final ObjectRegistry registry, final VendorInformationObjectRegistry viRegistry) {
-            super(registry, viRegistry);
-        }
-
         @Override
         public void serializeMessage(final Message message, final ByteBuf buffer) {
         }
@@ -84,8 +77,8 @@ public class AbstractMessageParserTest {
         MockitoAnnotations.initMocks(this);
         this.object = new ErrorObjectBuilder().setType((short) 1).setValue((short) 1).build();
         this.viObject = new VendorInformationObjectBuilder().setEnterpriseNumber(EN).build();
-        Mockito.doNothing().when(this.viRegistry).serializeVendorInformationObject(Mockito.any(VendorInformationObject.class), Mockito.any(ByteBuf.class));
-        Mockito.doReturn(Optional.of(this.viObject)).when(this.viRegistry).parseVendorInformationObject(Mockito.eq(EN), Mockito.eq(new ObjectHeaderImpl(true, true)), Mockito.any(ByteBuf.class));
+        Mockito.doNothing().when(this.registry).serializeVendorInformationObject(Mockito.any(VendorInformationObject.class), Mockito.any(ByteBuf.class));
+        Mockito.doReturn(Optional.of(this.viObject)).when(this.registry).parseVendorInformationObject(Mockito.eq(EN), Mockito.eq(new ObjectHeaderImpl(true, true)), Mockito.any(ByteBuf.class));
         Mockito.doNothing().when(this.registry).serializeObject(Mockito.any(Object.class), Mockito.any(ByteBuf.class));
         Mockito.doReturn(this.object).when(this.registry).parseObject(13, 1, new ObjectHeaderImpl(true, true), Unpooled.wrappedBuffer(new byte[] { 0, 0, 1, 1 }));
     }
@@ -105,11 +98,11 @@ public class AbstractMessageParserTest {
 
     @Test
     public void testParseVendorInformationObject() throws PCEPDeserializerException {
-        final Abs parser = new Abs(this.registry, this.viRegistry);
+        final Abs parser = new Abs(this.registry);
         final ByteBuf buffer = Unpooled.buffer();
 
         parser.serializeVendorInformationObjects(Lists.newArrayList(this.viObject), buffer);
-        Mockito.verify(this.viRegistry, Mockito.only()).serializeVendorInformationObject(Mockito.any(VendorInformationObject.class), Mockito.any(ByteBuf.class));
+        Mockito.verify(this.registry, Mockito.only()).serializeVendorInformationObject(Mockito.any(VendorInformationObject.class), Mockito.any(ByteBuf.class));
 
         final Message msg = parser.parseMessage(Unpooled.wrappedBuffer(new byte[] {0x22, 0x13, 0x00, 0x08, 0, 0, 0, 0 }), Collections.<Message> emptyList());