Skip to content

Commit 2f1a7a0

Browse files
committed
Merge pull request hibernate#29 from dreab8/HHH_10664_NonNullableCircularDependencyCascadeTest
Fix NonNullableCircularDependencyCascadeTest
2 parents de4d6ab + e089743 commit 2f1a7a0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

hibernate-core/src/test/java/org/hibernate/test/annotations/cascade/NonNullableCircularDependencyCascadeTest.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@
1010

1111
import org.junit.Test;
1212

13-
import org.hibernate.HibernateException;
1413
import org.hibernate.Session;
1514
import org.hibernate.Transaction;
15+
import org.hibernate.TransientPropertyValueException;
16+
1617
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
1718

19+
import static org.hamcrest.core.IsInstanceOf.instanceOf;
20+
import static org.junit.Assert.assertThat;
1821
import static org.junit.Assert.fail;
1922

2023
/**
@@ -39,8 +42,9 @@ public void testIdClassInSuperclass() throws Exception {
3942
s.flush();
4043
fail( "should have failed because of transient entities have non-nullable, circular dependency." );
4144
}
42-
catch ( HibernateException ex) {
45+
catch (IllegalStateException ex) {
4346
// expected
47+
assertThat( ex.getCause(), instanceOf( TransientPropertyValueException.class ) );
4448
}
4549
tx.rollback();
4650
s.close();

0 commit comments

Comments
 (0)