ConnectionFactoryImpl implements ConnectionFactory { @Override public void connect( final ProtonClientOptions options, final Handler<AsyncResult<ProtonConnection>> closeHandler, final Handler<ProtonConnection> disconnectHandler, final Handler<AsyncResult<ProtonConnection>> connectionResultHandler) { connect(options, null, null, closeHandler, disconnectHandler, connectionResultHandler); } ConnectionFactoryImpl(final Vertx vertx, final ClientConfigProperties config); void setProtonClient(final ProtonClient protonClient); @Override String getHost(); @Override int getPort(); @Override String getPathSeparator(); @Override String getServerRole(); @Override void connect(
            final ProtonClientOptions options,
            final Handler<AsyncResult<ProtonConnection>> closeHandler,
            final Handler<ProtonConnection> disconnectHandler,
            final Handler<AsyncResult<ProtonConnection>> connectionResultHandler); @Override void connect(
            final ProtonClientOptions options,
            final String username,
            final String password,
            final Handler<AsyncResult<ProtonConnection>> closeHandler,
            final Handler<ProtonConnection> disconnectHandler,
            final Handler<AsyncResult<ProtonConnection>> connectionResultHandler); @Override void connect(
            final ProtonClientOptions options,
            final String username,
            final String password,
            final String containerId,
            final Handler<AsyncResult<ProtonConnection>> closeHandler,
            final Handler<ProtonConnection> disconnectHandler,
            final Handler<AsyncResult<ProtonConnection>> connectionResultHandler);  }
@Test @Timeout(value = 5, timeUnit = TimeUnit.SECONDS) public void testConnectInvokesHandlerOnFailureToConnect(final VertxTestContext ctx) { final ConnectionFactoryImpl factory = new ConnectionFactoryImpl(vertx, props); factory.connect(null, null, null, ctx.failing(t -> { ctx.verify(() -> assertFalse(t instanceof ConnectTimeoutException)); ctx.completeNow(); })); }