From 8498b331755f1180bfa7925049199f610d29094c Mon Sep 17 00:00:00 2001 From: Koen Aers Date: Thu, 29 Jun 2023 22:15:04 +0200 Subject: [PATCH] HBX-2390: Create a JBoss Tools adaptation layer in Hibernate Tools - Add new test case 'org.hibernate.tool.orm.jbt.wrp.EntityPersisterWrapperFactoryTest#testGetIdentifier()' Signed-off-by: Koen Aers --- .../jbt/wrp/EntityPersisterWrapperFactoryTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/jbt/src/test/java/org/hibernate/tool/orm/jbt/wrp/EntityPersisterWrapperFactoryTest.java b/jbt/src/test/java/org/hibernate/tool/orm/jbt/wrp/EntityPersisterWrapperFactoryTest.java index 9e0d660fa3..7fcc25fe8c 100644 --- a/jbt/src/test/java/org/hibernate/tool/orm/jbt/wrp/EntityPersisterWrapperFactoryTest.java +++ b/jbt/src/test/java/org/hibernate/tool/orm/jbt/wrp/EntityPersisterWrapperFactoryTest.java @@ -16,9 +16,11 @@ import java.util.HashSet; import java.util.Set; +import org.hibernate.Session; import org.hibernate.cfg.AvailableSettings; import org.hibernate.cfg.Configuration; import org.hibernate.engine.spi.SessionFactoryImplementor; +import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.persister.entity.EntityPersister; import org.hibernate.tool.orm.jbt.util.MockConnectionProvider; import org.hibernate.tool.orm.jbt.util.MockDialect; @@ -152,6 +154,15 @@ public void testHasIdentifierProperty() { assertTrue(entityPersisterWrapper.hasIdentifierProperty()); } + @Test + public void testGetIdentifier() { + SharedSessionContractImplementor sessionFacade = sessionFactory.openSession(); + Foo foo = new Foo(); + foo.id = "bar"; + Object identifier = entityPersisterWrapper.getIdentifier(foo, sessionFacade); + assertSame("bar", identifier); + } +