Make Actors event-agnostic
[policy/models.git] / models-interactions / model-actors / actor.appc / src / test / java / org / onap / policy / controlloop / actor / appc / BasicAppcOperation.java
index 9d434ce..aed2431 100644 (file)
@@ -20,7 +20,6 @@
 
 package org.onap.policy.controlloop.actor.appc;
 
-import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
@@ -32,6 +31,7 @@ import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeoutException;
 import java.util.function.BiConsumer;
+import org.onap.aai.domain.yang.GenericVnf;
 import org.onap.policy.appc.Request;
 import org.onap.policy.appc.Response;
 import org.onap.policy.appc.ResponseCode;
@@ -44,12 +44,9 @@ import org.onap.policy.controlloop.actor.test.BasicBidirectionalTopicOperation;
 import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
 import org.onap.policy.controlloop.actorserviceprovider.OperationResult;
 import org.onap.policy.controlloop.actorserviceprovider.Util;
-import org.onap.policy.controlloop.actorserviceprovider.impl.OperationMaker;
-import org.onap.policy.controlloop.actorserviceprovider.parameters.BidirectionalTopicConfig;
 import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
 import org.onap.policy.simulators.AppcLegacyTopicServer;
 import org.onap.policy.simulators.TopicServer;
-import org.powermock.reflect.Whitebox;
 
 /**
  * Superclass for various operator tests.
@@ -66,6 +63,7 @@ public abstract class BasicAppcOperation extends BasicBidirectionalTopicOperatio
     protected static final String RESOURCE_ID = "my-resource";
 
     protected Response response;
+    protected GenericVnf genvnf;
 
     /**
      * Constructs the object using a default actor and operation name.
@@ -97,6 +95,9 @@ public abstract class BasicAppcOperation extends BasicBidirectionalTopicOperatio
         response.setStatus(status);
         status.setCode(ResponseCode.SUCCESS.getValue());
         status.setDescription(MY_DESCRIPTION);
+
+        genvnf = new GenericVnf();
+        genvnf.setVnfId(MY_VNF);
     }
 
     public void tearDown() {
@@ -131,25 +132,6 @@ public abstract class BasicAppcOperation extends BasicBidirectionalTopicOperatio
         assertEquals(MY_DESCRIPTION, outcome.getMessage());
     }
 
-    /**
-     * Verifies that an exception is thrown if a field is missing from the enrichment
-     * data.
-     *
-     * @param fieldName name of the field to be removed from the enrichment data
-     * @param expectedText text expected in the exception message
-     */
-    protected void verifyMissing(String fieldName, String expectedText,
-                    OperationMaker<BidirectionalTopicConfig, AppcOperation> maker) {
-
-        makeContext();
-        enrichment.remove(fieldName);
-
-        AppcOperation oper = maker.apply(params, config);
-
-        assertThatIllegalArgumentException().isThrownBy(() -> Whitebox.invokeMethod(oper, "makeRequest", 1))
-                        .withMessageContaining("missing").withMessageContaining(expectedText);
-    }
-
     @Override
     protected void makeContext() {
         super.makeContext();