use of org.folio.rest.impl.MockServer in project mod-invoice by folio-org.
the class ApiTestSuite method before.
@BeforeAll
public static void before() throws InterruptedException, ExecutionException, TimeoutException {
if (vertx == null) {
vertx = Vertx.vertx();
}
mockServer = new MockServer(mockPort);
mockServer.start();
RestAssured.baseURI = "http://localhost:" + okapiPort;
RestAssured.port = okapiPort;
RestAssured.enableLoggingOfRequestAndResponseIfValidationFails();
kafkaCluster = EmbeddedKafkaCluster.provisionWith(useDefaults());
kafkaCluster.start();
String[] hostAndPort = kafkaCluster.getBrokerList().split(":");
System.setProperty(KAFKA_HOST, hostAndPort[0]);
System.setProperty(KAFKA_PORT, hostAndPort[1]);
System.setProperty(KAFKA_ENV, KAFKA_ENV_VALUE);
System.setProperty(OKAPI_URL_KEY, "http://localhost:" + mockPort);
final JsonObject conf = new JsonObject();
conf.put("http.port", okapiPort);
final DeploymentOptions opt = new DeploymentOptions().setConfig(conf);
CompletableFuture<String> deploymentComplete = new CompletableFuture<>();
vertx.deployVerticle(RestVerticle.class.getName(), opt, res -> {
if (res.succeeded()) {
deploymentComplete.complete(res.result());
} else {
deploymentComplete.completeExceptionally(res.cause());
}
});
deploymentComplete.get(60, TimeUnit.SECONDS);
initialised = true;
}
use of org.folio.rest.impl.MockServer in project mod-orders by folio-org.
the class TestConfig method startMockServer.
public static void startMockServer() throws InterruptedException, ExecutionException, TimeoutException {
mockServer = new MockServer(mockPort);
mockServer.start();
}
Aggregations