Mass-convert all compontents to use -no-zone addresses
[bgpcep.git] / bgp / topology-provider / src / test / java / org / opendaylight / bgpcep / bgp / topology / provider / Ipv6ReachabilityTopologyBuilderTest.java
index 9913df8619154e5a30e7dfd76d4d2218b3645ec2..422d597577b2427fcb573b5c403b49c35fffb468 100755 (executable)
@@ -5,7 +5,6 @@
  * 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.bgpcep.bgp.topology.provider;
 
 import static org.junit.Assert.assertEquals;
@@ -15,12 +14,12 @@ import static org.opendaylight.bgpcep.bgp.topology.provider.Ipv4ReachabilityTopo
 import static org.opendaylight.protocol.util.CheckUtil.checkNotPresentOperational;
 import static org.opendaylight.protocol.util.CheckUtil.readDataOperational;
 
+import java.util.concurrent.ExecutionException;
 import org.junit.Before;
 import org.junit.Test;
-import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Address;
+import org.opendaylight.mdsal.binding.api.WriteTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev180329.bgp.rib.rib.loc.rib.tables.routes.Ipv6RoutesCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev180329.ipv6.routes.Ipv6Routes;
@@ -66,7 +65,7 @@ public class Ipv6ReachabilityTopologyBuilderTest extends AbstractTopologyBuilder
     }
 
     @Test
-    public void testIpv6ReachabilityTopologyBuilder() throws ReadFailedException {
+    public void testIpv6ReachabilityTopologyBuilder() throws InterruptedException, ExecutionException {
         // create route
         updateIpv6Route(createIpv6Route(NEXT_HOP));
 
@@ -109,15 +108,15 @@ public class Ipv6ReachabilityTopologyBuilderTest extends AbstractTopologyBuilder
 
     private void updateIpv6Route(final Ipv6Route data) {
         final WriteTransaction wTx = getDataBroker().newWriteOnlyTransaction();
-        wTx.put(LogicalDatastoreType.OPERATIONAL, this.ipv6RouteIID, data, true);
+        wTx.mergeParentStructurePut(LogicalDatastoreType.OPERATIONAL, this.ipv6RouteIID, data);
         wTx.commit();
     }
 
-    private static Ipv6Route createIpv6Route(final String netxHop) {
+    private static Ipv6Route createIpv6Route(final String nextHop) {
         final Attributes attribute = new AttributesBuilder()
             .setOrigin(new OriginBuilder().setValue(BgpOrigin.Igp).build())
             .setCNextHop(new Ipv6NextHopCaseBuilder().setIpv6NextHop(
-                new Ipv6NextHopBuilder().setGlobal(new Ipv6Address(netxHop)).build()).build()).build();
+                new Ipv6NextHopBuilder().setGlobal(new Ipv6AddressNoZone(nextHop)).build()).build()).build();
         return new Ipv6RouteBuilder().withKey(new Ipv6RouteKey(new PathId(PATH_ID), ROUTE_IP6PREFIX))
             .setPrefix(new Ipv6Prefix(ROUTE_IP6PREFIX)).setAttributes(attribute).build();
     }