Cleanup deprecation warnings in bgp/extensions/l3vpn 84/90784/1
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 27 Jun 2020 09:29:56 +0000 (11:29 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 27 Jun 2020 09:29:56 +0000 (11:29 +0200)
Eliminate some leftovers from codegen change.

Change-Id: I6f81e7a59020f512c68a9cddb84c78bd5c33d275
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bgp/extensions/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/mcast/L3VpnMcastIpv4RIBSupport.java
bgp/extensions/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/mcast/L3VpnMcastIpv6RIBSupport.java
bgp/extensions/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/unicast/ipv4/VpnIpv4RIBSupport.java
bgp/extensions/l3vpn/src/main/java/org/opendaylight/protocol/bgp/l3vpn/unicast/ipv6/VpnIpv6RIBSupport.java
bgp/extensions/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/mcast/L3vpnMcastIpv4RIBSupportTest.java
bgp/extensions/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/mcast/L3vpnMcastIpv6RIBSupportTest.java
bgp/extensions/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/unicast/ipv4/VpnIpv4NlriParserTest.java
bgp/extensions/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/unicast/ipv4/VpnIpv4RIBSupportTest.java
bgp/extensions/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/unicast/ipv6/VpnIpv6NlriParserTest.java
bgp/extensions/l3vpn/src/test/java/org/opendaylight/protocol/bgp/l3vpn/unicast/ipv6/VpnIpv6RIBSupportTest.java

index 2a1a33a494453129577b01ff8d5cb2f4aa338a57..351b6c8f47c847dc61a2737dde913698d4493a53 100644 (file)
@@ -48,8 +48,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListEntryNode;
  */
 public final class L3VpnMcastIpv4RIBSupport
         extends AbstractL3vpnMcastIpRIBSupport<L3vpnMcastRoutesIpv4Case, L3vpnMcastRoutesIpv4> {
-    private static final L3vpnMcastRoutesIpv4 EMPTY_CONTAINER
-            = new L3vpnMcastRoutesIpv4Builder().setL3vpnMcastRoute(Collections.emptyList()).build();
+    private static final L3vpnMcastRoutesIpv4 EMPTY_CONTAINER = new L3vpnMcastRoutesIpv4Builder().build();
     private static L3VpnMcastIpv4RIBSupport SINGLETON;
 
 
index 61fc805c3c37b626438e86342d0aaea43b2bc1b3..d354169470de089aed94360aea4513f6782bf60e 100644 (file)
@@ -48,8 +48,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListEntryNode;
  */
 public final class L3VpnMcastIpv6RIBSupport
         extends AbstractL3vpnMcastIpRIBSupport<L3vpnMcastRoutesIpv6Case, L3vpnMcastRoutesIpv6> {
-    private static final L3vpnMcastRoutesIpv6 EMPTY_CONTAINER
-            = new L3vpnMcastRoutesIpv6Builder().setL3vpnMcastRoute(Collections.emptyList()).build();
+    private static final L3vpnMcastRoutesIpv6 EMPTY_CONTAINER = new L3vpnMcastRoutesIpv6Builder().build();
     private static L3VpnMcastIpv6RIBSupport SINGLETON;
 
 
index 46b1ca2caf5f1c65c35947287bc86dc71b27a045..671cd0820e1ee2854fd794b109bc99ac62572d75 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.protocol.bgp.l3vpn.unicast.ipv4;
 
 import static com.google.common.base.Verify.verify;
 
-import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
@@ -29,8 +28,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.rev180329.l3vpn.ip.route.VpnRouteKey;
 
 public final class VpnIpv4RIBSupport extends AbstractVpnRIBSupport<VpnIpv4RoutesCase, VpnIpv4Routes> {
-    private static final VpnIpv4Routes EMPTY_CONTAINER
-            = new VpnIpv4RoutesBuilder().setVpnRoute(Collections.emptyList()).build();
+    private static final VpnIpv4Routes EMPTY_CONTAINER = new VpnIpv4RoutesBuilder().build();
     private static VpnIpv4RIBSupport SINGLETON;
 
     /**
index 3e0767cc47db4d0bd2f271a363c0c80a406c608e..415f0347dec9fe0238d3d3c3420ae20f1f9d8ecc 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.protocol.bgp.l3vpn.unicast.ipv6;
 
 import static com.google.common.base.Verify.verify;
 
-import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
@@ -29,8 +28,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.vpn.rev180329.l3vpn.ip.route.VpnRouteKey;
 
 public final class VpnIpv6RIBSupport extends AbstractVpnRIBSupport<VpnIpv6RoutesCase, VpnIpv6Routes> {
-    private static final VpnIpv6Routes EMPTY_CONTAINER
-            = new VpnIpv6RoutesBuilder().setVpnRoute(Collections.emptyList()).build();
+    private static final VpnIpv6Routes EMPTY_CONTAINER = new VpnIpv6RoutesBuilder().build();
     private static VpnIpv6RIBSupport SINGLETON;
 
     /**
index 6d8ab7003eec54653324bf83464449679f2469b1..57f6a5ab34c6456d0fcd69a1f7d0174827a3d040 100644 (file)
@@ -15,7 +15,7 @@ import static org.junit.Assert.assertTrue;
 import com.google.common.collect.ImmutableSet;
 import java.util.Collection;
 import java.util.Collections;
-import org.junit.Assert;
+import java.util.Map;
 import org.junit.Test;
 import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
 import org.opendaylight.protocol.bgp.rib.spi.AbstractRIBSupportTest;
@@ -46,6 +46,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode;
@@ -65,8 +67,9 @@ public class L3vpnMcastIpv4RIBSupportTest extends AbstractRIBSupportTest<L3vpnMc
             .setRouteDistinguisher(RD)
             .setPrefix(IPV4_PREFIX)
             .build();
-    private static final L3vpnMcastRoutesIpv4 MCAST_L3VPN_ROUTES
-            = new L3vpnMcastRoutesIpv4Builder().setL3vpnMcastRoute(Collections.singletonList(ROUTE)).build();
+    private static final L3vpnMcastRoutesIpv4 MCAST_L3VPN_ROUTES = new L3vpnMcastRoutesIpv4Builder()
+            .setL3vpnMcastRoute(Map.of(ROUTE.key(), ROUTE))
+            .build();
 
     private static final L3vpnMcastDestination MCAST_L3VPN_DESTINATION = new L3vpnMcastDestinationBuilder()
             .setRouteDistinguisher(RD)
@@ -108,10 +111,9 @@ public class L3vpnMcastIpv4RIBSupportTest extends AbstractRIBSupportTest<L3vpnMc
         assertEquals(ROUTE, route);
     }
 
-
     @Test
     public void testEmptyRoute() {
-        Assert.assertEquals(createEmptyTable(), this.ribSupport.emptyTable());
+        assertEquals(createEmptyTable(), this.ribSupport.emptyTable());
     }
 
     @Test
@@ -134,23 +136,22 @@ public class L3vpnMcastIpv4RIBSupportTest extends AbstractRIBSupportTest<L3vpnMc
 
     @Test
     public void testCacheableNlriObjects() {
-        Assert.assertEquals(ImmutableSet.of(L3vpnMcastRoutesIpv4Case.class), this.ribSupport.cacheableNlriObjects());
+        assertEquals(ImmutableSet.of(L3vpnMcastRoutesIpv4Case.class), this.ribSupport.cacheableNlriObjects());
     }
 
     @Test
     public void testCacheableAttributeObjects() {
-        Assert.assertEquals(ImmutableSet.of(), this.ribSupport.cacheableAttributeObjects());
+        assertEquals(ImmutableSet.of(), this.ribSupport.cacheableAttributeObjects());
     }
 
     @Test
     public void testRouteIdAddPath() {
-        Assert.assertEquals(ROUTE_KEY, this.ribSupport.createRouteListKey(ROUTE_KEY.getPathId(),
-            ROUTE_KEY.getRouteKey()));
+        assertEquals(ROUTE_KEY, this.ribSupport.createRouteListKey(ROUTE_KEY.getPathId(), ROUTE_KEY.getRouteKey()));
     }
 
     @Test
     public void testRoutePath() {
-        final YangInstanceIdentifier.NodeIdentifierWithPredicates prefixNii = createRouteNIWP(MCAST_L3VPN_ROUTES);
+        final NodeIdentifierWithPredicates prefixNii = createRouteNIWP(MCAST_L3VPN_ROUTES);
         final YangInstanceIdentifier expected = getRoutePath().node(prefixNii);
         final YangInstanceIdentifier actual = this.ribSupport.routePath(getTablePath(), prefixNii);
         assertEquals(expected, actual);
@@ -158,24 +159,24 @@ public class L3vpnMcastIpv4RIBSupportTest extends AbstractRIBSupportTest<L3vpnMc
 
     @Test
     public void testRouteAttributesIdentifier() {
-        Assert.assertEquals(new YangInstanceIdentifier.NodeIdentifier(
-                        Attributes.QNAME.withModule(BindingReflections.getQNameModule(L3vpnMcastRoutesIpv4Case.class))),
-                this.ribSupport.routeAttributesIdentifier());
+        assertEquals(new NodeIdentifier(Attributes.QNAME.bindTo(
+            BindingReflections.getQNameModule(L3vpnMcastRoutesIpv4Case.class))),
+            this.ribSupport.routeAttributesIdentifier());
     }
 
     @Test
     public void testRoutesCaseClass() {
-        Assert.assertEquals(L3vpnMcastRoutesIpv4Case.class, this.ribSupport.routesCaseClass());
+        assertEquals(L3vpnMcastRoutesIpv4Case.class, this.ribSupport.routesCaseClass());
     }
 
     @Test
     public void testRoutesContainerClass() {
-        Assert.assertEquals(L3vpnMcastRoutesIpv4.class, this.ribSupport.routesContainerClass());
+        assertEquals(L3vpnMcastRoutesIpv4.class, this.ribSupport.routesContainerClass());
     }
 
     @Test
     public void testRoutesListClass() {
-        Assert.assertEquals(L3vpnMcastRoute.class, this.ribSupport.routesListClass());
+        assertEquals(L3vpnMcastRoute.class, this.ribSupport.routesListClass());
     }
 
     @Test
index 1054f912c31692d6ec93274449c52bf90bbfcb69..50ad6d58cf59786132d11df77706de57ba71c613 100644 (file)
@@ -15,7 +15,7 @@ import static org.junit.Assert.assertTrue;
 import com.google.common.collect.ImmutableSet;
 import java.util.Collection;
 import java.util.Collections;
-import org.junit.Assert;
+import java.util.Map;
 import org.junit.Test;
 import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
 import org.opendaylight.protocol.bgp.rib.spi.AbstractRIBSupportTest;
@@ -46,6 +46,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.type
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidateNode;
@@ -66,7 +68,7 @@ public class L3vpnMcastIpv6RIBSupportTest extends AbstractRIBSupportTest<L3vpnMc
             .setPrefix(IPV6_PREFIX)
             .build();
     private static final L3vpnMcastRoutesIpv6 MCAST_L3VPN_ROUTES
-            = new L3vpnMcastRoutesIpv6Builder().setL3vpnMcastRoute(Collections.singletonList(ROUTE)).build();
+            = new L3vpnMcastRoutesIpv6Builder().setL3vpnMcastRoute(Map.of(ROUTE.key(), ROUTE)).build();
 
     private static final L3vpnMcastDestination MCAST_L3VPN_DESTINATION = new L3vpnMcastDestinationBuilder()
             .setRouteDistinguisher(RD)
@@ -111,7 +113,7 @@ public class L3vpnMcastIpv6RIBSupportTest extends AbstractRIBSupportTest<L3vpnMc
 
     @Test
     public void testEmptyRoute() {
-        Assert.assertEquals(createEmptyTable(), this.ribSupport.emptyTable());
+        assertEquals(createEmptyTable(), this.ribSupport.emptyTable());
     }
 
     @Test
@@ -134,23 +136,23 @@ public class L3vpnMcastIpv6RIBSupportTest extends AbstractRIBSupportTest<L3vpnMc
 
     @Test
     public void testCacheableNlriObjects() {
-        Assert.assertEquals(ImmutableSet.of(L3vpnMcastRoutesIpv6Case.class), this.ribSupport.cacheableNlriObjects());
+        assertEquals(ImmutableSet.of(L3vpnMcastRoutesIpv6Case.class), this.ribSupport.cacheableNlriObjects());
     }
 
     @Test
     public void testCacheableAttributeObjects() {
-        Assert.assertEquals(ImmutableSet.of(), this.ribSupport.cacheableAttributeObjects());
+        assertEquals(ImmutableSet.of(), this.ribSupport.cacheableAttributeObjects());
     }
 
     @Test
     public void testRouteIdAddPath() {
-        Assert.assertEquals(ROUTE_KEY, this.ribSupport.createRouteListKey(ROUTE_KEY.getPathId(),
+        assertEquals(ROUTE_KEY, this.ribSupport.createRouteListKey(ROUTE_KEY.getPathId(),
                 ROUTE_KEY.getRouteKey()));
     }
 
     @Test
     public void testRoutePath() {
-        final YangInstanceIdentifier.NodeIdentifierWithPredicates prefixNii = createRouteNIWP(MCAST_L3VPN_ROUTES);
+        final NodeIdentifierWithPredicates prefixNii = createRouteNIWP(MCAST_L3VPN_ROUTES);
         final YangInstanceIdentifier expected = getRoutePath().node(prefixNii);
         final YangInstanceIdentifier actual = this.ribSupport.routePath(getTablePath(), prefixNii);
         assertEquals(expected, actual);
@@ -158,24 +160,24 @@ public class L3vpnMcastIpv6RIBSupportTest extends AbstractRIBSupportTest<L3vpnMc
 
     @Test
     public void testRouteAttributesIdentifier() {
-        Assert.assertEquals(new YangInstanceIdentifier.NodeIdentifier(
-                        Attributes.QNAME.withModule(BindingReflections.getQNameModule(L3vpnMcastRoutesIpv6Case.class))),
-                this.ribSupport.routeAttributesIdentifier());
+        assertEquals(new NodeIdentifier(Attributes.QNAME.bindTo(
+            BindingReflections.getQNameModule(L3vpnMcastRoutesIpv6Case.class))),
+            this.ribSupport.routeAttributesIdentifier());
     }
 
     @Test
     public void testRoutesCaseClass() {
-        Assert.assertEquals(L3vpnMcastRoutesIpv6Case.class, this.ribSupport.routesCaseClass());
+        assertEquals(L3vpnMcastRoutesIpv6Case.class, this.ribSupport.routesCaseClass());
     }
 
     @Test
     public void testRoutesContainerClass() {
-        Assert.assertEquals(L3vpnMcastRoutesIpv6.class, this.ribSupport.routesContainerClass());
+        assertEquals(L3vpnMcastRoutesIpv6.class, this.ribSupport.routesContainerClass());
     }
 
     @Test
     public void testRoutesListClass() {
-        Assert.assertEquals(L3vpnMcastRoute.class, this.ribSupport.routesListClass());
+        assertEquals(L3vpnMcastRoute.class, this.ribSupport.routesListClass());
     }
 
     @Test
index b5c095aaa4afa705c275b756358be04d67b0f372..a8e0a277d6c7b76b7d783d46a6c990abc650d3ab 100644 (file)
@@ -24,9 +24,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev180329.labeled.unicast.LabelStack;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev180329.labeled.unicast.LabelStackBuilder;
 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;
@@ -115,11 +113,9 @@ public class VpnIpv4NlriParserTest {
         assertEquals(mpReachExpected, testBuilder.build());
 
         final ByteBuf output = Unpooled.buffer();
-        PARSER.serializeAttribute(
-            new AttributesBuilder().addAugmentation(Attributes1.class,
-                new Attributes1Builder().setMpReachNlri(mpReachExpected).build()
-            ).build(), output
-        );
+        PARSER.serializeAttribute(new AttributesBuilder()
+            .addAugmentation(new Attributes1Builder().setMpReachNlri(mpReachExpected).build())
+            .build(), output);
         assertArrayEquals(REACH_NLRI, ByteArray.readAllBytes(output));
     }
 
@@ -152,11 +148,9 @@ public class VpnIpv4NlriParserTest {
         assertEquals(mpUnreachExpected1, testBuilder.build());
 
         final ByteBuf output = Unpooled.buffer();
-        PARSER.serializeAttribute(
-            new AttributesBuilder().addAugmentation(Attributes2.class,
-                new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected2).build()
-            ).build(), output
-        );
+        PARSER.serializeAttribute(new AttributesBuilder()
+            .addAugmentation(new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected2).build())
+            .build(), output);
         assertArrayEquals(UNREACH_NLRI, ByteArray.readAllBytes(output));
     }
 }
index 4aff23e8839c90a9a77bbea30a29221dd3fefbe5..ccb5741a2a269f076b7555bb7813c2d2bd86ba03 100644 (file)
@@ -20,6 +20,7 @@ import static org.opendaylight.protocol.bgp.parser.spi.PathIdUtil.NON_PATH_ID;
 import com.google.common.collect.ImmutableSet;
 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.rib.spi.AbstractRIBSupportTest;
@@ -66,7 +67,7 @@ public class VpnIpv4RIBSupportTest extends AbstractRIBSupportTest<VpnIpv4RoutesC
             .setAttributes(ATTRIBUTES).setPrefix(IPV4_PREFIX)
         .setLabelStack(LABEL_STACK).setRouteDistinguisher(DISTINGUISHER).withKey(ROUTE_KEY).build();
     private static final VpnIpv4Routes ROUTES = new VpnIpv4RoutesBuilder()
-            .setVpnRoute(Collections.singletonList(ROUTE)).build();
+            .setVpnRoute(Map.of(ROUTE.key(), ROUTE)).build();
 
     @Override
     public void setUp() throws Exception {
index 94662500cc57ecca9e11f2f1e68b07eeff84edb5..c7d752e5a52104c0bb3bc8ba8a556a52dd5d0468 100644 (file)
@@ -24,9 +24,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev180329.labeled.unicast.LabelStack;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.labeled.unicast.rev180329.labeled.unicast.LabelStackBuilder;
 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;
@@ -115,11 +113,9 @@ public class VpnIpv6NlriParserTest {
         assertEquals(mpReachExpected, testBuilder.build());
 
         final ByteBuf output = Unpooled.buffer();
-        PARSER.serializeAttribute(
-            new AttributesBuilder().addAugmentation(Attributes1.class,
-                new Attributes1Builder().setMpReachNlri(mpReachExpected).build()
-            ).build(), output
-        );
+        PARSER.serializeAttribute(new AttributesBuilder()
+            .addAugmentation(new Attributes1Builder().setMpReachNlri(mpReachExpected).build())
+            .build(), output);
         assertArrayEquals(REACH_NLRI, ByteArray.readAllBytes(output));
     }
 
@@ -152,11 +148,9 @@ public class VpnIpv6NlriParserTest {
         assertEquals(mpUnreachExpected1, testBuilder.build());
 
         final ByteBuf output = Unpooled.buffer();
-        PARSER.serializeAttribute(
-            new AttributesBuilder().addAugmentation(Attributes2.class,
-                new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected2).build()
-            ).build(), output
-        );
+        PARSER.serializeAttribute(new AttributesBuilder()
+            .addAugmentation(new Attributes2Builder().setMpUnreachNlri(mpUnreachExpected2).build())
+            .build(), output);
         assertArrayEquals(UNREACH_NLRI, ByteArray.readAllBytes(output));
     }
 }
index acc5a38e66ec61caa56e9dacc98959263ec7b858..d9c2eeba9d128d493f455dcda44279814ae4b891 100644 (file)
@@ -19,6 +19,7 @@ import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Lists;
 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.rib.spi.AbstractRIBSupportTest;
@@ -65,7 +66,7 @@ public class VpnIpv6RIBSupportTest extends AbstractRIBSupportTest<VpnIpv6RoutesC
             .setAttributes(ATTRIBUTES).setPrefix(IPV6PREFIX)
             .setLabelStack(LABEL_STACK).setRouteDistinguisher(DISTINGUISHER).withKey(ROUTE_KEY).build();
     private static final VpnIpv6Routes ROUTES = new VpnIpv6RoutesBuilder()
-            .setVpnRoute(Collections.singletonList(ROUTE)).build();
+            .setVpnRoute(Map.of(ROUTE.key(), ROUTE)).build();
 
     @Override
     public void setUp() throws Exception {