- measurementsList.add(measurements);
- GetPmOutput getPmOutput = new GetPmOutputBuilder()
- .setNodeId("node1").setMeasurements(measurementsList).build();
- GetPmOutput getPmOutput2 = new GetPmOutputBuilder()
- .setNodeId("node1").setMeasurements(new ArrayList<>()).build();
-
- GetPmInput getPmInputZZ = createGetPmInput(input.getServiceZEnd().getNodeId(),
- input.getServiceZEnd().getNodeId() + "-" + OpenRoadmInterfacesImpl.NETWORK_TOKEN);
- GetPmInput getPmInputAZ = createGetPmInput(input.getServiceAEnd().getNodeId(),
- input.getServiceAEnd().getNodeId() + "-" + input.getServiceZEnd().getNodeId() + "-"
- + OpenRoadmInterfacesImpl.NETWORK_TOKEN);
-
- GetPmInput getPmInputZA = createGetPmInput(input.getServiceZEnd().getNodeId(),
- input.getServiceZEnd().getNodeId() + "-" + input.getServiceAEnd().getNodeId() + "-"
- + OpenRoadmInterfacesImpl.NETWORK_TOKEN);
- GetPmInput getPmInputAA = createGetPmInput(input.getServiceAEnd().getNodeId(),
- input.getServiceAEnd().getNodeId() + "-" + OpenRoadmInterfacesImpl.NETWORK_TOKEN);
-
- Mockito.when(this.olmService.getPm(Mockito.eq(getPmInputZZ)))
- .thenReturn(RpcResultBuilder.success(getPmOutput2).buildFuture());
- Mockito.when(this.olmService.getPm(Mockito.eq(getPmInputAZ)))
- .thenReturn(RpcResultBuilder.success(getPmOutput).buildFuture());
- Mockito.when(this.olmService.getPm(Mockito.eq(getPmInputZA)))
- .thenReturn(RpcResultBuilder.success(getPmOutput2).buildFuture());
- Mockito.when(this.olmService.getPm(Mockito.eq(getPmInputAA)))
- .thenReturn(RpcResultBuilder.success(getPmOutput).buildFuture());
- ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input);
- Assert.assertEquals(ResponseCodes.RESPONSE_FAILED, result.getConfigurationResponseCommon().getResponseCode());
-
+ measurementsList.add(new MeasurementsBuilder()
+ .setPmparameterName("FECUncorrectableBlocks")
+ .setPmparameterValue("1")
+ .build());
+ GetPmOutput getPmOutput = new GetPmOutputBuilder().setNodeId("node1").setMeasurements(measurementsList).build();
+ GetPmOutput getPmOutput2 = new GetPmOutputBuilder().setNodeId("node1").setMeasurements(new ArrayList<>())
+ .build();
+
+ GetPmInput getPmInputZ = createGetPmInput("XPONDER-2-3", StringConstants.NETWORK_TOKEN);
+ GetPmInput getPmInputA = createGetPmInput("XPONDER-1-2", StringConstants.NETWORK_TOKEN);
+
+ when(this.olmService.getPm(eq(getPmInputZ))).thenReturn(RpcResultBuilder.success(getPmOutput2).buildFuture());
+ when(this.olmService.getPm(eq(getPmInputA))).thenReturn(RpcResultBuilder.success(getPmOutput).buildFuture());
+ ServicePathOutputBuilder mockOutputBuilder = new ServicePathOutputBuilder().setResult("success")
+ .setSuccess(true);
+ doReturn(mockOutputBuilder.build()).when(this.deviceRenderer).setupServicePath(any(), any(), any());
+ ServiceImplementationRequestInput input = ServiceDataUtils
+ .buildServiceImplementationRequestInputTerminationPointResource(StringConstants.NETWORK_TOKEN);
+ ServiceImplementationRequestOutput result = this.rendererServiceOperations.serviceImplementation(input,
+ false).get();
+ assertEquals(ResponseCodes.RESPONSE_OK, result.getConfigurationResponseCommon().getResponseCode());