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));
}
Aggregations