From 3cf380dff77d9e0c6c6cfd3ddc7c5fd5c6827cb1 Mon Sep 17 00:00:00 2001 From: marko-bekhta Date: Thu, 8 Dec 2022 17:08:13 +0100 Subject: [PATCH] HSEARCH-4674 Make sure that correct *.properties file is read when configuring the session --- .../coordination/outboxpolling/service/AuthorService.java | 1 + .../{hibernate.properties => actual-hibernate.properties} | 0 .../java/modules/orm/elasticsearch/service/AuthorService.java | 1 + .../{hibernate.properties => actual-hibernate.properties} | 0 .../java/modules/orm/lucene/service/AuthorService.java | 1 + .../{hibernate.properties => actual-hibernate.properties} | 0 6 files changed, 3 insertions(+) rename integrationtest/java/modules/orm-coordination-outbox-polling-elasticsearch/src/main/resources/{hibernate.properties => actual-hibernate.properties} (100%) rename integrationtest/java/modules/orm-elasticsearch/src/main/resources/{hibernate.properties => actual-hibernate.properties} (100%) rename integrationtest/java/modules/orm-lucene/src/main/resources/{hibernate.properties => actual-hibernate.properties} (100%) diff --git a/integrationtest/java/modules/orm-coordination-outbox-polling-elasticsearch/src/main/java/org/hibernate/search/integrationtest/java/modules/orm/elasticsearch/coordination/outboxpolling/service/AuthorService.java b/integrationtest/java/modules/orm-coordination-outbox-polling-elasticsearch/src/main/java/org/hibernate/search/integrationtest/java/modules/orm/elasticsearch/coordination/outboxpolling/service/AuthorService.java index 564edd34e9f..ac6e72445b8 100644 --- a/integrationtest/java/modules/orm-coordination-outbox-polling-elasticsearch/src/main/java/org/hibernate/search/integrationtest/java/modules/orm/elasticsearch/coordination/outboxpolling/service/AuthorService.java +++ b/integrationtest/java/modules/orm-coordination-outbox-polling-elasticsearch/src/main/java/org/hibernate/search/integrationtest/java/modules/orm/elasticsearch/coordination/outboxpolling/service/AuthorService.java @@ -58,6 +58,7 @@ public void triggerValidationFailure() { } private StandardServiceRegistryBuilder applyConnectionProperties(StandardServiceRegistryBuilder registryBuilder) { + registryBuilder.loadProperties( "actual-hibernate.properties" ); // DB properties: Map db = new HashMap<>(); DatabaseContainer.configuration().add( db ); diff --git a/integrationtest/java/modules/orm-coordination-outbox-polling-elasticsearch/src/main/resources/hibernate.properties b/integrationtest/java/modules/orm-coordination-outbox-polling-elasticsearch/src/main/resources/actual-hibernate.properties similarity index 100% rename from integrationtest/java/modules/orm-coordination-outbox-polling-elasticsearch/src/main/resources/hibernate.properties rename to integrationtest/java/modules/orm-coordination-outbox-polling-elasticsearch/src/main/resources/actual-hibernate.properties diff --git a/integrationtest/java/modules/orm-elasticsearch/src/main/java/org/hibernate/search/integrationtest/java/modules/orm/elasticsearch/service/AuthorService.java b/integrationtest/java/modules/orm-elasticsearch/src/main/java/org/hibernate/search/integrationtest/java/modules/orm/elasticsearch/service/AuthorService.java index 19e3780be9b..a1ab0b45452 100644 --- a/integrationtest/java/modules/orm-elasticsearch/src/main/java/org/hibernate/search/integrationtest/java/modules/orm/elasticsearch/service/AuthorService.java +++ b/integrationtest/java/modules/orm-elasticsearch/src/main/java/org/hibernate/search/integrationtest/java/modules/orm/elasticsearch/service/AuthorService.java @@ -58,6 +58,7 @@ public void triggerValidationFailure() { } private StandardServiceRegistryBuilder applyConnectionProperties(StandardServiceRegistryBuilder registryBuilder) { + registryBuilder.loadProperties( "actual-hibernate.properties" ); // DB properties: Map db = new HashMap<>(); DatabaseContainer.configuration().add( db ); diff --git a/integrationtest/java/modules/orm-elasticsearch/src/main/resources/hibernate.properties b/integrationtest/java/modules/orm-elasticsearch/src/main/resources/actual-hibernate.properties similarity index 100% rename from integrationtest/java/modules/orm-elasticsearch/src/main/resources/hibernate.properties rename to integrationtest/java/modules/orm-elasticsearch/src/main/resources/actual-hibernate.properties diff --git a/integrationtest/java/modules/orm-lucene/src/main/java/org/hibernate/search/integrationtest/java/modules/orm/lucene/service/AuthorService.java b/integrationtest/java/modules/orm-lucene/src/main/java/org/hibernate/search/integrationtest/java/modules/orm/lucene/service/AuthorService.java index 4be6f86539c..2342418efc6 100644 --- a/integrationtest/java/modules/orm-lucene/src/main/java/org/hibernate/search/integrationtest/java/modules/orm/lucene/service/AuthorService.java +++ b/integrationtest/java/modules/orm-lucene/src/main/java/org/hibernate/search/integrationtest/java/modules/orm/lucene/service/AuthorService.java @@ -40,6 +40,7 @@ private SessionFactory createSessionFactory() { } private StandardServiceRegistryBuilder applyConnectionProperties(StandardServiceRegistryBuilder registryBuilder) { + registryBuilder.loadProperties( "actual-hibernate.properties" ); // DB properties: Map db = new HashMap<>(); DatabaseContainer.configuration().add( db ); diff --git a/integrationtest/java/modules/orm-lucene/src/main/resources/hibernate.properties b/integrationtest/java/modules/orm-lucene/src/main/resources/actual-hibernate.properties similarity index 100% rename from integrationtest/java/modules/orm-lucene/src/main/resources/hibernate.properties rename to integrationtest/java/modules/orm-lucene/src/main/resources/actual-hibernate.properties