private static final Logger LOG = LoggerFactory.getLogger(EvpnRibSupport.class);
private static final NodeIdentifier NLRI_ROUTES_LIST = NodeIdentifier.create(EvpnDestination.QNAME);
- private static final EvpnRoutes EMPTY_CONTAINER
- = new EvpnRoutesBuilder().setEvpnRoute(Collections.emptyList()).build();
+ private static final EvpnRoutes EMPTY_CONTAINER = new EvpnRoutesBuilder().build();
private static EvpnRibSupport SINGLETON;
private EvpnRibSupport(final BindingNormalizedNodeSerializer mappingService) {
keys.add(routeKey);
}
return keys;
- } else {
- LOG.warn("Routes {} are not a map", routes);
}
+ LOG.warn("Routes {} are not a map", routes);
}
}
return Collections.emptyList();
import io.netty.buffer.Unpooled;
import java.util.Collection;
import java.util.Collections;
+import java.util.Map;
import org.junit.Assert;
import org.junit.Test;
import org.opendaylight.protocol.bgp.evpn.impl.nlri.EvpnNlriParser;
ROUTE = new EvpnRouteBuilder().setRouteKey(ROUTE_KEY.getRouteKey())
.setPathId(ROUTE_KEY.getPathId())
.setAttributes(ATTRIBUTES).setRouteDistinguisher(RD).setEvpnChoice(ETHERNET_AD_ROUTE_CASE).build();
- EVPN_ROUTES = new EvpnRoutesBuilder().setEvpnRoute(Collections.singletonList(ROUTE)).build();
+ EVPN_ROUTES = new EvpnRoutesBuilder().setEvpnRoute(Map.of(ROUTE.key(), ROUTE)).build();
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.evpn.rev200120.update.attributes.mp.reach.nlri.advertized.routes.destination.type.destination.evpn._case.DestinationEvpnBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.Attributes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev200120.path.attributes.AttributesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.Attributes1;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.Attributes1Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.Attributes2;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.Attributes2Builder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.update.attributes.MpReachNlri;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev180329.update.attributes.MpReachNlriBuilder;
@Test
public void testAttributes1() throws BGPParsingException {
final ByteBuf buffer = Unpooled.buffer();
- final Attributes att = new AttributesBuilder().addAugmentation(Attributes1.class,
- new Attributes1Builder().setMpReachNlri(createReach()).build()).build();
+ final Attributes att = new AttributesBuilder()
+ .addAugmentation(new Attributes1Builder().setMpReachNlri(createReach()).build())
+ .build();
this.parser.serializeAttribute(att, buffer);
Assert.assertArrayEquals(IncMultEthTagRParserTest.RESULT, ByteArray.getAllBytes(buffer));
}
@Test
public void testAttributes2() throws BGPParsingException {
final ByteBuf buffer = Unpooled.buffer();
- final Attributes att = new AttributesBuilder().addAugmentation(Attributes2.class,
- new Attributes2Builder().setMpUnreachNlri(createUnreach()).build()).build();
+ final Attributes att = new AttributesBuilder()
+ .addAugmentation(new Attributes2Builder().setMpUnreachNlri(createUnreach()).build())
+ .build();
this.parser.serializeAttribute(att, buffer);
Assert.assertArrayEquals(IncMultEthTagRParserTest.RESULT, ByteArray.getAllBytes(buffer));
}