Elasticsearch backend in the classpath causes eager initialization of non related IndexManagers

Description

I have a test where I am not using the Elasticsearch index manager, but I do have it in the classpath.

This causes some Services from the elasticsearch backend to be loaded, namely
ElasticsearchNestingContextFactoryProvider which will cause my indexmanager (which is not elasticsearch) to be eagerly initialized.

This happens in the method isMappedToElasticsearch.

This is not desirable since I have multiple shards and each shard consumes extra resources.

Environment

None

Status

Assignee

Yoann Rodière

Reporter

Gustavo Fernandes

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Priority

Minor