DBZ-5758 Use exposed mapped port for Outbox Reactive tests

This commit is contained in:
Chris Cranford 2023-02-06 12:44:08 -05:00 committed by Jiri Pechanec
parent 31e49efc35
commit 1f41336b38

View File

@ -40,10 +40,8 @@ public Map<String, String> start() {
.withEnv("LANG", "en_US.utf8")
.withStartupTimeout(Duration.ofSeconds(30));
postgresContainer.start();
// needed for quarkus reactive
String postgresstring = "vertx-reactive:postgresql://" + postgresContainer.getHost() + ":" + "5432" + "/" + "postgres";
Map properties = new HashMap<String, String>();
properties.put("quarkus.datasource.reactive.url", postgresstring);
final Map properties = new HashMap<String, String>();
properties.put("quarkus.datasource.reactive.url", getVertxReactiveJdbcUrl(postgresContainer));
properties.put("quarkus.datasource.db-kind", "postgresql");
return properties;
}
@ -63,4 +61,9 @@ public void stop() {
// ignored
}
}
protected String getVertxReactiveJdbcUrl(PostgreSQLContainer<?> container) {
// Quarkus Reactive requires accessing the database using this approach
return String.format("vertx-reactive:postgresql://%s:%d/postgres", container.getHost(), container.getMappedPort(5432));
}
}