Skip to content

Commit 6afd408

Browse files
committed
HHH-19846 Drop JUnit 4 usage
1 parent ec0b015 commit 6afd408

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

hibernate-core/src/test/java/org/hibernate/orm/test/array/DateArrayTest.java

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,38 @@
44
*/
55
package org.hibernate.orm.test.array;
66

7-
import java.util.Date;
8-
9-
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
10-
import org.junit.Test;
11-
127
import jakarta.persistence.Column;
138
import jakarta.persistence.ElementCollection;
149
import jakarta.persistence.Entity;
1510
import jakarta.persistence.GeneratedValue;
1611
import jakarta.persistence.Id;
1712
import jakarta.persistence.OrderColumn;
13+
import org.hibernate.testing.orm.junit.DomainModel;
14+
import org.hibernate.testing.orm.junit.SessionFactory;
15+
import org.hibernate.testing.orm.junit.SessionFactoryScope;
16+
import org.junit.jupiter.api.Test;
1817

19-
public class DateArrayTest extends BaseCoreFunctionalTestCase {
18+
import java.util.Date;
2019

21-
@Override
22-
protected Class<?>[] getAnnotatedClasses() {
23-
return new Class[] { DateArrayEntity.class };
24-
}
20+
@DomainModel(
21+
annotatedClasses = {
22+
DateArrayTest.DateArrayEntity.class
23+
}
24+
)
25+
@SessionFactory
26+
public class DateArrayTest {
2527

2628
@Test
27-
public void run() throws InterruptedException {
28-
inTransaction( session -> {
29+
public void run(SessionFactoryScope scope) {
30+
scope.inTransaction( session -> {
2931
DateArrayEntity entity = new DateArrayEntity();
30-
entity.setDates( new Date[] { new Date() } );
32+
entity.setDates( new Date[] {new Date()} );
3133
session.persist( entity );
3234
} );
3335
}
3436

3537
@Entity(name = "DateArrayEntity")
36-
public class DateArrayEntity {
38+
public static class DateArrayEntity {
3739

3840
@Id
3941
@GeneratedValue

0 commit comments

Comments
 (0)