Turn PortMappingImpl into a component
[transportpce.git] / olm / src / test / java / org / opendaylight / transportpce / olm / OlmPowerServiceRpcImplTest.java
index 03fe640eaae2139e56a735a1e9561951c6f9bd9d..5277ac687aa33e1a8a1dae91bc3e9d2ab0f42baf 100644 (file)
@@ -115,23 +115,20 @@ public class OlmPowerServiceRpcImplTest extends AbstractTest {
         this.crossConnectImpl710 = new CrossConnectImpl710(deviceTransactionManager);
         this.crossConnect = new CrossConnectImpl(deviceTransactionManager, this.mappingUtils, this.crossConnectImpl121,
                 this.crossConnectImpl22, this.crossConnectImpl710);
+        this.portMappingVersion710 = new PortMappingVersion710(getDataBroker(), deviceTransactionManager);
+        this.portMappingVersion22 = new PortMappingVersion221(getDataBroker(), deviceTransactionManager);
+        this.portMappingVersion121 = new PortMappingVersion121(getDataBroker(), deviceTransactionManager);
+        this.portMapping = new PortMappingImpl(getDataBroker(), this.portMappingVersion710,
+            this.portMappingVersion22, this.portMappingVersion121);
         this.openRoadmInterfacesImpl121 = new OpenRoadmInterfacesImpl121(deviceTransactionManager);
-        this.openRoadmInterfacesImpl22 = new OpenRoadmInterfacesImpl221(deviceTransactionManager);
-        this.openRoadmInterfacesImpl710 = new OpenRoadmInterfacesImpl710(deviceTransactionManager);
+        this.openRoadmInterfacesImpl22 = new OpenRoadmInterfacesImpl221(deviceTransactionManager, this.portMapping);
+        this.openRoadmInterfacesImpl710 = new OpenRoadmInterfacesImpl710(deviceTransactionManager, this.portMapping);
         this.openRoadmInterfaces = new OpenRoadmInterfacesImpl((this.deviceTransactionManager),
                 this.mappingUtils,this.openRoadmInterfacesImpl121,this.openRoadmInterfacesImpl22,
             this.openRoadmInterfacesImpl710);
-        this.portMappingVersion710 =
-            new PortMappingVersion710(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
-        this.portMappingVersion22 =
-                new PortMappingVersion221(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
-        this.portMappingVersion121 =
-                new PortMappingVersion121(getDataBroker(), deviceTransactionManager, this.openRoadmInterfaces);
-        this.portMapping = new PortMappingImpl(getDataBroker(), this.portMappingVersion710,
-            this.portMappingVersion22, this.portMappingVersion121);
         this.portMapping = Mockito.spy(this.portMapping);
         this.powerMgmt = new PowerMgmtImpl(getDataBroker(), this.openRoadmInterfaces, this.crossConnect,
-            this.deviceTransactionManager);
+            this.deviceTransactionManager, this.portMapping);
         this.olmPowerService = new OlmPowerServiceImpl(getDataBroker(), this.powerMgmt,
             this.deviceTransactionManager, this.portMapping,mappingUtils,openRoadmInterfaces);
         this.olmPowerServiceRpc = new OlmPowerServiceRpcImpl(this.olmPowerService);