use of org.opendaylight.protocol.bgp.parser.spi.BgpPrefixSidTlvRegistry in project bgpcep by opendaylight.
the class SimpleRegistryTest method testSimpleBgpPrefixSidTlvRegistry.
@Test
public void testSimpleBgpPrefixSidTlvRegistry() {
final BgpPrefixSidTlvRegistry sidTlvReg = this.ctx.getBgpPrefixSidTlvRegistry();
final byte[] tlvBytes = { 0x00, 0x03, 0x00, 0x00, 0x00 };
final BgpPrefixSidTlv tlv = mock(BgpPrefixSidTlv.class);
doReturn(BgpPrefixSidTlv.class).when(tlv).getImplementedInterface();
final ByteBuf buffer = Unpooled.buffer(tlvBytes.length);
sidTlvReg.serializeBgpPrefixSidTlv(tlv, buffer);
verify(this.activator.sidTlvSerializer, times(1)).serializeBgpPrefixSidTlv(Mockito.any(BgpPrefixSidTlv.class), Mockito.any(ByteBuf.class));
sidTlvReg.parseBgpPrefixSidTlv(BgpTestActivator.TYPE, Unpooled.wrappedBuffer(tlvBytes));
verify(this.activator.sidTlvParser, times(1)).parseBgpPrefixSidTlv(Mockito.any(ByteBuf.class));
}
Aggregations