44 */
55import org .hibernate .query .Query ;
66
7+ import org .hibernate .testing .orm .junit .DomainModel ;
78import 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
1113import static org .junit .Assert .assertEquals ;
1214
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