use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180321.NeighborAfiSafiGracefulRestartStateAugmentationBuilder in project bgpcep by opendaylight.
the class NeighborUtilTest method buildAfisSafisState.
@Test
public void buildAfisSafisState() {
assertEquals(Collections.emptyList(), NeighborUtil.buildAfisSafisState(this.bgpAfiSafiState, this.tableRegistry));
final GracefulRestart graceful = new GracefulRestartBuilder().setState(new StateBuilder().addAugmentation(NeighborAfiSafiGracefulRestartStateAugmentation.class, new NeighborAfiSafiGracefulRestartStateAugmentationBuilder().setAdvertised(false).setReceived(false).build()).build()).build();
final org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.State afiSafiState = new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.StateBuilder().addAugmentation(NeighborAfiSafiStateAugmentation.class, new NeighborAfiSafiStateAugmentationBuilder().setActive(false).build()).build();
this.afiSafi = Optional.of(IPV4UNICAST.class);
final AfiSafi expected = new AfiSafiBuilder().setAfiSafiName(this.afiSafi.get()).setState(afiSafiState).setGracefulRestart(graceful).build();
assertEquals(Collections.singletonList(expected), NeighborUtil.buildAfisSafisState(this.bgpAfiSafiState, this.tableRegistry));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180321.NeighborAfiSafiGracefulRestartStateAugmentationBuilder in project bgpcep by opendaylight.
the class StateProviderImplTest method buildAfiSafis.
private static AfiSafis buildAfiSafis() {
final NeighborAfiSafiStateAugmentationBuilder neighborAfiSafiStateAugmentation = new NeighborAfiSafiStateAugmentationBuilder().setActive(true).setPrefixes(new PrefixesBuilder().setSent(1L).setReceived(2L).setInstalled(1L).build());
final AfiSafi afiSafi = new AfiSafiBuilder().setAfiSafiName(IPV4UNICAST.class).setGracefulRestart(new GracefulRestartBuilder().setState(new StateBuilder().setEnabled(false).addAugmentation(NeighborAfiSafiGracefulRestartStateAugmentation.class, new NeighborAfiSafiGracefulRestartStateAugmentationBuilder().setAdvertised(true).setReceived(true).build()).build()).build()).setState(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.StateBuilder().setEnabled(false).addAugmentation(NeighborAfiSafiStateAugmentation.class, neighborAfiSafiStateAugmentation.build()).build()).build();
return new AfiSafisBuilder().setAfiSafi(Collections.singletonList(afiSafi)).build();
}
Aggregations