import static org.junit.Assert.assertEquals;
import java.util.Map;
+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.controlloop.actor.test.BasicHttpOperation;
+import org.onap.policy.simulators.Util;
/**
* Superclass for various operator tests.
super(actor, operation);
}
+ /**
+ * Starts the simulator.
+ */
+ protected static void initBeforeClass() throws Exception {
+ Util.buildAaiSim();
+
+ BusTopicParams clientParams = BusTopicParams.builder().clientName(MY_CLIENT).basePath("aai/")
+ .hostname("localhost").managed(true).port(Util.AAISIM_SERVER_PORT).build();
+ HttpClientFactoryInstance.getClientFactory().build(clientParams);
+ }
+
+ protected static void destroyAfterClass() {
+ HttpClientFactoryInstance.getClientFactory().destroy();
+ HttpServletServerFactoryInstance.getServerFactory().destroy();
+ }
+
protected void verifyHeaders(Map<String, Object> headers) {
assertEquals("POLICY", headers.get("X-FromAppId").toString());
assertEquals(params.getRequestId().toString(), headers.get("X-TransactionId"));