You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2024/01/31 17:28:44 UTC
(camel-quarkus-examples) 09/12: Avoid use of localhost in derby JDBC URL
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus-examples.git
commit 3000b2c24c423d53463519ca4615d685f64f36f8
Author: James Netherton <ja...@gmail.com>
AuthorDate: Wed Jan 3 09:31:34 2024 +0000
Avoid use of localhost in derby JDBC URL
---
.../org/acme/jpa/idempotent/repository/DerbyTestResource.java | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/jpa-idempotent-repository/src/test/java/org/acme/jpa/idempotent/repository/DerbyTestResource.java b/jpa-idempotent-repository/src/test/java/org/acme/jpa/idempotent/repository/DerbyTestResource.java
index 6e456a2..e45da44 100644
--- a/jpa-idempotent-repository/src/test/java/org/acme/jpa/idempotent/repository/DerbyTestResource.java
+++ b/jpa-idempotent-repository/src/test/java/org/acme/jpa/idempotent/repository/DerbyTestResource.java
@@ -52,10 +52,12 @@ public class DerbyTestResource<T extends GenericContainer> implements QuarkusTes
container.execInContainer("java", "-Djdbc.drivers=org.apache.derbbc.EmbeddedDriver",
"org.apache.derby.tools.ij", "/init.sql");
- return CollectionHelper.mapOf("quarkus.datasource.jdbc.url",
- "jdbc:derby://localhost:" + container.getMappedPort(DERBY_PORT) + "/my-db", "timer.period", "100",
- "timer.delay",
- "0", "timer.repeatCount", "4");
+ String url = "jdbc:derby://%s:%d/my-db".formatted(container.getHost(), container.getMappedPort(DERBY_PORT));
+ return CollectionHelper.mapOf(
+ "quarkus.datasource.jdbc.url", url,
+ "timer.period", "100",
+ "timer.delay", "0",
+ "timer.repeatCount", "4");
} catch (Exception e) {
LOGGER.error("An error occurred while starting the derby container", e);
throw new RuntimeException(e);