Search in sources :

Example 1 with ParameterRegistry

use of org.opendaylight.protocol.bgp.parser.spi.ParameterRegistry in project bgpcep by opendaylight.

the class SimpleRegistryTest method testSimpleParameter.

@Test
public void testSimpleParameter() throws Exception {
    final ParameterRegistry paramReg = this.ctx.getParameterRegistry();
    final BgpParameters param = Mockito.mock(BgpParameters.class);
    Mockito.doReturn(BgpParameters.class).when(param).getImplementedInterface();
    final byte[] paramBytes = { 0x00, 0x00 };
    final ByteBuf buffer = Unpooled.buffer(paramBytes.length);
    paramReg.serializeParameter(param, buffer);
    paramReg.parseParameter(0, Unpooled.wrappedBuffer(paramBytes));
    verify(this.activator.paramParser, times(1)).parseParameter(Mockito.any(ByteBuf.class));
    verify(this.activator.paramSerializer, times(1)).serializeParameter(Mockito.any(BgpParameters.class), Mockito.any(ByteBuf.class));
}
Also used : ParameterRegistry(org.opendaylight.protocol.bgp.parser.spi.ParameterRegistry) BgpParameters(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.open.message.BgpParameters) ByteBuf(io.netty.buffer.ByteBuf) Test(org.junit.Test)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)1 Test (org.junit.Test)1 ParameterRegistry (org.opendaylight.protocol.bgp.parser.spi.ParameterRegistry)1 BgpParameters (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev171207.open.message.BgpParameters)1