Refactored the HostStore to allow multiple MAC addresses bound to a single port
Change-Id: Icd3b2e483b15486251ac1cca107478a012d1a3e7
diff --git a/apps/sdnip/src/test/java/org/onlab/onos/sdnip/HostToInterfaceAdaptorTest.java b/apps/sdnip/src/test/java/org/onlab/onos/sdnip/HostToInterfaceAdaptorTest.java
index 2a65616..9e31389 100644
--- a/apps/sdnip/src/test/java/org/onlab/onos/sdnip/HostToInterfaceAdaptorTest.java
+++ b/apps/sdnip/src/test/java/org/onlab/onos/sdnip/HostToInterfaceAdaptorTest.java
@@ -23,6 +23,7 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
+import java.util.Collections;
import java.util.Map;
import java.util.Set;
@@ -63,10 +64,6 @@
private static final ConnectPoint NON_EXISTENT_CP = new ConnectPoint(
DeviceId.deviceId("doesnotexist"), PortNumber.portNumber(1));
- private static final PortAddresses DEFAULT_PA = new PortAddresses(
- NON_EXISTENT_CP, null, null);
-
-
@Before
public void setUp() throws Exception {
hostService = createMock(HostService.class);
@@ -123,7 +120,8 @@
MacAddress mac) {
PortAddresses pa = new PortAddresses(cp, ipAddresses, mac);
portAddresses.add(pa);
- expect(hostService.getAddressBindingsForPort(cp)).andReturn(pa).anyTimes();
+ expect(hostService.getAddressBindingsForPort(cp)).andReturn(
+ Collections.singleton(pa)).anyTimes();
Interface intf = new Interface(cp, ipAddresses, mac);
interfaces.put(cp, intf);
@@ -158,7 +156,7 @@
// Try and get an interface for a connect point with no addresses
reset(hostService);
expect(hostService.getAddressBindingsForPort(NON_EXISTENT_CP))
- .andReturn(DEFAULT_PA).anyTimes();
+ .andReturn(Collections.<PortAddresses>emptySet()).anyTimes();
replay(hostService);
assertNull(adaptor.getInterface(NON_EXISTENT_CP));