PostgresHandle { PgConnectOptions getOptions() { return connectOptions; } PostgresHandle(Vertx vertx, JsonObject conf); Future<SqlConnection> getConnection(); PostgresQuery getQuery();  }
@Test void hostAndPort(Vertx vertx) { PostgresHandle postgresHandle = new PostgresHandle(vertx, new JsonObject().put("postgres_host", "example.com").put("postgres_port", "9876")); assertThat(postgresHandle.getOptions()) .extracting("getHost", "getPort").containsExactly("example.com", 9876); }
@Test void ignoreInvalidPortNumber(Vertx vertx) { PostgresHandle postgresHandle = new PostgresHandle(vertx, new JsonObject().put("postgres_port", "q")); assertThat(postgresHandle.getOptions()) .extracting("getHost", "getPort").containsExactly("localhost", 5432); }