use of io.vertx.core.eventbus.EventBusOptions in project vert.x by eclipse.
the class MetricsContextTest method testFactoryInCluster.
@Test
public void testFactoryInCluster() throws Exception {
AtomicReference<Thread> metricsThread = new AtomicReference<>();
AtomicReference<Context> metricsContext = new AtomicReference<>();
Thread testThread = Thread.currentThread();
VertxMetricsFactory factory = (options) -> {
metricsThread.set(Thread.currentThread());
metricsContext.set(Vertx.currentContext());
return DummyVertxMetrics.INSTANCE;
};
VertxOptions options = new VertxOptions().setMetricsOptions(new MetricsOptions().setEnabled(true).setFactory(factory)).setEventBusOptions(new EventBusOptions());
clusteredVertx(options, onSuccess(vertx -> {
assertSame(testThread, metricsThread.get());
assertNull(metricsContext.get());
testComplete();
}));
await();
}
Aggregations