Remove deprecated unfiltered connect point methods from multipoint to single point intents

Change-Id: I220a024568852d1f3168bac3f5cf47d0b3fd9d86
diff --git a/core/api/src/main/java/org/onosproject/net/intent/MultiPointToSinglePointIntent.java b/core/api/src/main/java/org/onosproject/net/intent/MultiPointToSinglePointIntent.java
index 6d68798..8745ecb 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/MultiPointToSinglePointIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/MultiPointToSinglePointIntent.java
@@ -176,42 +176,6 @@
         }
 
         /**
-         * Sets the ingress point of the single point to multi point intent
-         * that will be built.
-         *
-         * @param ingressPoints ingress connect points
-         * @return this builder
-         */
-        @Deprecated
-        public Builder ingressPoints(Set<ConnectPoint> ingressPoints) {
-            if (this.ingressPoints != null) {
-                log.warn("Ingress points are already set, " +
-                                 "this will override original ingress points.");
-            }
-            this.ingressPoints = ingressPoints.stream()
-                    .map(FilteredConnectPoint::new)
-                    .collect(Collectors.toSet());
-            return this;
-        }
-
-        /**
-         * Sets the egress point of the multi point to single point intent
-         * that will be built.
-         *
-         * @param egressPoint egress connect point
-         * @return this builder
-         */
-        @Deprecated
-        public Builder egressPoint(ConnectPoint egressPoint) {
-            if (this.egressPoint != null) {
-                log.warn("Egress point is already set, " +
-                                 "this will override original egress point.");
-            }
-            this.egressPoint = new FilteredConnectPoint(egressPoint);
-            return this;
-        }
-
-        /**
          * Sets the filtered ingress point of the single point to multi point intent
          * that will be built.
          *
diff --git a/core/api/src/test/java/org/onosproject/net/intent/MultiPointToSinglePointIntentTest.java b/core/api/src/test/java/org/onosproject/net/intent/MultiPointToSinglePointIntentTest.java
index 5603238..d4e3750 100644
--- a/core/api/src/test/java/org/onosproject/net/intent/MultiPointToSinglePointIntentTest.java
+++ b/core/api/src/test/java/org/onosproject/net/intent/MultiPointToSinglePointIntentTest.java
@@ -91,8 +91,8 @@
                 .appId(APPID)
                 .selector(MATCH)
                 .treatment(NOP)
-                .ingressPoints(PS1)
-                .egressPoint(P2)
+                .filteredIngressPoints(FPS1)
+                .filteredEgressPoint(FP2)
                 .build();
     }
 
@@ -102,8 +102,8 @@
                 .appId(APPID)
                 .selector(MATCH)
                 .treatment(NOP)
-                .ingressPoints(PS2)
-                .egressPoint(P1)
+                .filteredIngressPoints(FPS2)
+                .filteredEgressPoint(FP1)
                 .build();
     }
 
@@ -112,8 +112,8 @@
                 .appId(APPID)
                 .selector(VLANMATCH1)
                 .treatment(NOP)
-                .ingressPoints(PS1)
-                .egressPoint(P2)
+                .filteredIngressPoints(FPS1)
+                .filteredEgressPoint(FP2)
                 .build();
     }
 
@@ -122,8 +122,8 @@
                 .appId(APPID)
                 .selector(MATCH)
                 .treatment(NOP)
-                .ingressPoints(PS1)
-                .egressPoint(P2)
+                .filteredIngressPoints(FPS1)
+                .filteredEgressPoint(FP2)
                 .resourceGroup(RESOURCE_GROUP)
                 .build();
     }
diff --git a/core/common/src/main/java/org/onosproject/codec/impl/MultiPointToSinglePointIntentCodec.java b/core/common/src/main/java/org/onosproject/codec/impl/MultiPointToSinglePointIntentCodec.java
index 4216804..b465f57 100644
--- a/core/common/src/main/java/org/onosproject/codec/impl/MultiPointToSinglePointIntentCodec.java
+++ b/core/common/src/main/java/org/onosproject/codec/impl/MultiPointToSinglePointIntentCodec.java
@@ -20,6 +20,7 @@
 import org.onosproject.codec.CodecContext;
 import org.onosproject.codec.JsonCodec;
 import org.onosproject.net.ConnectPoint;
+import org.onosproject.net.FilteredConnectPoint;
 import org.onosproject.net.intent.ConnectivityIntent;
 import org.onosproject.net.intent.MultiPointToSinglePointIntent;
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -79,13 +80,13 @@
                     context.codec(ConnectPoint.class);
             JsonNode connectPointsJson = json.get(INGRESS_POINT);
 
-            Set<ConnectPoint> ingressCp = new HashSet<ConnectPoint>();
+            Set<FilteredConnectPoint> ingressCp = new HashSet<>();
             if (connectPointsJson != null) {
                 for (int i = 0; i < connectPointsJson.size(); i++) {
-                    ingressCp.add(connectPointCodec.decode(get(connectPointsJson, i),
-                                                           context));
+                    ingressCp.add(new FilteredConnectPoint(connectPointCodec.decode(get(connectPointsJson, i),
+                                                           context)));
                 }
-                builder.ingressPoints(ingressCp);
+                builder.filteredIngressPoints(ingressCp);
             }
         }
 
@@ -93,7 +94,7 @@
                                               EGRESS_POINT + IntentCodec.MISSING_MEMBER_MESSAGE);
         ConnectPoint egress = context.codec(ConnectPoint.class)
                 .decode(egressJson, context);
-        builder.egressPoint(egress);
+        builder.filteredEgressPoint(new FilteredConnectPoint(egress));
 
         return builder.build();
     }
diff --git a/core/common/src/test/java/org/onosproject/codec/impl/MultiPointToSinglePointIntentCodecTest.java b/core/common/src/test/java/org/onosproject/codec/impl/MultiPointToSinglePointIntentCodecTest.java
index c24da42..15c79d6 100644
--- a/core/common/src/test/java/org/onosproject/codec/impl/MultiPointToSinglePointIntentCodecTest.java
+++ b/core/common/src/test/java/org/onosproject/codec/impl/MultiPointToSinglePointIntentCodecTest.java
@@ -46,6 +46,8 @@
 import static org.easymock.EasyMock.*;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.*;
+import static org.onosproject.net.intent.ConnectivityIntentTest.FP2;
+import static org.onosproject.net.intent.ConnectivityIntentTest.FPS1;
 
 /**
  * Suite of tests of the multi-to-single point intent's codec for rest api.
@@ -91,8 +93,8 @@
                 .appId(APPID)
                 .selector(MATCH)
                 .treatment(NOP)
-                .ingressPoints(PS1)
-                .egressPoint(P2)
+                .filteredIngressPoints(FPS1)
+                .filteredEgressPoint(FP2)
                 .build();
 
         assertThat(intent, notNullValue());
@@ -108,8 +110,20 @@
         assertThat(result.get("id").textValue(), is("0x0"));
         assertThat(result.get("appId").textValue(), is("foo"));
         assertThat(result.get("priority").asInt(), is(100));
-        assertThat(result.get("ingressPoint").get(0).get("port").textValue(), is("3"));
-        assertThat(result.get("ingressPoint").get(1).get("port").textValue(), is("1"));
+
+        boolean found1 = false;
+        boolean found3 = false;
+        for (int i = 0; i < FPS1.size(); i++) {
+            String portString = result.get("ingressPoint").get(i).get("port").textValue();
+            if (portString.equals("1")) {
+                found1 = true;
+            } else if (portString.equals("3")) {
+                found3 = true;
+            }
+        }
+        assertThat("Port 1 was not found", found1, is(true));
+        assertThat("Port 3 was not found", found3, is(true));
+
         assertThat(result.get("egressPoint").get("port").textValue(), is("2"));
         assertThat(result.get("egressPoint").get("device").textValue(), is("222"));
     }