Skip to content

Commit 77af73b

Browse files
committed
HHH-19846 - Remove JUnit4: org.hibernate.orm.test.mapping.dynamic
Signed-off-by: Jan Schatteman <[email protected]>
1 parent 69e482a commit 77af73b

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

hibernate-core/src/test/java/org/hibernate/orm/test/mapping/dynamic/DynamicEntityTest.java

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,37 @@
44
*/
55
package org.hibernate.orm.test.mapping.dynamic;
66

7+
import java.util.Collections;
78
import java.util.HashMap;
89
import java.util.Map;
910

1011
import org.hibernate.Session;
11-
import org.hibernate.orm.test.jpa.BaseEntityManagerFunctionalTestCase;
1212

13-
import org.junit.Test;
14-
15-
import static org.hibernate.testing.transaction.TransactionUtil.doInJPA;
13+
import org.hibernate.testing.orm.junit.EntityManagerFactoryScope;
14+
import org.hibernate.testing.orm.junit.Jpa;
15+
import org.hibernate.testing.orm.junit.Setting;
16+
import org.junit.jupiter.api.Test;
1617

1718
/**
1819
* @author Vlad Mihalcea
1920
*/
20-
public class DynamicEntityTest extends BaseEntityManagerFunctionalTestCase {
21-
22-
@Override
23-
protected String[] getMappings() {
24-
return new String[] {
25-
"org/hibernate/orm/test/mapping/dynamic/Book.hbm.xml"
26-
};
27-
}
28-
29-
@Override
30-
protected Map buildSettings() {
31-
Map settings = super.buildSettings();
21+
@Jpa(
22+
xmlMappings = {"org/hibernate/orm/test/mapping/dynamic/Book.hbm.xml"},
23+
integrationSettings = {@Setting( name = "hibernate.default_entity_mode", value = "dynamic-map")}
24+
)
25+
public class DynamicEntityTest {
26+
27+
// Preserved because of the doc inclusions
28+
protected void doesNothing() {
29+
Map settings = Collections.EMPTY_MAP;
3230
//tag::mapping-model-dynamic-setting-example[]
3331
settings.put("hibernate.default_entity_mode", "dynamic-map");
3432
//end::mapping-model-dynamic-setting-example[]
35-
return settings;
3633
}
3734

3835
@Test
39-
public void test() {
40-
doInJPA(this::entityManagerFactory, entityManager -> {
36+
public void test(EntityManagerFactoryScope scope) {
37+
scope.inTransaction( entityManager -> {
4138
//tag::mapping-model-dynamic-example[]
4239

4340
Map<String, String> book = new HashMap<>();

0 commit comments

Comments
 (0)