vol-376 add curciut and rmeote ID
Change-Id: Iff55c9e724571813187f10fd9bf54b3c2bd559ad
diff --git a/app/src/test/java/org/opencord/sadis/impl/SadisManagerTest.java b/app/src/test/java/org/opencord/sadis/impl/SadisManagerTest.java
index 70cfa23..3101f40 100644
--- a/app/src/test/java/org/opencord/sadis/impl/SadisManagerTest.java
+++ b/app/src/test/java/org/opencord/sadis/impl/SadisManagerTest.java
@@ -85,12 +85,14 @@
List<SubscriberAndDeviceInformation> entries = config.getEntries();
assertEquals(3, entries.size());
assertTrue(SubscriberAndDeviceInformationBuilder.build("1", (short) 2, (short) 2, "1/1/2", (short) 125,
- (short) 3, "aa:bb:cc:dd:ee:ff", "XXX-NASID", "10.10.10.10").checkEquals(entries.get(0)));
+ (short) 3, "aa:bb:cc:dd:ee:ff", "XXX-NASID", "10.10.10.10", "circuit123", "remote123")
+ .checkEquals(entries.get(0)));
assertTrue(SubscriberAndDeviceInformationBuilder.build("2", (short) 4, (short) 4, "1/1/2", (short) 129,
- (short) 4, "aa:bb:cc:dd:ee:ff", "YYY-NASID", "1.1.1.1").checkEquals(entries.get(1)));
+ (short) 4, "aa:bb:cc:dd:ee:ff", "YYY-NASID", "1.1.1.1", "circuit234", "remote234")
+ .checkEquals(entries.get(1)));
assertTrue(SubscriberAndDeviceInformationBuilder.build("cc:dd:ee:ff:aa:bb", (short) -1, (short) -1, null,
- (short) -1,
- (short) -1, "cc:dd:ee:ff:aa:bb", "CCC-NASID", "12.12.12.12").checkEquals(entries.get(2)));
+ (short) -1, (short) -1, "cc:dd:ee:ff:aa:bb", "CCC-NASID", "12.12.12.12", "circuit345", "remote345")
+ .checkEquals(entries.get(2)));
}
@@ -99,8 +101,8 @@
private static final class SubscriberAndDeviceInformationBuilder extends SubscriberAndDeviceInformation {
public static SubscriberAndDeviceInformationBuilder build(String id, short cTag, short sTag, String nasPortId,
- short port, short slot, String mac, String nasId, String ipAddress) {
- //SubscriberAndDeviceInformation info = new SubscriberAndDeviceInformation();
+ short port, short slot, String mac, String nasId, String ipAddress, String circuitId, String remoteId) {
+
SubscriberAndDeviceInformationBuilder info = new SubscriberAndDeviceInformationBuilder();
info.setId(id);
if (cTag != -1) {
@@ -119,6 +121,8 @@
info.setHardwareIdentifier(MacAddress.valueOf(mac));
info.setIPAddress(Ip4Address.valueOf(ipAddress));
info.setNasId(nasId);
+ info.setCircuitId(circuitId);
+ info.setRemoteId(remoteId);
return info;
}
@@ -181,6 +185,20 @@
if (this.slot() != other.slot()) {
return false;
}
+ if (this.circuitId() == null) {
+ if (other.circuitId() != null) {
+ return false;
+ }
+ } else if (!this.circuitId().equals(other.circuitId())) {
+ return false;
+ }
+ if (this.remoteId() == null) {
+ if (other.remoteId() != null) {
+ return false;
+ }
+ } else if (!this.remoteId().equals(other.remoteId())) {
+ return false;
+ }
return true;
}
}
diff --git a/app/src/test/resources/config.json b/app/src/test/resources/config.json
new file mode 100644
index 0000000..c6b8f37
--- /dev/null
+++ b/app/src/test/resources/config.json
@@ -0,0 +1,52 @@
+{
+ "integration":
+ {
+ "url": "http://localhost:8090",
+ "cache":
+ {
+ "enabled": true,
+ "maxsize": 50,
+ "ttl": "PT1m"
+ }
+ },
+
+ "entries":
+ [
+ {
+ "id": "1",
+ "cTag": 2,
+ "sTag": 2,
+ "nasPortId": "1/1/2",
+ "port": 125,
+ "slot": 3,
+ "hardwareIdentifier": "aa:bb:cc:dd:ee:ff",
+ "ipAddress":"10.10.10.10",
+ "nasId":"XXX-NASID",
+ "circuitId":"circuit123",
+ "remoteId":"remote123"
+ },
+
+ {
+ "id": "2",
+ "cTag": 4,
+ "sTag": 4,
+ "nasPortId": "1/1/2",
+ "port": 129,
+ "slot": 4,
+ "hardwareIdentifier": "aa:bb:cc:dd:ee:ff",
+ "ipAddress":"1.1.1.1",
+ "nasId":"YYY-NASID",
+ "circuitId":"circuit234",
+ "remoteId":"remote234"
+ },
+
+ {
+ "id": "cc:dd:ee:ff:aa:bb",
+ "hardwareIdentifier": "cc:dd:ee:ff:aa:bb",
+ "ipAddress":"12.12.12.12",
+ "nasId":"CCC-NASID",
+ "circuitId":"circuit345",
+ "remoteId":"remote345"
+ }
+ ]
+}