use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.RouteReflectorBuilder in project bgpcep by opendaylight.
the class OpenConfigMappingUtilTest method toPeerRole.
@Test
public void toPeerRole() {
Neighbor neighbor = new NeighborBuilder().setConfig(new ConfigBuilder().setPeerType(PeerType.EXTERNAL).build()).build();
PeerRole peerRoleResult = OpenConfigMappingUtil.toPeerRole(neighbor);
Assert.assertEquals(PeerRole.Ebgp, peerRoleResult);
neighbor = new NeighborBuilder().setConfig(new ConfigBuilder().setPeerType(PeerType.INTERNAL).build()).build();
peerRoleResult = OpenConfigMappingUtil.toPeerRole(neighbor);
Assert.assertEquals(PeerRole.Ibgp, peerRoleResult);
neighbor = new NeighborBuilder().setRouteReflector(new RouteReflectorBuilder().setConfig(new org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbor.group.route.reflector.ConfigBuilder().setRouteReflectorClient(true).build()).build()).build();
peerRoleResult = OpenConfigMappingUtil.toPeerRole(neighbor);
Assert.assertEquals(PeerRole.RrClient, peerRoleResult);
}
Aggregations