Search in sources :

Example 1 with AnalyticsVerticle

use of io.vertx.starter.AnalyticsVerticle in project vertx-starter by vert-x3.

the class AnalyticsTest method beforeEach.

@BeforeEach
void beforeEach(Vertx vertx, VertxTestContext testContext) throws IOException {
    vertx.eventBus().registerDefaultCodec(VertxProject.class, new VertxProjectCodec());
    JsonObject config = new JsonObject().put("host", mongo.getContainerIpAddress()).put("port", mongo.getMappedPort(27017));
    client = MongoClient.create(vertx, config);
    DeploymentOptions options = new DeploymentOptions().setConfig(config);
    vertx.deployVerticle(new AnalyticsVerticle(), options, testContext.succeeding(id -> testContext.completeNow()));
}
Also used : VertxTestContext(io.vertx.junit5.VertxTestContext) BeforeEach(org.junit.jupiter.api.BeforeEach) AnalyticsVerticle(io.vertx.starter.AnalyticsVerticle) Testcontainers(org.testcontainers.junit.jupiter.Testcontainers) Vertx(io.vertx.core.Vertx) MongoClient(io.vertx.ext.mongo.MongoClient) IOException(java.io.IOException) VertxExtension(io.vertx.junit5.VertxExtension) Instant(java.time.Instant) VertxProjectCodec(io.vertx.starter.VertxProjectCodec) MongoDBContainer(org.testcontainers.containers.MongoDBContainer) Test(org.junit.jupiter.api.Test) Topics(io.vertx.starter.config.Topics) AfterEach(org.junit.jupiter.api.AfterEach) Stream(java.util.stream.Stream) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) DeploymentOptions(io.vertx.core.DeploymentOptions) MINUTES(java.time.temporal.ChronoUnit.MINUTES) Assertions(org.junit.jupiter.api.Assertions) JsonObject(io.vertx.core.json.JsonObject) Checkpoint(io.vertx.junit5.Checkpoint) VertxProject(io.vertx.starter.model.VertxProject) Container(org.testcontainers.junit.jupiter.Container) AnalyticsVerticle(io.vertx.starter.AnalyticsVerticle) DeploymentOptions(io.vertx.core.DeploymentOptions) VertxProjectCodec(io.vertx.starter.VertxProjectCodec) JsonObject(io.vertx.core.json.JsonObject) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

DeploymentOptions (io.vertx.core.DeploymentOptions)1 Vertx (io.vertx.core.Vertx)1 JsonObject (io.vertx.core.json.JsonObject)1 MongoClient (io.vertx.ext.mongo.MongoClient)1 Checkpoint (io.vertx.junit5.Checkpoint)1 VertxExtension (io.vertx.junit5.VertxExtension)1 VertxTestContext (io.vertx.junit5.VertxTestContext)1 AnalyticsVerticle (io.vertx.starter.AnalyticsVerticle)1 VertxProjectCodec (io.vertx.starter.VertxProjectCodec)1 Topics (io.vertx.starter.config.Topics)1 VertxProject (io.vertx.starter.model.VertxProject)1 IOException (java.io.IOException)1 Instant (java.time.Instant)1 MINUTES (java.time.temporal.ChronoUnit.MINUTES)1 Stream (java.util.stream.Stream)1 AfterEach (org.junit.jupiter.api.AfterEach)1 Assertions (org.junit.jupiter.api.Assertions)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 Test (org.junit.jupiter.api.Test)1 ExtendWith (org.junit.jupiter.api.extension.ExtendWith)1