[Cardinal] Add builders for Intents and remove extra constructors.
Starting with PointToPoint intent to see how it looks
Change-Id: I5366a05d657ceaad18c03b95cd71f5d1107200e2
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/phase/CompilingTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/phase/CompilingTest.java
index 11a6e6e..d450812 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/phase/CompilingTest.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/phase/CompilingTest.java
@@ -90,7 +90,13 @@
Intent.bindIdGenerator(idGenerator);
// Intent creation should be placed after binding an ID generator
- input = new PointToPointIntent(appId, selector, treatment, cp1, cp3);
+ input = PointToPointIntent.builder()
+ .appId(appId)
+ .selector(selector)
+ .treatment(treatment)
+ .ingressPoint(cp1)
+ .egressPoint(cp3)
+ .build();
compiled = new PathIntent(appId, selector, treatment, path);
}
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/phase/InstallCoordinatingTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/phase/InstallCoordinatingTest.java
index cad6768..678bd2d 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/phase/InstallCoordinatingTest.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/phase/InstallCoordinatingTest.java
@@ -91,7 +91,13 @@
Intent.bindIdGenerator(idGenerator);
// Intent creation should be placed after binding an ID generator
- input = new PointToPointIntent(appId, selector, treatment, cp1, cp3);
+ input = PointToPointIntent.builder()
+ .appId(appId)
+ .selector(selector)
+ .treatment(treatment)
+ .ingressPoint(cp1)
+ .egressPoint(cp3)
+ .build();
compiled = new PathIntent(appId, selector, treatment, path);
}
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/phase/InstallingTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/phase/InstallingTest.java
index 89c797c..b7d063f 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/phase/InstallingTest.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/phase/InstallingTest.java
@@ -91,7 +91,13 @@
Intent.bindIdGenerator(idGenerator);
// Intent creation should be placed after binding an ID generator
- input = new PointToPointIntent(appId, selector, treatment, cp1, cp3);
+ input = PointToPointIntent.builder()
+ .appId(appId)
+ .selector(selector)
+ .treatment(treatment)
+ .ingressPoint(cp1)
+ .egressPoint(cp3)
+ .build();
compiled = new PathIntent(appId, selector, treatment, path);
}
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/phase/WithdrawCoordinatingTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/phase/WithdrawCoordinatingTest.java
index f5dbf58..19c3f6f 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/phase/WithdrawCoordinatingTest.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/phase/WithdrawCoordinatingTest.java
@@ -92,7 +92,13 @@
Intent.bindIdGenerator(idGenerator);
// Intent creation should be placed after binding an ID generator
- input = new PointToPointIntent(appId, selector, treatment, cp1, cp3);
+ input = PointToPointIntent.builder()
+ .appId(appId)
+ .selector(selector)
+ .treatment(treatment)
+ .ingressPoint(cp1)
+ .egressPoint(cp3)
+ .build();
compiled = new PathIntent(appId, selector, treatment, path);
}
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/phase/WithdrawingTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/phase/WithdrawingTest.java
index 1861ae5..a1f08ec 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/phase/WithdrawingTest.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/phase/WithdrawingTest.java
@@ -90,7 +90,13 @@
Intent.bindIdGenerator(idGenerator);
// Intent creation should be placed after binding an ID generator
- input = new PointToPointIntent(appId, selector, treatment, cp1, cp3);
+ input = PointToPointIntent.builder()
+ .appId(appId)
+ .selector(selector)
+ .treatment(treatment)
+ .ingressPoint(cp1)
+ .egressPoint(cp3)
+ .build();
compiled = new PathIntent(appId, selector, treatment, path);
}