Bump versions to 0.21.7-SNAPSHOT
[bgpcep.git] / bgp / extensions / mvpn / src / test / java / org / opendaylight / protocol / bgp / mvpn / impl / TableTypeActivatorTest.java
1 /*
2  * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
3  *
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
7  */
8 package org.opendaylight.protocol.bgp.mvpn.impl;
9
10 import static org.junit.Assert.assertEquals;
11
12 import org.junit.Test;
13 import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryConsumer;
14 import org.opendaylight.protocol.bgp.parser.BgpTableTypeImpl;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.BgpTableType;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.mvpn.rev200120.McastVpnSubsequentAddressFamily;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.IPV4MCASTVPN;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.IPV6MCASTVPN;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv4AddressFamily;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev200120.Ipv6AddressFamily;
21
22 public final class TableTypeActivatorTest {
23     private static final BgpTableType MVPN_IPV4 = new BgpTableTypeImpl(
24             Ipv4AddressFamily.VALUE, McastVpnSubsequentAddressFamily.VALUE);
25     private static final BgpTableType MVPN_IPV6 = new BgpTableTypeImpl(
26             Ipv6AddressFamily.VALUE, McastVpnSubsequentAddressFamily.VALUE);
27
28     @Test
29     public void testActivator() {
30         var registry = BGPTableTypeRegistryConsumer.of(new TableTypeActivator());
31         assertEquals(IPV4MCASTVPN.VALUE, registry.getAfiSafiType(MVPN_IPV4));
32         assertEquals(IPV6MCASTVPN.VALUE, registry.getAfiSafiType(MVPN_IPV6));
33
34         assertEquals(MVPN_IPV4, registry.getTableType(IPV4MCASTVPN.VALUE));
35         assertEquals(MVPN_IPV6, registry.getTableType(IPV6MCASTVPN.VALUE));
36     }
37 }