* 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;
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;
}
@Test
- public void testIpv6ReachabilityTopologyBuilder() throws ReadFailedException {
+ public void testIpv6ReachabilityTopologyBuilder() throws InterruptedException, ExecutionException {
// create route
updateIpv6Route(createIpv6Route(NEXT_HOP));
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();
}