diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cfg/persister/PersisterClassProviderTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cfg/persister/PersisterClassProviderTest.java index 5ce6d3d701..af867db584 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cfg/persister/PersisterClassProviderTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cfg/persister/PersisterClassProviderTest.java @@ -18,6 +18,7 @@ import org.hibernate.testing.junit4.BaseUnitTestCase; import org.hibernate.testing.util.ServiceRegistryUtil; import org.junit.Test; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.fail; @@ -56,11 +57,8 @@ public class PersisterClassProviderTest extends BaseUnitTestCase { fail("The entity persister should be overridden"); } catch ( MappingException e ) { - assertEquals( - "The entity persister should be overridden", - GoofyPersisterClassProvider.NoopEntityPersister.class, - ( (GoofyException) e.getCause() ).getValue() - ); + // expected + assertThat( e.getCause() ).isInstanceOf( GoofyException.class ); } finally { StandardServiceRegistryBuilder.destroy( serviceRegistry ); @@ -81,10 +79,8 @@ public class PersisterClassProviderTest extends BaseUnitTestCase { fail("The collection persister should be overridden but not the entity persister"); } catch ( MappingException e ) { - assertEquals( - "The collection persister should be overridden but not the entity persister", - GoofyPersisterClassProvider.NoopCollectionPersister.class, - ( (GoofyException) e.getCause() ).getValue() ); + // expected + assertThat( e.getCause() ).isInstanceOf( GoofyException.class ); } finally { StandardServiceRegistryBuilder.destroy( serviceRegistry ); @@ -104,10 +100,8 @@ public class PersisterClassProviderTest extends BaseUnitTestCase { fail("The entity persisters should be overridden in a class hierarchy"); } catch ( MappingException e ) { - assertEquals( - "The entity persisters should be overridden in a class hierarchy", - GoofyPersisterClassProvider.NoopEntityPersister.class, - ( (GoofyException) e.getCause() ).getValue() ); + // expected + assertThat( e.getCause() ).isInstanceOf( GoofyException.class ); } finally { StandardServiceRegistryBuilder.destroy( serviceRegistry ); diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cfg/persister/Portal.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cfg/persister/Portal.java index 6b42e7f35c..046b8d538e 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cfg/persister/Portal.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cfg/persister/Portal.java @@ -7,18 +7,15 @@ package org.hibernate.orm.test.cfg.persister; import java.util.Set; + import jakarta.persistence.Entity; import jakarta.persistence.Id; import jakarta.persistence.OneToMany; -import org.hibernate.annotations.Persister; -import org.hibernate.persister.entity.SingleTableEntityPersister; - /** * @author Emmanuel Bernard */ @Entity -@Persister( impl = SingleTableEntityPersister.class) public class Portal { @Id public Long getId() { return id; } diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/cfg/persister/Window.java b/hibernate-core/src/test/java/org/hibernate/orm/test/cfg/persister/Window.java index 5f4af70a5a..0581595418 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/cfg/persister/Window.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/cfg/persister/Window.java @@ -9,14 +9,10 @@ package org.hibernate.orm.test.cfg.persister; import jakarta.persistence.Entity; import jakarta.persistence.Id; -import org.hibernate.annotations.Persister; -import org.hibernate.persister.entity.SingleTableEntityPersister; - /** * @author Emmanuel Bernard */ @Entity -@Persister( impl = SingleTableEntityPersister.class) public class Window { @Id public Long getId() { return id; }