use of org.opendaylight.protocol.bgp.parser.spi.AttributeRegistry in project bgpcep by opendaylight.
the class SimpleRegistryTest method testSimpleAttribute.
@Test
public void testSimpleAttribute() throws BGPDocumentedException, BGPParsingException, BGPTreatAsWithdrawException {
final AttributeRegistry attrReg = this.ctx.getAttributeRegistry();
final byte[] attributeBytes = { 0x00, 0x00, 0x00 };
final ByteBuf byteAggregator = Unpooled.buffer(attributeBytes.length);
attrReg.serializeAttribute(mock(Attributes.class), byteAggregator);
attrReg.parseAttributes(Unpooled.wrappedBuffer(attributeBytes), CONSTRAINT);
verify(this.activator.attrParser, times(1)).parseAttribute(any(ByteBuf.class), any(AttributesBuilder.class), any(RevisedErrorHandling.class), any(PeerSpecificParserConstraint.class));
verify(this.activator.attrSerializer, times(1)).serializeAttribute(any(Attributes.class), any(ByteBuf.class));
}
Aggregations