Source:
<code>public void setup() { StandardServiceRegistryBuilder registryBuilder = new StandardServiceRegistryBuilder() .applySetting( PREFIX + "backends.elasticsearchBackend_1.type", ElasticsearchBackendFactory.class.getName() ) .applySetting( PREFIX + "indexes.default.backend", "elasticsearchBackend_1" ) .applySetting( PREFIX + "backends.elasticsearchBackend_1.log.json_pretty_printing", true ) .applySetting( PREFIX + "backends.elasticsearchBackend_1." + SearchBackendElasticsearchSettings.ANALYSIS_CONFIGURER, new LibraryAnalysisConfigurer() ) .applySetting( org.hibernate.cfg.AvailableSettings.HBM2DDL_AUTO, Action.CREATE_DROP ) .applySetting( SearchOrmSettings.INDEXING_STRATEGY, IndexingStrategyConfiguration.MANUAL ); ServiceRegistry serviceRegistry = registryBuilder.build(); MetadataSources ms = new MetadataSources( serviceRegistry ) .addAnnotatedClass( Document.class ) .addAnnotatedClass( Book.class ) .addAnnotatedClass( Video.class ) .addAnnotatedClass( Library.class ) .addAnnotatedClass( DocumentCopy.class ) .addAnnotatedClass( BookCopy.class ) .addAnnotatedClass( VideoCopy.class ) .addAnnotatedClass( Person.class ) .addAnnotatedClass( Account.class ) .addAnnotatedClass( Borrowal.class ); Metadata metadata = ms.buildMetadata(); final SessionFactoryBuilder sfb = metadata.getSessionFactoryBuilder(); this.sessionFactory = sfb.build(); withinTransaction( sessionFactory, this::initData ); <START> withinTransaction( sessionFactory, this::invokeMassIndexing ); <END> }</code><technical_language>I spot this first: move this line main test method (and rename method "testMassindexing" that. testing is mass indexing. test mass indexing works? 1. Check is indexed (run a query matches everything, result) 2. Run mass indexing 3. Check is indexed Currently test method step, steps considered "test setup", is wrong lead confusing reporting if mass indexing breaks</technical_language>

Target:
public void setup() { StandardServiceRegistryBuilder registryBuilder = new StandardServiceRegistryBuilder() .applySetting( PREFIX + "backends.elasticsearchBackend_1.type", ElasticsearchBackendFactory.class.getName() ) .applySetting( PREFIX + "indexes.default.backend", "elasticsearchBackend_1" ) .applySetting( PREFIX + "backends.elasticsearchBackend_1.log.json_pretty_printing", true ) .applySetting( PREFIX + "backends.elasticsearchBackend_1." + SearchBackendElasticsearchSettings.ANALYSIS_CONFIGURER, new LibraryAnalysisConfigurer() ) .applySetting( org.hibernate.cfg.AvailableSettings.HBM2DDL_AUTO, Action.CREATE_DROP ) .applySetting( SearchOrmSettings.INDEXING_STRATEGY, IndexingStrategyConfiguration.MANUAL ); ServiceRegistry serviceRegistry = registryBuilder.build(); MetadataSources ms = new MetadataSources( serviceRegistry ) .addAnnotatedClass( Document.class ) .addAnnotatedClass( Book.class ) .addAnnotatedClass( Video.class ) .addAnnotatedClass( Library.class ) .addAnnotatedClass( DocumentCopy.class ) .addAnnotatedClass( BookCopy.class ) .addAnnotatedClass( VideoCopy.class ) .addAnnotatedClass( Person.class ) .addAnnotatedClass( Account.class ) .addAnnotatedClass( Borrowal.class ); Metadata metadata = ms.buildMetadata(); final SessionFactoryBuilder sfb = metadata.getSessionFactoryBuilder(); this.sessionFactory = sfb.build(); withinTransaction( sessionFactory, this::initData ); }