Encode with Base64 Linkstate route key 59/77659/2
authorClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Fri, 9 Nov 2018 15:03:11 +0000 (16:03 +0100)
committerRobert Varga <nite@hq.sk>
Wed, 21 Nov 2018 11:09:28 +0000 (11:09 +0000)
Change-Id: Ib9e9803d6c8287dffb97e9c89b5e975db60bc979
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
bgp/extensions/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/impl/LinkstateRIBSupport.java
bgp/extensions/linkstate/src/test/java/org/opendaylight/protocol/bgp/linkstate/LinkstateRIBSupportTest.java

index 42438199d6870f20e554b0a6ac9351bb652a6605..222cfb25ee396e8bd215b521d05dfca6da9abb91 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.protocol.bgp.linkstate.impl;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
@@ -86,7 +85,7 @@ public final class LinkstateRIBSupport
         final Optional<DataContainerChild<? extends PathArgument, ?>> maybePathIdLeaf =
                 linkstate.getChild(routePathIdNid());
         return PathIdUtil.createNidKey(routeQName(), routeKeyQName(),
-                pathIdQName(), Arrays.toString(ByteArray.readAllBytes(buffer)), maybePathIdLeaf);
+                pathIdQName(), ByteArray.encodeBase64(buffer), maybePathIdLeaf);
     }
 
     private static List<CLinkstateDestination> extractRoutes(final Collection<MapEntryNode> routes) {
index 7858d17898641663c51b2153e0caa4efa75f2297..4ef74b6a55049344f7ac3f1ced431ff55db273fd 100644 (file)
@@ -107,8 +107,7 @@ public final class LinkstateRIBSupportTest extends AbstractRIBSupportTest<Linkst
         assertEquals(LinkstateSubsequentAddressFamily.class, context.getSubsequentAddressFamilyRegistry().classForFamily(71));
         final ByteBuf buffer = Unpooled.buffer();
         SimpleNlriTypeRegistry.getInstance().serializeNlriType(LINKSTATE_DESTINATION, buffer);
-        final byte[] arrayKey = ByteArray.readAllBytes(buffer);
-        ROUTE_KEY = new LinkstateRouteKey(PATH_ID, Arrays.toString(arrayKey));
+        ROUTE_KEY = new LinkstateRouteKey(PATH_ID, ByteArray.encodeBase64(buffer));
         ROUTE = new LinkstateRouteBuilder().withKey(ROUTE_KEY).setRouteDistinguisher(RD)
                 .setIdentifier(ID).setObjectType(OBJECT_TYPE2)
                 .setProtocolId(ProtocolId.IsisLevel1).setAttributes(new AttributesBuilder().build()).build();