vertx / io.vertx.ext.unit.junit / RunTestOnContext / <init>

# <init>

`RunTestOnContext()`

Create a new rule managing a Vertx instance created with default options. The Vert.x instance is created and closed for each test.

`RunTestOnContext(options: VertxOptions)`

Create a new rule managing a Vertx instance created with specified options. The Vert.x instance is created and closed for each test.

### Parameters

`options` - the vertx options

`RunTestOnContext(createVertx: Supplier<Vertx>, closeVertx: BiConsumer<Vertx, Consumer<Void>>)`

Create a new rule with supplier/consumer for creating/closing a Vert.x instance. The lambda are invoked for each test. The `closeVertx` lambda should invoke the consumer with null when the `vertx` instance is closed.

### Parameters

`createVertx` - the create Vert.x supplier

`closeVertx` - the close Vert.x consumer

`RunTestOnContext(createVertx: Supplier<Vertx>)`

Create a new rule with supplier for creating a Vert.x instance. The lambda are invoked for each test.

### Parameters

`createVertx` - the create Vert.x supplier