Bug-2848: BGP-LS EPE extension: Peer Sid
[bgpcep.git] / bgp / linkstate / src / test / java / org / opendaylight / protocol / bgp / linkstate / SrAttributeParserTest.java
index 162b243ae79eb94f8d4703effa04108cfed83ace..448551c9222b27ba232785b3b4a51f35e4773890 100644 (file)
@@ -179,17 +179,17 @@ public class SrAttributeParserTest {
 
     @Test
     public void testSrAdjId() {
-        final byte[] tested = { (byte)-80, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 };
+        final byte[] tested = { (byte)-80, 10, 1, 24, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 };
         final byte[] sidLabel = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 };
         final SrAdjId srAdjId = new SrAdjIdBuilder().setFlags(new AdjacencyFlags(Boolean.TRUE, Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, Boolean.TRUE)).setWeight(new Weight((short) 10)).setSid(new SidLabel(sidLabel)).build();
         final ByteBuf serializedData = SrLinkAttributesParser.serializeAdjacencySegmentIdentifier(srAdjId);
-        assertEquals(srAdjId, SrLinkAttributesParser.parseAdjacencySegmentIdentifier(Unpooled.wrappedBuffer(tested)));
+        assertEquals(srAdjId, new SrAdjIdBuilder(SrLinkAttributesParser.parseAdjacencySegmentIdentifier(Unpooled.wrappedBuffer(tested))).build());
         assertArrayEquals(tested, ByteArray.readAllBytes(serializedData));
     }
 
     @Test
     public void testSrLanAdjId() {
-        final byte[] tested = { (byte)-80, 10, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 };
+        final byte[] tested = { (byte)-80, 10, 1, 2, 3, 4, 5, 6, 1, 24, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 };
         final byte[] sidLabel = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 };
         final byte[] systemId = { 1, 2, 3, 4, 5, 6 };
         final SrLanAdjId srLanAdjId = new SrLanAdjIdBuilder().setFlags(new AdjacencyFlags(Boolean.TRUE, Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, Boolean.TRUE)).setWeight(new Weight((short)10)).setIsoSystemId(new IsoSystemIdentifier(systemId)).setSid(new SidLabel(sidLabel)).build();