use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180321.GlobalAddPathsConfigBuilder in project bgpcep by opendaylight.
the class OpenConfigMappingUtilTest method toPathSelectionMode.
@Test
public void toPathSelectionMode() {
final List<AfiSafi> families = new ArrayList<>();
families.add(new AfiSafiBuilder().setAfiSafiName(IPV4UNICAST.class).addAugmentation(GlobalAddPathsConfig.class, new GlobalAddPathsConfigBuilder().setSendMax(Shorts.checkedCast(N_PATHS)).build()).build());
families.add(new AfiSafiBuilder().setAfiSafiName(IPV6UNICAST.class).addAugmentation(GlobalAddPathsConfig.class, new GlobalAddPathsConfigBuilder().setSendMax(Shorts.checkedCast(ALL_PATHS)).build()).build());
final Map<BgpTableType, PathSelectionMode> result = OpenConfigMappingUtil.toPathSelectionMode(families, this.tableTypeRegistry, PEER_TRACKER);
final Map<BgpTableType, PathSelectionMode> expected = new HashMap<>();
expected.put(new BgpTableTypeImpl(Ipv4AddressFamily.class, UnicastSubsequentAddressFamily.class), ADD_PATH_BEST_N_PATH_SELECTION);
expected.put(new BgpTableTypeImpl(Ipv6AddressFamily.class, UnicastSubsequentAddressFamily.class), ADD_PATH_BEST_ALL_PATH_SELECTION);
assertEquals(expected.get(0), result.get(0));
assertEquals(expected.get(1), result.get(1));
}
Aggregations