You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by bo...@apache.org on 2025/11/22 20:44:44 UTC
(grails-core) 06/07: Fix(grails-data-hibernate6): Resolve ByteBuddyProxySpec failures. Updated proxy handling and ID retrieval.
This is an automated email from the ASF dual-hosted git repository.
borinquenkid pushed a commit to branch 7.1.x-hibernate6
in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit dbf46748ac783ca1d86e1b46939ba4e6f18b1bf6
Author: Walter Duque de Estrada <wb...@mac.com>
AuthorDate: Mon Nov 10 19:50:54 2025 -0600
Fix(grails-data-hibernate6): Resolve ByteBuddyProxySpec failures. Updated proxy handling and ID retrieval.
---
.../groovy/grails/gorm/specs/proxy/ByteBuddyProxySpec.groovy | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/grails-data-hibernate6/core/src/test/groovy/grails/gorm/specs/proxy/ByteBuddyProxySpec.groovy b/grails-data-hibernate6/core/src/test/groovy/grails/gorm/specs/proxy/ByteBuddyProxySpec.groovy
index e0a80451e7..68af0d5433 100644
--- a/grails-data-hibernate6/core/src/test/groovy/grails/gorm/specs/proxy/ByteBuddyProxySpec.groovy
+++ b/grails-data-hibernate6/core/src/test/groovy/grails/gorm/specs/proxy/ByteBuddyProxySpec.groovy
@@ -25,14 +25,13 @@ class ByteBuddyProxySpec extends HibernateGormDatastoreSpec {
session.clear()
when:
- team = ByteBuddyTeam.load(team.id)
+ def hibernateSession = manager.hibernateDatastore.sessionFactory.currentSession
+ team = hibernateSession.getReference(ByteBuddyTeam.class, team.id)
def proxyHandler = manager.hibernateDatastore.mappingContext.proxyHandler
then:
"Dynamic Groovy access does not initialize the proxy"
- !proxyHandler.isInitialized(team)
- team.id != null
- !proxyHandler.isInitialized(team)
+ assert_id_without_init(proxyHandler, team)
}
@@ -60,7 +59,7 @@ class ByteBuddyProxySpec extends HibernateGormDatastoreSpec {
}
private void assert_id_without_init(ProxyHandler handler, Object proxy) {
- assert handler.getIdentifier(proxy) != null
+ assert manager.sessionFactory.persistenceUnitUtil.getIdentifier(proxy) != null
assert !handler.isInitialized(proxy)
}