diff --git a/integrationtest/mapper/orm-realbackend/src/test/java/org/hibernate/search/integrationtest/mapper/orm/realbackend/schema/management/ElasticsearchSchemaManagerExporterIT.java b/integrationtest/mapper/orm-realbackend/src/test/java/org/hibernate/search/integrationtest/mapper/orm/realbackend/schema/management/ElasticsearchSchemaManagerExporterIT.java index 65d172ee5d7..3f891bbae93 100644 --- a/integrationtest/mapper/orm-realbackend/src/test/java/org/hibernate/search/integrationtest/mapper/orm/realbackend/schema/management/ElasticsearchSchemaManagerExporterIT.java +++ b/integrationtest/mapper/orm-realbackend/src/test/java/org/hibernate/search/integrationtest/mapper/orm/realbackend/schema/management/ElasticsearchSchemaManagerExporterIT.java @@ -14,15 +14,18 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; +import java.util.Map; import java.util.stream.Collectors; import java.util.stream.Stream; import jakarta.persistence.EntityManagerFactory; +import org.hibernate.search.backend.elasticsearch.cfg.ElasticsearchBackendSettings; import org.hibernate.search.integrationtest.mapper.orm.realbackend.testsupport.BackendConfigurations; import org.hibernate.search.integrationtest.mapper.orm.realbackend.util.Article; import org.hibernate.search.integrationtest.mapper.orm.realbackend.util.Book; import org.hibernate.search.mapper.orm.Search; +import org.hibernate.search.mapper.orm.cfg.HibernateOrmMapperSettings; import org.hibernate.search.util.impl.integrationtest.backend.elasticsearch.dialect.ElasticsearchTestDialect; import org.hibernate.search.util.impl.integrationtest.mapper.orm.OrmSetupHelper; @@ -35,7 +38,10 @@ public class ElasticsearchSchemaManagerExporterIT { @Rule public final TemporaryFolder temporaryFolder = new TemporaryFolder(); @Rule - public OrmSetupHelper setupHelper = OrmSetupHelper.withSingleBackend( BackendConfigurations.simple() ); + public OrmSetupHelper setupHelper = OrmSetupHelper.withMultipleBackends( + BackendConfigurations.simple(), + Map.of( Article.BACKEND_NAME, BackendConfigurations.simple() ) + ); private EntityManagerFactory entityManagerFactory; @@ -51,15 +57,11 @@ public void elasticsearch() throws IOException { String version = ElasticsearchTestDialect.getActualVersion().toString(); entityManagerFactory = setupHelper.start() // so that we don't try to do anything with the schema and allow to run without ES being up: - .withProperty( "hibernate.search.schema_management.strategy", "none" ) - - .withProperty( "hibernate.search.backend.type", "elasticsearch" ) - .withProperty( "hibernate.search.backend.version_check.enabled", false ) - .withProperty( "hibernate.search.backend.version", version ) - - .withProperty( "hibernate.search.backends." + Article.BACKEND_NAME + ".type", "elasticsearch" ) - .withProperty( "hibernate.search.backends." + Article.BACKEND_NAME + ".version_check.enabled", false ) - .withProperty( "hibernate.search.backends." + Article.BACKEND_NAME + ".version", version ) + .withProperty( HibernateOrmMapperSettings.SCHEMA_MANAGEMENT_STRATEGY, "none" ) + .withBackendProperty( ElasticsearchBackendSettings.VERSION_CHECK_ENABLED, false ) + .withBackendProperty( ElasticsearchBackendSettings.VERSION, version ) + .withBackendProperty( Article.BACKEND_NAME, ElasticsearchBackendSettings.VERSION_CHECK_ENABLED, false ) + .withBackendProperty( Article.BACKEND_NAME, ElasticsearchBackendSettings.VERSION, version ) .setup( Book.class, Article.class ); Path directory = temporaryFolder.newFolder().toPath(); diff --git a/integrationtest/mapper/orm-realbackend/src/test/java/org/hibernate/search/integrationtest/mapper/orm/realbackend/schema/management/LuceneSchemaManagerExporterIT.java b/integrationtest/mapper/orm-realbackend/src/test/java/org/hibernate/search/integrationtest/mapper/orm/realbackend/schema/management/LuceneSchemaManagerExporterIT.java index e99adca80c4..413f8809bb5 100644 --- a/integrationtest/mapper/orm-realbackend/src/test/java/org/hibernate/search/integrationtest/mapper/orm/realbackend/schema/management/LuceneSchemaManagerExporterIT.java +++ b/integrationtest/mapper/orm-realbackend/src/test/java/org/hibernate/search/integrationtest/mapper/orm/realbackend/schema/management/LuceneSchemaManagerExporterIT.java @@ -11,6 +11,7 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; +import java.util.Map; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -31,17 +32,16 @@ public class LuceneSchemaManagerExporterIT { @Rule public final TemporaryFolder temporaryFolder = new TemporaryFolder(); @Rule - public OrmSetupHelper setupHelper = OrmSetupHelper.withSingleBackend( BackendConfigurations.simple() ); + public OrmSetupHelper setupHelper = OrmSetupHelper.withMultipleBackends( + BackendConfigurations.simple(), + Map.of( Article.BACKEND_NAME, BackendConfigurations.simple() ) + ); private EntityManagerFactory entityManagerFactory; @Test public void lucene() throws IOException { - entityManagerFactory = setupHelper.start() - .withProperty( "hibernate.search.backend.type", "lucene" ) - - .withProperty( "hibernate.search.backends." + Article.BACKEND_NAME + ".type", "lucene" ) - .setup( Book.class, Article.class ); + entityManagerFactory = setupHelper.start().setup( Book.class, Article.class ); Path directory = temporaryFolder.newFolder().toPath(); Search.mapping( entityManagerFactory ).scope( Object.class ).schemaManager().exportExpectedSchema( directory );