Interface VertxProvider

All Superinterfaces:
Supplier<Vertx>

public interface VertxProvider extends Supplier<Vertx>
A supplier of Vertx instances for use with the @ProvidedBy annotation.

Implementations must have a public no-arg constructor. The Supplier.get() method (inherited from Supplier) should create and return the Vertx instance.

Usage example:

public class MyProvider implements VertxProvider {
  @Override
  public Vertx get() {
    return Vertx.vertx(new VertxOptions().setWorkerPoolSize(4));
  }
}
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    close(Vertx vertx, Duration timeout)
    Called when the test scope ends to clean up the Vertx instance.

    Methods inherited from interface Supplier

    get
  • Method Details

    • close

      default void close(Vertx vertx, Duration timeout) throws Exception
      Called when the test scope ends to clean up the Vertx instance.

      The default implementation calls vertx.close().await() with the given timeout. Override this method for custom cleanup logic.

      Parameters:
      vertx - the Vertx instance to close
      timeout - the maximum duration to wait for the close operation
      Throws:
      Exception - if the close operation fails