Skip to content

Commit 9666c0f

Browse files
committed
HHH-19846 - Remove JUnit4: root package
Signed-off-by: Jan Schatteman <[email protected]>
1 parent 04ec9c6 commit 9666c0f

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

hibernate-core/src/test/java/NoPackageTest.java

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
*/
55
import org.hibernate.query.Query;
66

7+
import org.hibernate.testing.orm.junit.DomainModel;
78
import org.hibernate.testing.orm.junit.JiraKey;
8-
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
9-
import org.junit.Test;
9+
import org.hibernate.testing.orm.junit.SessionFactory;
10+
import org.hibernate.testing.orm.junit.SessionFactoryScope;
11+
import org.junit.jupiter.api.Test;
1012

1113
import static org.junit.Assert.assertEquals;
1214

@@ -15,18 +17,20 @@
1517
* We had problems with ByteBuddy in the past.
1618
*/
1719
@JiraKey(value = "HHH-13112")
18-
public class NoPackageTest extends BaseCoreFunctionalTestCase {
20+
@DomainModel(annotatedClasses = {AnnotationMappedNoPackageEntity.class})
21+
@SessionFactory
22+
public class NoPackageTest {
1923

2024
@Test
21-
public void testNoException() {
22-
inTransaction( session -> {
25+
public void testNoException(SessionFactoryScope scope) {
26+
scope.inTransaction( session -> {
2327
AnnotationMappedNoPackageEntity box = new AnnotationMappedNoPackageEntity();
2428
box.setId( 42 );
2529
box.setName( "This feels dirty" );
2630
session.persist( box );
2731
} );
2832

29-
inTransaction( session -> {
33+
scope.inTransaction( session -> {
3034
Query<AnnotationMappedNoPackageEntity> query = session.createQuery(
3135
"select e from " + AnnotationMappedNoPackageEntity.class.getSimpleName() + " e",
3236
AnnotationMappedNoPackageEntity.class
@@ -35,11 +39,4 @@ public void testNoException() {
3539
assertEquals( (Integer) 42, box.getId() );
3640
} );
3741
}
38-
39-
@Override
40-
public Class<?>[] getAnnotatedClasses() {
41-
return new Class[] {
42-
AnnotationMappedNoPackageEntity.class
43-
};
44-
}
4542
}

0 commit comments

Comments
 (0)