- private OlmPowerServiceRpcImpl olmPowerServiceRpc;
- private CrossConnectImpl121 crossConnectImpl121;
- private CrossConnectImpl221 crossConnectImpl22;
- private CrossConnectImpl710 crossConnectImpl710;
- private MappingUtils mappingUtils;
- private OpenRoadmInterfacesImpl121 openRoadmInterfacesImpl121;
- private OpenRoadmInterfacesImpl221 openRoadmInterfacesImpl22;
- private OpenRoadmInterfacesImpl710 openRoadmInterfacesImpl710;
- private PortMappingVersion710 portMappingVersion710;
- private PortMappingVersion221 portMappingVersion22;
- private PortMappingVersion121 portMappingVersion121;
-
- @BeforeEach
- public void setUp() {
- this.mountPoint = new MountPointStub(getDataBroker());
- this.mountPointService = new MountPointServiceStub(mountPoint);
- this.deviceTransactionManager = new DeviceTransactionManagerImpl(mountPointService, 3000);
- this.mappingUtils = Mockito.spy(new MappingUtilsImpl(getDataBroker()));
- Mockito.doReturn(StringConstants.OPENROADM_DEVICE_VERSION_1_2_1).when(mappingUtils)
- .getOpenRoadmVersion(Mockito.anyString());
- this.deviceTransactionManager = new DeviceTransactionManagerImpl(mountPointService, 3000);
- this.crossConnectImpl121 = new CrossConnectImpl121(deviceTransactionManager);
- this.crossConnectImpl22 = new CrossConnectImpl221(deviceTransactionManager);
- 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.portMapping);
- this.openRoadmInterfacesImpl710 = new OpenRoadmInterfacesImpl710(deviceTransactionManager, this.portMapping);
- this.openRoadmInterfaces = new OpenRoadmInterfacesImpl((this.deviceTransactionManager),
- this.mappingUtils,this.openRoadmInterfacesImpl121,this.openRoadmInterfacesImpl22,
- this.openRoadmInterfacesImpl710);
- this.portMapping = Mockito.spy(this.portMapping);
- this.powerMgmt = new PowerMgmtImpl(getDataBroker(), this.openRoadmInterfaces, this.crossConnect,
- this.deviceTransactionManager, this.portMapping);
- this.olmPowerService = new OlmPowerServiceImpl(getDataBroker(), this.powerMgmt,
- this.deviceTransactionManager, this.portMapping,mappingUtils,openRoadmInterfaces);
- this.olmPowerServiceRpc = new OlmPowerServiceRpcImpl(this.olmPowerService);
- //TODO
- this.olmPowerServiceRpc = Mockito.mock(OlmPowerServiceRpcImpl.class);
- }
-
- @Test
- public void pmIsNotPresentTest() throws ExecutionException, InterruptedException {
- GetPmInput input = OlmPowerServiceRpcImplUtil.getGetPmInput();
- //TODO
-// ListenableFuture<RpcResult<GetPmOutput>> output = this.olmPowerServiceRpc.getPm(input);
-// assertEquals(new GetPmOutputBuilder().build(), output.get().getResult());
-// assertEquals(null, output.get().getResult().getResourceId());
-// assertEquals(null, output.get().getResult().getMeasurements());
-// assertEquals(null, output.get().getResult().getGranularity());
-// assertEquals(null, output.get().getResult().getNodeId());
-// assertEquals(null, output.get().getResult().getResourceIdentifier());
-// assertEquals(null, output.get().getResult().getResourceType());
- }