diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cut/generic/GenericCompositeUserTypeTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cut/generic/GenericCompositeUserTypeTest.java index bd96bbc83e..f4caec7a98 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cut/generic/GenericCompositeUserTypeTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cut/generic/GenericCompositeUserTypeTest.java @@ -1,34 +1,30 @@ package org.hibernate.orm.test.cut.generic; -import org.hibernate.Session; -import org.hibernate.Transaction; - import org.hibernate.testing.TestForIssue; -import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; -import org.junit.Test; +import org.hibernate.testing.orm.junit.DomainModel; +import org.hibernate.testing.orm.junit.SessionFactory; +import org.hibernate.testing.orm.junit.SessionFactoryScope; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledIfSystemProperty; @TestForIssue(jiraKey = "HHH-17019") -public class GenericCompositeUserTypeTest extends BaseCoreFunctionalTestCase { +@DomainModel( + annotatedClasses = { + GenericCompositeUserTypeEntity.class + } +) +@SessionFactory +public class GenericCompositeUserTypeTest { - @Override - protected Class[] getAnnotatedClasses() { - return new Class[] { - GenericCompositeUserTypeEntity.class - }; - } + @Test + @DisabledIfSystemProperty(named = "java.vm.name", matches = "\\b.*OpenJ9.*\\b", disabledReason = "https://github.com/eclipse-openj9/openj9/issues/19369") + public void hhh17019Test(SessionFactoryScope scope) { + scope.inTransaction( session -> { + EnumPlaceholder placeholder = new EnumPlaceholder<>( Weekdays.MONDAY, Weekdays.SUNDAY ); + GenericCompositeUserTypeEntity entity = new GenericCompositeUserTypeEntity( placeholder ); - @Test - public void hhh17019Test() throws Exception { - Session s = openSession(); - Transaction tx = s.beginTransaction(); - - EnumPlaceholder placeholder = new EnumPlaceholder<>( Weekdays.MONDAY, Weekdays.SUNDAY ); - GenericCompositeUserTypeEntity entity = new GenericCompositeUserTypeEntity( placeholder ); - - s.persist( entity ); - - tx.commit(); - s.close(); - } + session.persist( entity ); + } ); + } }