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

(cherry picked from commit c3c0cd550f)
This commit is contained in:
Gail Badner 2018-05-24 18:26:26 -07:00
parent cf891dbe92
commit e171ae965c
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 static org.hibernate.testing.transaction.TransactionUtil.doInHibernate;
import static org.junit.Assert.assertNotSame;
/**
* @author Chris Cranford
@ -37,7 +38,10 @@ public class MergeEnhancedDetachedOrphanRemovalTest extends BaseCoreFunctionalTe
doInHibernate( this::sessionFactory, session -> {
entity.setName( "updated" );
session.merge( entity );
Root entityMerged = (Root) session.merge( entity );
assertNotSame( entity, entityMerged );
assertNotSame( entity, entityMerged );
assertNotSame( entity.getLeaves(), entityMerged.getLeaves() );
} );
}
}