X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=models-interactions%2Fmodel-simulators%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fsimulators%2FCdsSimulatorTest.java;fp=models-interactions%2Fmodel-simulators%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fsimulators%2FCdsSimulatorTest.java;h=57707693c30076895d4272f534dd15fd64a875f7;hb=938005505883cf7a636a8840e20e3dc8a0ad9176;hp=6c71940af05643c03df86034221a5834b6ec7325;hpb=d19537308cbdce440c1faf819eb586983d0a67c9;p=policy%2Fmodels.git diff --git a/models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/CdsSimulatorTest.java b/models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/CdsSimulatorTest.java index 6c71940af..57707693c 100644 --- a/models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/CdsSimulatorTest.java +++ b/models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/CdsSimulatorTest.java @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2020-2021 Bell Canada. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,6 +32,7 @@ import io.grpc.netty.NettyChannelBuilder; import io.grpc.stub.StreamObserver; import java.io.IOException; import java.nio.charset.StandardCharsets; +import java.util.Objects; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -71,7 +73,8 @@ public class CdsSimulatorTest { @Test public void test() throws Exception { - String reqstr = IOUtils.toString(getClass().getResource("cds/cds.request.json"), StandardCharsets.UTF_8); + String reqstr = IOUtils.toString(Objects.requireNonNull(getClass().getResource("cds/cds.request.json")), + StandardCharsets.UTF_8); Builder builder = ExecutionServiceInput.newBuilder(); JsonFormat.parser().ignoringUnknownFields().merge(reqstr, builder); ExecutionServiceInput request = builder.build(); @@ -83,7 +86,7 @@ public class CdsSimulatorTest { BluePrintProcessingServiceStub asyncStub = BluePrintProcessingServiceGrpc.newStub(channel); - StreamObserver responseObserver = new StreamObserver() { + StreamObserver responseObserver = new StreamObserver<>() { @Override public void onNext(ExecutionServiceOutput output) { future.complete(output);