From 7575c0338155fd02e94fd14c777a015a2ed09fb2 Mon Sep 17 00:00:00 2001 From: Avgustin Marinov Date: Sat, 21 Dec 2024 10:09:56 +0200 Subject: [PATCH] Add support for tests with mysql without jdbc:mariadib protocol Signed-off-by: Avgustin Marinov --- .../hawkbit/repository/test/util/MySqlTestDatabase.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/util/MySqlTestDatabase.java b/hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/util/MySqlTestDatabase.java index 7299bd22d9..733a8a93f5 100644 --- a/hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/util/MySqlTestDatabase.java +++ b/hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/util/MySqlTestDatabase.java @@ -21,7 +21,7 @@ @Slf4j public class MySqlTestDatabase extends AbstractSqlTestDatabase { - protected static final String MYSQL_URI_PATTERN = "jdbc:mariadb://{host}:{port}/{db}*"; + protected static final String MYSQL_URI_PATTERN = "{proto}://{host}:{port}/{db}*"; public MySqlTestDatabase(final DatasourceContext context) { super(context); @@ -51,7 +51,9 @@ protected String getRandomSchemaUri() { final String uri = context.getDatasourceUrl(); final Map databaseProperties = MATCHER.extractUriTemplateVariables(MYSQL_URI_PATTERN, uri); - return MYSQL_URI_PATTERN.replace("{host}", databaseProperties.get("host")) + return MYSQL_URI_PATTERN + .replace("{proto}", databaseProperties.get("proto")) + .replace("{host}", databaseProperties.get("host")) .replace("{port}", databaseProperties.get("port")) .replace("{db}*", context.getRandomSchemaName()); }