use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.network.instance.protocol.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(new GlobalAddPathsConfigBuilder().setSendMax(N_PATHS).build()).build());
families.add(new AfiSafiBuilder().setAfiSafiName(IPV6UNICAST.class).addAugmentation(new GlobalAddPathsConfigBuilder().setSendMax(ALL_PATHS).build()).build());
final Map<BgpTableType, PathSelectionMode> result = OpenConfigMappingUtil.toPathSelectionMode(families, tableTypeRegistry);
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);
// FIXME: these assertions are wrong, as they perform lookup on non-existing keys
assertEquals(expected.get(0), result.get(0));
assertEquals(expected.get(1), result.get(1));
}
Aggregations