Use predictable map in test 96/90796/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 29 Jun 2020 04:39:13 +0000 (06:39 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 29 Jun 2020 04:39:13 +0000 (06:39 +0200)
UnrecognizedAttributesSerializerTest fails sporadically due to
Map's order instability. Use ImmutableMap, which guarantees iteration
order.

Change-Id: Idb0a42e72e82975799ace19c56619d6c87364100
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bgp/parser-impl/src/test/java/org/opendaylight/protocol/bgp/parser/impl/message/update/UnrecognizedAttributesSerializerTest.java

index 1a57f4636a0e9a038e4771c78763bf2792cdfe79..8c6ec2f5fbc02dce9d39188c45e4e5b6b8a4a826 100644 (file)
@@ -9,9 +9,9 @@ package org.opendaylight.protocol.bgp.parser.impl.message.update;
 
 import static org.junit.Assert.assertArrayEquals;
 
+import com.google.common.collect.ImmutableMap;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import java.util.Map;
 import org.junit.Test;
 import org.opendaylight.protocol.bgp.parser.spi.pojo.ServiceLoaderBGPExtensionProviderContext;
 import org.opendaylight.protocol.util.ByteArray;
@@ -41,7 +41,7 @@ public class UnrecognizedAttributesSerializerTest {
         final UnrecognizedAttributes unrecognizedAttribute2 = new UnrecognizedAttributesBuilder().setPartial(true)
                 .setTransitive(true).setType(Uint8.valueOf(102)).setValue(unrecognizedValue2).build();
         final Attributes attrs = new AttributesBuilder()
-                .setUnrecognizedAttributes(Map.of(unrecognizedAttribute1.key(), unrecognizedAttribute1,
+                .setUnrecognizedAttributes(ImmutableMap.of(unrecognizedAttribute1.key(), unrecognizedAttribute1,
                     unrecognizedAttribute2.key(), unrecognizedAttribute2)).build();
 
         final ByteBuf buffer = Unpooled.buffer();