2 * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.protocol.bgp.mvpn.spi.pojo.nlri;
10 import static org.junit.Assert.assertEquals;
12 import io.netty.buffer.ByteBuf;
13 import io.netty.buffer.Unpooled;
14 import org.junit.Test;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev200120.NlriType;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev200120.mvpn.MvpnChoice;
18 public final class SimpleMvpnNlriRegistryTest {
19 @Test(expected = IllegalArgumentException.class)
20 public void registryParseTest() {
21 SimpleMvpnNlriRegistry.getInstance().parseMvpn(NlriType.InterAsIPmsiAD, null);
25 public void registryNullTest() {
26 final ByteBuf body = Unpooled.buffer();
27 SimpleMvpnNlriRegistry.getInstance().serializeMvpn(new NotRegistered());
28 assertEquals(0, body.readableBytes());
31 private class NotRegistered implements MvpnChoice {
33 public Class<NotRegistered> implementedInterface() {
34 return NotRegistered.class;