clean up the SingleSwitchFibInstaller, added the predeactivate hook and modified unit test CORD-663
Change-Id: I8bf9dd4c7a6e9c42833a6f631bfceb85b7f3ddef
diff --git a/apps/routing/src/test/java/org/onosproject/routing/impl/SingleSwitchFibInstallerTest.java b/apps/routing/src/test/java/org/onosproject/routing/impl/SingleSwitchFibInstallerTest.java
index b1b80c5..69d2c34 100644
--- a/apps/routing/src/test/java/org/onosproject/routing/impl/SingleSwitchFibInstallerTest.java
+++ b/apps/routing/src/test/java/org/onosproject/routing/impl/SingleSwitchFibInstallerTest.java
@@ -26,6 +26,7 @@
import org.onlab.packet.MacAddress;
import org.onlab.packet.VlanId;
import org.onosproject.TestApplicationId;
+import org.onosproject.app.ApplicationService;
import org.onosproject.cfg.ComponentConfigService;
import org.onosproject.core.ApplicationId;
import org.onosproject.core.CoreService;
@@ -102,12 +103,12 @@
private static final InterfaceIpAddress INTF2 =
InterfaceIpAddress.valueOf("192.168.20.2/24");
-
private final Set<Interface> interfaces = Sets.newHashSet();
private InterfaceService interfaceService;
private NetworkConfigService networkConfigService;
private NetworkConfigRegistry networkConfigRegistry;
private FlowObjectiveService flowObjectiveService;
+ private ApplicationService applicationService;
private DeviceService deviceService;
private static final ApplicationId APPID = TestApplicationId.create("foo");
@@ -132,6 +133,8 @@
networkConfigService = createMock(NetworkConfigService.class);
networkConfigRegistry = createMock(NetworkConfigRegistry.class);
flowObjectiveService = createMock(FlowObjectiveService.class);
+ applicationService = createNiceMock(ApplicationService.class);
+ replay(applicationService);
deviceService = new TestDeviceService();
CoreService coreService = createNiceMock(CoreService.class);
expect(coreService.registerApplication(anyString())).andReturn(APPID).anyTimes();
@@ -141,6 +144,7 @@
sSfibInstaller.networkConfigRegistry = networkConfigRegistry;
sSfibInstaller.interfaceService = interfaceService;
sSfibInstaller.flowObjectiveService = flowObjectiveService;
+ sSfibInstaller.applicationService = applicationService;
sSfibInstaller.coreService = coreService;
sSfibInstaller.routeService = new TestRouteService();
sSfibInstaller.deviceService = deviceService;