* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities;
import io.netty.buffer.ByteBuf;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.opaque.extended.community._case.OpaqueExtendedCommunityBuilder;
public class OpaqueEcHandlerTest {
-
private static final byte[] INPUT = {
21, 45, 5, 4, 3, 1
};
@Test
public void testHandler() throws BGPDocumentedException, BGPParsingException {
final OpaqueEcHandler handler = new OpaqueEcHandler();
- final OpaqueExtendedCommunityCase expected = new OpaqueExtendedCommunityCaseBuilder().setOpaqueExtendedCommunity(
- new OpaqueExtendedCommunityBuilder().setValue(new byte[] { 21, 45, 5, 4, 3, 1 }).build()).build();
+ final OpaqueExtendedCommunityCase expected = new OpaqueExtendedCommunityCaseBuilder()
+ .setOpaqueExtendedCommunity(new OpaqueExtendedCommunityBuilder()
+ .setValue(new byte[] { 21, 45, 5, 4, 3, 1 }).build()).build();
final ExtendedCommunity exComm = handler.parseExtendedCommunity(Unpooled.copiedBuffer(INPUT));
Assert.assertEquals(expected, exComm);
handler.serializeExtendedCommunity(expected, output);
Assert.assertArrayEquals(INPUT, output.array());
}
-
}