f91d13953fb80a3d9580b318c8b8b973d6b7d6f8
[bgpcep.git] / bgp / rib-spi / src / test / java / org / opendaylight / protocol / bgp / rib / spi / AddPathRibSupportTest.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  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.rib.spi;
9
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertNull;
12 import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID;
13
14 import com.google.common.collect.ImmutableMap;
15 import org.junit.Test;
16 import org.opendaylight.yangtools.yang.common.QName;
17 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev171207.ipv4.routes.ipv4.routes.Ipv4Route;
19
20 public class AddPathRibSupportTest {
21
22     private static final String PREFIX = "1.2.3.4/32";
23     private static final String ROUTE_KEY = "prefix";
24     private static final NodeIdentifierWithPredicates QNAME
25             = new NodeIdentifierWithPredicates(Ipv4Route.QNAME,
26             ImmutableMap.of(QName.create(Ipv4Route.QNAME, ROUTE_KEY).intern(), PREFIX));
27
28     @Test
29     public void defaultAddPathRibSupport() {
30         final AddPathRibSupportLocalTest test = new AddPathRibSupportLocalTest();
31         assertEquals((Long) NON_PATH_ID, test.extractPathId(null));
32         assertNull(test.getRouteIdAddPath(NON_PATH_ID, null));
33         assertEquals(QNAME, test.createRouteKeyPathArgument(QNAME));
34     }
35
36     private static class AddPathRibSupportLocalTest implements AddPathRibSupport {
37     }
38 }