[ONOS-4718] Initial implementation of LISP address deserializer
Change-Id: I522e16e7fd197380cf4c99038561fe9aa8f93730
diff --git a/protocols/lisp/msg/src/test/java/org/onosproject/lisp/msg/types/LispSourceDestLcafAddressTest.java b/protocols/lisp/msg/src/test/java/org/onosproject/lisp/msg/types/LispSourceDestLcafAddressTest.java
index 8296b43..e212a1c 100644
--- a/protocols/lisp/msg/src/test/java/org/onosproject/lisp/msg/types/LispSourceDestLcafAddressTest.java
+++ b/protocols/lisp/msg/src/test/java/org/onosproject/lisp/msg/types/LispSourceDestLcafAddressTest.java
@@ -35,20 +35,44 @@
@Before
public void setup() {
+ LispSourceDestLcafAddress.SourceDestAddressBuilder builder1 =
+ new LispSourceDestLcafAddress.SourceDestAddressBuilder();
+
LispIpv4Address srcAddress1 = new LispIpv4Address(IpAddress.valueOf("192.168.1.1"));
LispIpv4Address dstAddress1 = new LispIpv4Address(IpAddress.valueOf("192.168.1.2"));
- address1 = new LispSourceDestLcafAddress((short) 1, (byte) 0x01,
- (byte) 0x01, srcAddress1, dstAddress1);
+ address1 = builder1
+ .withReserved((short) 1)
+ .withSrcMaskLength((byte) 0x01)
+ .withDstMaskLength((byte) 0x01)
+ .withSrcPrefix(srcAddress1)
+ .withDstPrefix(dstAddress1)
+ .build();
- sameAsAddress1 = new LispSourceDestLcafAddress((short) 1, (byte) 0x01,
- (byte) 0x01, srcAddress1, dstAddress1);
+ LispSourceDestLcafAddress.SourceDestAddressBuilder builder2 =
+ new LispSourceDestLcafAddress.SourceDestAddressBuilder();
+
+ sameAsAddress1 = builder2
+ .withReserved((short) 1)
+ .withSrcMaskLength((byte) 0x01)
+ .withDstMaskLength((byte) 0x01)
+ .withSrcPrefix(srcAddress1)
+ .withDstPrefix(dstAddress1)
+ .build();
+
+ LispSourceDestLcafAddress.SourceDestAddressBuilder builder3 =
+ new LispSourceDestLcafAddress.SourceDestAddressBuilder();
LispIpv4Address srcAddress2 = new LispIpv4Address(IpAddress.valueOf("192.168.2.1"));
LispIpv4Address dstAddress2 = new LispIpv4Address(IpAddress.valueOf("192.168.2.2"));
- address2 = new LispSourceDestLcafAddress((short) 2, (byte) 0x02,
- (byte) 0x02, srcAddress2, dstAddress2);
+ address2 = builder3
+ .withReserved((short) 2)
+ .withSrcMaskLength((byte) 0x02)
+ .withDstMaskLength((byte) 0x02)
+ .withSrcPrefix(srcAddress2)
+ .withDstPrefix(dstAddress2)
+ .build();
}
@Test