You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by jd...@apache.org on 2025/07/12 03:28:55 UTC

(grails-core) branch deprecationRemovals updated: removal: remove old, deprecated `DataTest#dataSource`, use `datasource` instead

This is an automated email from the ASF dual-hosted git repository.

jdaugherty pushed a commit to branch deprecationRemovals
in repository https://gitbox.apache.org/repos/asf/grails-core.git


The following commit(s) were added to refs/heads/deprecationRemovals by this push:
     new 8096cf572e removal: remove old, deprecated `DataTest#dataSource`, use `datasource` instead
8096cf572e is described below

commit 8096cf572ed108d8e584d214f6abb155ee6a2ea1
Author: James Daugherty <jd...@jdresources.net>
AuthorDate: Fri Jul 11 23:28:41 2025 -0400

    removal: remove old, deprecated `DataTest#dataSource`, use `datasource` instead
---
 grails-doc/src/en/guide/upgrading/upgrading60x.adoc           |  5 +++--
 .../grails/plugin/formfields/DerivedPropertySpec.groovy       |  2 +-
 .../src/main/groovy/grails/testing/gorm/DataTest.groovy       | 11 -----------
 3 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/grails-doc/src/en/guide/upgrading/upgrading60x.adoc b/grails-doc/src/en/guide/upgrading/upgrading60x.adoc
index 6da8e3f6df..aced239a80 100644
--- a/grails-doc/src/en/guide/upgrading/upgrading60x.adoc
+++ b/grails-doc/src/en/guide/upgrading/upgrading60x.adoc
@@ -243,8 +243,9 @@ jakartaeeMigration {
 4. `GrailsClassUtils#getPropertyForGetter(String)` - use `getPropertyForGetter(String, Class)` instead.
 5. `AbstractGrailsClass#getPropertyDescriptors` - use `getMetaProperties` instead.
 6. `org.grails.core.metaclass.BaseApiProvider` - use traits instead.
-7. Several static variables on `ClosureEventTriggeringInterceptor` are removed - use the variables on `AbstractPersistentEvent` instead.
-8. `org.grails.plugins.databinding.DataBindingGrailsPlugin` was removed - use `DataBindingConfiguration` instead.
+7. Several static variables on `ClosureEventTriggeringInterceptor` - use the variables on `AbstractPersistentEvent` instead.
+8. `org.grails.plugins.databinding.DataBindingGrailsPlugin`- use `DataBindingConfiguration` instead.
+9. `grails.testing.gorm.DataTest#dataSource` - use `DataTest#datasource` instead.
 
 - The following deprecated classes were removed, please use the suggested replacement:
 
diff --git a/grails-fields/src/test/groovy/grails/plugin/formfields/DerivedPropertySpec.groovy b/grails-fields/src/test/groovy/grails/plugin/formfields/DerivedPropertySpec.groovy
index 334e0d5b54..83f5acc2e9 100644
--- a/grails-fields/src/test/groovy/grails/plugin/formfields/DerivedPropertySpec.groovy
+++ b/grails-fields/src/test/groovy/grails/plugin/formfields/DerivedPropertySpec.groovy
@@ -40,7 +40,7 @@ class DerivedPropertySpec extends AbstractFormFieldsTagLibSpec  implements TagLi
         tagLib.formFieldsTemplateService = mockFormFieldsTemplateService
 
         // @Mock isn't aware of formulae so we need to set this manually
-        MappingContext mappingContext = dataStore.mappingContext
+        MappingContext mappingContext = datastore.mappingContext
         mappingContext.getPersistentEntity(Product.name).getPropertyByName('tax').mapping.mappedForm.derived = true
 
         productInstance = new Product(name: 'MacBook Pro', netPrice: 1499, taxRate: 0.2).save(failOnError: true)
diff --git a/grails-testing-support-datamapping/src/main/groovy/grails/testing/gorm/DataTest.groovy b/grails-testing-support-datamapping/src/main/groovy/grails/testing/gorm/DataTest.groovy
index 83142424a2..fd7a69f703 100644
--- a/grails-testing-support-datamapping/src/main/groovy/grails/testing/gorm/DataTest.groovy
+++ b/grails-testing-support-datamapping/src/main/groovy/grails/testing/gorm/DataTest.groovy
@@ -104,17 +104,6 @@ trait DataTest extends GrailsUnitTest {
         }
     }
 
-    /**
-     * @deprecated as of v2.1.0 because of of consistency in the method name with
-     * other GORM projects. It is recommended to use {@link #getDatastore()} instead.
-     *
-     * @return The{@link AbstractDatastore}
-     */
-    @Deprecated
-    AbstractDatastore getDataStore() {
-        getDatastore()
-    }
-
     AbstractDatastore getDatastore() {
         applicationContext.getBean(AbstractDatastore)
     }