Skip to content

Commit bb95398

Browse files
DavideDblafond
authored andcommitted
[#1397] Clean up OrphanRemovelTest
* The tables weren't cleaned after each test (not biggie in this case) * OrphanRemovalTest#Product was using the same table as OrderQueriesTestBase#Product: this was causing errors when reusing the same docker instance between tests
1 parent 16fe525 commit bb95398

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

hibernate-reactive-core/src/test/java/org/hibernate/reactive/OrphanRemovalTest.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@
55
*/
66
package org.hibernate.reactive;
77

8+
import java.util.Collection;
89
import java.util.HashSet;
10+
import java.util.List;
911
import java.util.Set;
1012
import javax.persistence.Entity;
1113
import javax.persistence.GeneratedValue;
1214
import javax.persistence.Id;
1315
import javax.persistence.ManyToOne;
1416
import javax.persistence.OneToMany;
17+
import javax.persistence.Table;
1518

16-
import org.hibernate.cfg.Configuration;
1719

1820
import org.junit.Test;
1921

@@ -27,12 +29,8 @@
2729
public class OrphanRemovalTest extends BaseReactiveTest {
2830

2931
@Override
30-
protected Configuration constructConfiguration() {
31-
Configuration configuration = super.constructConfiguration();
32-
configuration.addAnnotatedClass( Version.class );
33-
configuration.addAnnotatedClass( Product.class );
34-
configuration.addAnnotatedClass( Shop.class );
35-
return configuration;
32+
protected Collection<Class<?>> annotatedEntities() {
33+
return List.of( Shop.class, Version.class, Product.class );
3634
}
3735

3836
@Test
@@ -78,6 +76,7 @@ public void testOrphan(TestContext context) {
7876
}
7977

8078
@Entity(name = "ProductVersion")
79+
@Table(name = "ORT_ProductVersion")
8180
public static class Version {
8281
@Id
8382
@GeneratedValue
@@ -100,6 +99,7 @@ public String toString() {
10099
}
101100

102101
@Entity(name = "Product")
102+
@Table(name = "ORT_Product")
103103
public static class Product {
104104

105105
@Id
@@ -132,6 +132,7 @@ public String toString() {
132132
}
133133

134134
@Entity(name = "Shop")
135+
@Table(name = "ORT_Shop")
135136
public static class Shop {
136137

137138
@Id

0 commit comments

Comments
 (0)