use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.attributes.unreach.mp.unreach.nlri.WithdrawnRoutesBuilder in project bgpcep by opendaylight.
the class RIBSupportTest method buildUpdate.
@Test
public void buildUpdate() {
final Ipv4NextHopCase nextHop = new Ipv4NextHopCaseBuilder().setIpv4NextHop(new Ipv4NextHopBuilder().setGlobal(new Ipv4AddressNoZone("10.0.0.2")).build()).build();
final Attributes attr = new AttributesBuilder().setCNextHop(nextHop).build();
final Collection<MapEntryNode> routes = new HashSet<>();
assertEquals(new UpdateBuilder().setAttributes(new AttributesBuilder().build()).build(), this.ribSupportTestImp.buildUpdate(routes, routes, attr));
routes.add(this.mapEntryNode);
final MpReachNlri mpReach = new MpReachNlriBuilder().setAfi(Ipv4AddressFamily.class).setSafi(UnicastSubsequentAddressFamily.class).setCNextHop(nextHop).setAdvertizedRoutes(new AdvertizedRoutesBuilder().build()).build();
final Attributes attMpR = new AttributesBuilder().addAugmentation(new AttributesReachBuilder().setMpReachNlri(mpReach).build()).build();
assertEquals(new UpdateBuilder().setAttributes(attMpR).build(), this.ribSupportTestImp.buildUpdate(routes, Collections.emptySet(), attr));
final MpUnreachNlri mpUnreach = new MpUnreachNlriBuilder().setAfi(Ipv4AddressFamily.class).setSafi(UnicastSubsequentAddressFamily.class).setWithdrawnRoutes(new WithdrawnRoutesBuilder().build()).build();
final Attributes attMpU = new AttributesBuilder().addAugmentation(new AttributesUnreachBuilder().setMpUnreachNlri(mpUnreach).build()).build();
assertEquals(new UpdateBuilder().setAttributes(attMpU).build(), this.ribSupportTestImp.buildUpdate(Collections.emptySet(), routes, attr));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.attributes.unreach.mp.unreach.nlri.WithdrawnRoutesBuilder in project bgpcep by opendaylight.
the class AbstractRIBSupportTest method createNlriWithDrawnRoute.
protected final ContainerNode createNlriWithDrawnRoute(final DestinationType destUnreach) {
final MpUnreachNlri mpReach = new MpUnreachNlriBuilder().setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(destUnreach).build()).build();
final Map.Entry<YangInstanceIdentifier, NormalizedNode> result = this.adapter.currentSerializer().toNormalizedNode(MP_UNREACH_IID, mpReach);
return (ContainerNode) result.getValue();
}
Aggregations