jamesfredley commented on code in PR #15435:
URL: https://github.com/apache/grails-core/pull/15435#discussion_r2847131560


##########
grails-datamapping-core/src/test/groovy/org/grails/datastore/gorm/GormEnhancerAllQualifiersSpec.groovy:
##########
@@ -102,6 +102,38 @@ class GormEnhancerAllQualifiersSpec extends Specification {
         qualifiers == ['secondary']
     }
 
+    void "registerEntity adds static api under default and secondary for 
non-default datasource"() {
+        given: "a non-MultiTenant entity with datasource 'secondary'"
+        def enhancer = createEnhancer()
+        def entity = mockEntity(NonMultiTenantSecondaryEntity, ['secondary'])
+        def staticApis = GormEnhancer.@STATIC_APIS
+        staticApis.get(ConnectionSource.DEFAULT).remove(entity.name)

Review Comment:
   Removed the .remove() calls - they were mutating the shared @STATIC_APIS map 
which would be a problem with parallel forks. The tests now just call 
registerEntity() and assert the key exists. Since registerEntity overwrites any 
existing entry, the assertion still validates the behavior without destructive 
side effects.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to