import java.util.Map;
import org.mockito.Mock;
import org.onap.policy.aai.AaiCqResponse;
+import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
+import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
+import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
+import org.onap.policy.common.gson.GsonMessageBodyHandler;
import org.onap.policy.controlloop.actor.test.BasicHttpOperation;
import org.onap.policy.controlloop.actorserviceprovider.Util;
import org.onap.policy.controlloop.policy.Target;
+import org.onap.policy.simulators.SoSimulatorJaxRs;
import org.onap.policy.so.SoRequest;
import org.onap.policy.so.SoRequestParameters;
import org.onap.policy.so.SoRequestReferences;
public static final String MODEL_VERSION = "my-model-version";
public static final String MODEL_VERS_ID = "my-model-version-id";
public static final String SUBSCRIPTION_SVC_TYPE = "my-subscription-service-type";
+ public static final String MY_PATH = "my-path";
public static final String PATH_GET = "my-path-get/";
public static final int MAX_GETS = 3;
public static final int WAIT_SEC_GETS = 20;
super(actor, operation);
}
+ /**
+ * Starts the simulator.
+ */
+ protected static void initBeforeClass() throws Exception {
+ org.onap.policy.simulators.Util.buildSoSim();
+
+ BusTopicParams clientParams = BusTopicParams.builder().clientName(MY_CLIENT).basePath("").hostname("localhost")
+ .managed(true).port(org.onap.policy.simulators.Util.SOSIM_SERVER_PORT)
+ .serializationProvider(GsonMessageBodyHandler.class.getName()).build();
+ HttpClientFactoryInstance.getClientFactory().build(clientParams);
+
+ SoSimulatorJaxRs.setRequirePolling(true);
+ }
+
+ protected static void destroyAfterClass() {
+ SoSimulatorJaxRs.setRequirePolling(false);
+ HttpClientFactoryInstance.getClientFactory().destroy();
+ HttpServletServerFactoryInstance.getServerFactory().destroy();
+ }
+
/**
* Initializes mocks and sets up.
*/
protected void initConfig() {
super.initConfig();
when(config.getClient()).thenReturn(client);
+ when(config.getPath()).thenReturn(MY_PATH);
when(config.getMaxGets()).thenReturn(MAX_GETS);
when(config.getPathGet()).thenReturn(PATH_GET);
when(config.getWaitSecGet()).thenReturn(WAIT_SEC_GETS);