Add PNF support to new CDS actor
[policy/models.git] / models-interactions / model-impl / cds / src / test / java / org / onap / policy / cds / client / CdsProcessorGrpcClientTest.java
index b9a9a84..0922fc4 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  * Copyright (C) 2019 Bell Canada.
+ * Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 package org.onap.policy.cds.client;
 
+import static org.assertj.core.api.Assertions.assertThatCode;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.verify;
 
@@ -91,7 +92,7 @@ public class CdsProcessorGrpcClientTest {
             .register(InProcessChannelBuilder.forName(SERVER_NAME).directExecutor().build());
 
         // Create an instance of the gRPC client
-        client = new CdsProcessorGrpcClient(channel, new CdsProcessorHandler(listener));
+        client = new CdsProcessorGrpcClient(channel, new CdsProcessorHandler(listener, "gRPC://localhost:1234/"));
 
         // Implement the test gRPC server
         BluePrintProcessingServiceImplBase testCdsBlueprintServerImpl = new BluePrintProcessingServiceImplBase() {
@@ -128,13 +129,13 @@ public class CdsProcessorGrpcClientTest {
 
     @Test
     public void testCdsProcessorGrpcClientConstructor() {
-        new CdsProcessorGrpcClient(listener, props);
+        assertThatCode(() -> new CdsProcessorGrpcClient(listener, props).close()).doesNotThrowAnyException();
     }
 
     @Test(expected = IllegalStateException.class)
     public void testCdsProcessorGrpcClientConstructorFailure() {
         props.setHost(null);
-        new CdsProcessorGrpcClient(listener, props);
+        new CdsProcessorGrpcClient(listener, props).close();
     }
 
     @Test