Upgrade CDS dependency 77/122777/1
authork.kedron <k.kedron@partner.samsung.com>
Mon, 19 Jul 2021 16:05:52 +0000 (18:05 +0200)
committerk.kedron <k.kedron@partner.samsung.com>
Wed, 21 Jul 2021 09:55:15 +0000 (11:55 +0200)
- New CDS client libraries.
- Update code to use new CDS BlueprintProcessingService

Change-Id: I00fb044908774a48755ff8d9ebb32e055a74c819
Issue-ID: POLICY-3507
Signed-off-by: Krystian Kedron <k.kedron@partner.samsung.com>
models-interactions/model-impl/cds/pom.xml
models-interactions/model-impl/cds/src/main/java/org/onap/policy/cds/client/CdsProcessorHandler.java
models-interactions/model-impl/cds/src/test/java/org/onap/policy/cds/client/BasicAuthClientHeaderInterceptorTest.java
models-interactions/model-impl/cds/src/test/java/org/onap/policy/cds/client/CdsProcessorGrpcClientTest.java
models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/CdsSimulator.java
models-interactions/model-simulators/src/test/java/org/onap/policy/simulators/CdsSimulatorTest.java

index 0c6cd6d..be6c550 100644 (file)
@@ -39,7 +39,7 @@
   <dependencies>
     <!-- CDS dependencies -->
     <dependency>
-      <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+      <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
       <artifactId>blueprint-proto</artifactId>
     </dependency>
     <dependency>
index 6c4d6ca..231ec28 100644 (file)
@@ -23,8 +23,8 @@ import io.grpc.ManagedChannel;
 import io.grpc.stub.StreamObserver;
 import java.util.concurrent.CountDownLatch;
 import lombok.AllArgsConstructor;
-import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc;
-import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc.BluePrintProcessingServiceStub;
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc;
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc.BlueprintProcessingServiceStub;
 import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput;
 import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput;
 import org.onap.policy.cds.api.CdsProcessorListener;
@@ -48,7 +48,7 @@ public class CdsProcessorHandler {
             header.getBlueprintName(), header.getBlueprintVersion());
 
         final var finishLatch = new CountDownLatch(1);
-        final BluePrintProcessingServiceStub asyncStub = BluePrintProcessingServiceGrpc.newStub(channel);
+        final BlueprintProcessingServiceStub asyncStub = BlueprintProcessingServiceGrpc.newStub(channel);
         final StreamObserver<ExecutionServiceOutput> responseObserver = new StreamObserver<>() {
             @Override
             public void onNext(ExecutionServiceOutput output) {
index 3192520..99d1da9 100644 (file)
@@ -45,9 +45,9 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.mockito.ArgumentCaptor;
 import org.mockito.ArgumentMatchers;
-import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc;
-import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc.BluePrintProcessingServiceImplBase;
-import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc.BluePrintProcessingServiceStub;
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc;
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc.BlueprintProcessingServiceImplBase;
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc.BlueprintProcessingServiceStub;
 import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput;
 import org.onap.policy.cds.properties.CdsServerProperties;
 
@@ -83,7 +83,7 @@ public class BasicAuthClientHeaderInterceptorTest {
         props.setTimeout(60);
 
         // Implement the test gRPC server
-        BluePrintProcessingServiceImplBase testCdsBlueprintServerImpl = new BluePrintProcessingServiceImplBase() {};
+        BlueprintProcessingServiceImplBase testCdsBlueprintServerImpl = new BlueprintProcessingServiceImplBase() {};
 
         // Create a server, add service, start, and register for automatic graceful shutdown.
         grpcCleanup.register(InProcessServerBuilder.forName(SERVER_NAME).directExecutor()
@@ -96,7 +96,7 @@ public class BasicAuthClientHeaderInterceptorTest {
 
     @Test
     public void testIfBasicAuthHeaderIsDeliveredToCdsServer() {
-        BluePrintProcessingServiceStub bpProcessingSvcStub = BluePrintProcessingServiceGrpc
+        BlueprintProcessingServiceStub bpProcessingSvcStub = BlueprintProcessingServiceGrpc
             .newStub(ClientInterceptors.intercept(channel, new BasicAuthClientHeaderInterceptor(props)));
         ArgumentCaptor<Metadata> metadataCaptor = ArgumentCaptor.forClass(Metadata.class);
         bpProcessingSvcStub.process(new StreamObserver<ExecutionServiceOutput>() {
index 0922fc4..d38b0a4 100644 (file)
@@ -44,7 +44,7 @@ import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers;
-import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc.BluePrintProcessingServiceImplBase;
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc.BlueprintProcessingServiceImplBase;
 import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput;
 import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput;
 import org.onap.policy.cds.api.CdsProcessorListener;
@@ -95,7 +95,7 @@ public class CdsProcessorGrpcClientTest {
         client = new CdsProcessorGrpcClient(channel, new CdsProcessorHandler(listener, "gRPC://localhost:1234/"));
 
         // Implement the test gRPC server
-        BluePrintProcessingServiceImplBase testCdsBlueprintServerImpl = new BluePrintProcessingServiceImplBase() {
+        BlueprintProcessingServiceImplBase testCdsBlueprintServerImpl = new BlueprintProcessingServiceImplBase() {
             @Override
             public StreamObserver<ExecutionServiceInput> process(
                 final StreamObserver<ExecutionServiceOutput> responseObserver) {
index 1677a35..b85931d 100644 (file)
@@ -36,7 +36,7 @@ import lombok.Getter;
 import org.apache.commons.lang3.StringUtils;
 import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType;
 import org.onap.ccsdk.cds.controllerblueprints.common.api.Status;
-import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc.BluePrintProcessingServiceImplBase;
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc.BlueprintProcessingServiceImplBase;
 import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput;
 import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput;
 import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput.Builder;
@@ -80,7 +80,7 @@ public class CdsSimulator implements Runnable {
         this.port = port;
         this.resourceLocation = resourceLocation;
 
-        BluePrintProcessingServiceImplBase testCdsBlueprintServerImpl = new BluePrintProcessingServiceImplBase() {
+        BlueprintProcessingServiceImplBase testCdsBlueprintServerImpl = new BlueprintProcessingServiceImplBase() {
 
             @Override
             public StreamObserver<ExecutionServiceInput> process(
index 21d766f..46c56a1 100644 (file)
@@ -38,8 +38,8 @@ import org.json.simple.parser.ParseException;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
-import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc;
-import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc.BluePrintProcessingServiceStub;
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc;
+import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc.BlueprintProcessingServiceStub;
 import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput;
 import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput.Builder;
 import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput;
@@ -81,7 +81,7 @@ public class CdsSimulatorTest {
             final CompletableFuture<ExecutionServiceOutput> future = new CompletableFuture<>();
             final CountDownLatch completed = new CountDownLatch(1);
 
-            BluePrintProcessingServiceStub asyncStub = BluePrintProcessingServiceGrpc.newStub(channel);
+            BlueprintProcessingServiceStub asyncStub = BlueprintProcessingServiceGrpc.newStub(channel);
 
             StreamObserver<ExecutionServiceOutput> responseObserver = new StreamObserver<ExecutionServiceOutput>() {
                 @Override