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;
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;
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.
protected static final String RESOURCE_ID = "my-resource";
protected Response response;
+ protected GenericVnf genvnf;
/**
* Constructs the object using a default actor and operation name.
response.setStatus(status);
status.setCode(ResponseCode.SUCCESS.getValue());
status.setDescription(MY_DESCRIPTION);
+
+ genvnf = new GenericVnf();
+ genvnf.setVnfId(MY_VNF);
}
public void tearDown() {
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();