HHH-12592 : add assertions to ensure that the detached and merged collection are not the same, which currently fails

This commit is contained in:
Gail Badner 2018-05-24 18:26:26 -07:00 committed by Sanne Grinovero
parent 80bf92e32a
commit c3c0cd550f
1 changed files with 5 additions and 1 deletions

View File

@ -14,6 +14,7 @@ import org.hibernate.testing.bytecode.enhancement.BytecodeEnhancerRunner;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate; import static org.hibernate.testing.transaction.TransactionUtil.doInHibernate;
import static org.junit.Assert.assertNotSame;
/** /**
* @author Chris Cranford * @author Chris Cranford
@ -37,7 +38,10 @@ public class MergeEnhancedDetachedOrphanRemovalTest extends BaseCoreFunctionalTe
doInHibernate( this::sessionFactory, session -> { doInHibernate( this::sessionFactory, session -> {
entity.setName( "updated" ); entity.setName( "updated" );
session.merge( entity ); Root entityMerged = (Root) session.merge( entity );
assertNotSame( entity, entityMerged );
assertNotSame( entity, entityMerged );
assertNotSame( entity.getLeaves(), entityMerged.getLeaves() );
} ); } );
} }
} }