VertxBasedHealthCheckServer implements HealthCheckServer { @Override public Future<Void> start() { registerAdditionalResources(); return CompositeFuture.all(bindSecureHttpServer(), bindInsecureHttpServer()) .map(ok -> { if (insecureServer == null && server == null) { throw new IllegalStateException("neither secure nor insecure server has been started"); } else { return (Void) null; } }) .recover(error -> { LOG.error("failed to start Health Check server", error); return Future.failedFuture(error); }); } VertxBasedHealthCheckServer(final Vertx vertx, final ServerConfig config); @Override void registerHealthCheckResources(final HealthCheckProvider serviceInstance); @Autowired(required = false) @Qualifier("healthchecks") void setAdditionalResources(final List<Handler<Router>> resourceProviders); @Override Future<Void> start(); @Override Future<Void> stop();  }
@Test void testHealthCheckServerWithNoBindAddressFailsToStart(final Vertx vertx, final VertxTestContext ctx) { final ServerConfig config = new ServerConfig(); server = new VertxBasedHealthCheckServer(vertx, config); server.start().onComplete(ctx.failing(error -> ctx.completeNow())); }