Skip to content

Commit 3312ce6

Browse files
committed
HSEARCH-5443 Adjust the ParameterizedClass migrated test to better match previous behavior
1 parent c628e39 commit 3312ce6

File tree

1 file changed

+9
-9
lines changed
  • integrationtest/mapper/orm-jakarta-batch/src/test/java/org/hibernate/search/integrationtest/jakarta/batch/massindexing

1 file changed

+9
-9
lines changed

integrationtest/mapper/orm-jakarta-batch/src/test/java/org/hibernate/search/integrationtest/jakarta/batch/massindexing/MassIndexingJobIT.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,10 @@
4141
import org.hibernate.search.util.impl.integrationtest.mapper.orm.OrmSetupHelper;
4242
import org.hibernate.search.util.impl.test.annotation.TestForIssue;
4343

44+
import org.junit.jupiter.api.AfterEach;
4445
import org.junit.jupiter.api.BeforeEach;
4546
import org.junit.jupiter.api.Test;
46-
import org.junit.jupiter.api.TestInstance;
4747
import org.junit.jupiter.api.extension.RegisterExtension;
48-
import org.junit.jupiter.params.BeforeParameterizedClassInvocation;
4948
import org.junit.jupiter.params.Parameter;
5049
import org.junit.jupiter.params.ParameterizedClass;
5150
import org.junit.jupiter.params.provider.Arguments;
@@ -56,7 +55,6 @@
5655
*/
5756
@ParameterizedClass
5857
@MethodSource("params")
59-
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
6058
class MassIndexingJobIT {
6159

6260
public static List<? extends Arguments> params() {
@@ -79,22 +77,19 @@ public static List<? extends Arguments> params() {
7977
@RegisterExtension
8078
public static OrmSetupHelper ormSetupHelper = OrmSetupHelper.withSingleBackend( BackendConfigurations.simple() );
8179

82-
private static EntityManagerFactory emf;
80+
private EntityManagerFactory emf;
8381

8482
@Parameter(0)
8583
static boolean jpaCompliance;
8684

87-
@BeforeParameterizedClassInvocation
88-
static void setup() {
85+
@BeforeEach
86+
void initData() {
8987
emf = ormSetupHelper.start()
9088
.withAnnotatedTypes( Company.class, Person.class, WhoAmI.class, CompanyGroup.class )
9189
.withProperty( "hibernate.jpa.compliance.query", jpaCompliance )
9290
.withProperty( HibernateOrmMapperSettings.INDEXING_LISTENERS_ENABLED, false )
9391
.setup();
94-
}
9592

96-
@BeforeEach
97-
void initData() {
9893
List<Company> companies = new ArrayList<>();
9994
List<Person> people = new ArrayList<>();
10095
List<WhoAmI> whos = new ArrayList<>();
@@ -133,6 +128,11 @@ void initData() {
133128
} );
134129
}
135130

131+
@AfterEach
132+
void tearDown() {
133+
emf.close();
134+
}
135+
136136
@Test
137137
void simple() throws InterruptedException {
138138
List<Company> companies = JobTestUtil.findIndexedResults( emf, Company.class, "name", "Google" );

0 commit comments

Comments
 (0)