From 7d93a3162da2e0e466f418d57df5caf728700dcd Mon Sep 17 00:00:00 2001 From: Scott Murphy Heiberg Date: Wed, 25 Sep 2024 18:35:36 -0700 Subject: [PATCH 1/2] Fix tests --- grails-plugin-databinding/build.gradle | 7 ++++++- .../plugins/databinding/DataBindingConfiguration.java | 11 +++++++++-- grails-test-suite-persistence/build.gradle | 3 +-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/grails-plugin-databinding/build.gradle b/grails-plugin-databinding/build.gradle index dcb2f743ef3..e93f2bb3674 100644 --- a/grails-plugin-databinding/build.gradle +++ b/grails-plugin-databinding/build.gradle @@ -1,5 +1,6 @@ dependencies { api project(':grails-core'), project(':grails-web') + api "org.springframework.boot:spring-boot-autoconfigure:$springBootVersion" testImplementation project(':grails-test-suite-base') testImplementation "org.grails:grails-web-testing-support:$testingSupportVersionForTests", { @@ -11,5 +12,9 @@ exclude module:'async' exclude module:'gsp' } - + testRuntimeOnly "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion" } + +tasks.named('compileTestGroovy').configure { + dependsOn tasks.named('jar') +} \ No newline at end of file diff --git a/grails-plugin-databinding/src/main/groovy/org/grails/plugins/databinding/DataBindingConfiguration.java b/grails-plugin-databinding/src/main/groovy/org/grails/plugins/databinding/DataBindingConfiguration.java index d637ce7ff79..4a744493e56 100644 --- a/grails-plugin-databinding/src/main/groovy/org/grails/plugins/databinding/DataBindingConfiguration.java +++ b/grails-plugin-databinding/src/main/groovy/org/grails/plugins/databinding/DataBindingConfiguration.java @@ -8,14 +8,21 @@ import grails.util.GrailsArrayUtils; import grails.web.databinding.GrailsWebDataBinder; import org.grails.databinding.bindingsource.DataBindingSourceCreator; +import org.grails.databinding.converters.DefaultConvertersConfiguration; import org.grails.web.databinding.bindingsource.*; +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.AutoConfigureOrder; +import org.springframework.boot.autoconfigure.ImportAutoConfiguration; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.ApplicationContext; import org.springframework.context.MessageSource; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.AnnotationAwareOrderComparator; -@Configuration +@AutoConfiguration +@AutoConfigureOrder +@EnableConfigurationProperties(DataBindingConfigurationProperties.class) +@ImportAutoConfiguration(DefaultConvertersConfiguration.class) public class DataBindingConfiguration { private final DataBindingConfigurationProperties configurationProperties; diff --git a/grails-test-suite-persistence/build.gradle b/grails-test-suite-persistence/build.gradle index decba181acf..bb9db556af8 100644 --- a/grails-test-suite-persistence/build.gradle +++ b/grails-test-suite-persistence/build.gradle @@ -52,17 +52,16 @@ dependencies { "org.aspectj:aspectjweaver:$aspectjVersion" testImplementation "org.grails.plugins:async:$asyncVersion", { - exclude module:'grails-plugin-codecs' exclude module:'grails-plugin-controllers' exclude module:'grails-core' exclude module:'grails-plugin-domain-class' } testImplementation "org.grails:grails-gorm-testing-support:$testingSupportVersionForTests", { - exclude module:'grails-plugin-codecs' exclude module:'grails-plugin-domain-class' exclude module:'grails-test' exclude module:'async' } + testRuntimeOnly "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion" } test { From bb1f575b8e721f5199d031f9a3e902d7ed8fc54c Mon Sep 17 00:00:00 2001 From: Scott Murphy Heiberg Date: Wed, 25 Sep 2024 18:44:42 -0700 Subject: [PATCH 2/2] remove codecs exclusion --- grails-plugin-databinding/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/grails-plugin-databinding/build.gradle b/grails-plugin-databinding/build.gradle index e93f2bb3674..22105df391b 100644 --- a/grails-plugin-databinding/build.gradle +++ b/grails-plugin-databinding/build.gradle @@ -4,7 +4,6 @@ testImplementation project(':grails-test-suite-base') testImplementation "org.grails:grails-web-testing-support:$testingSupportVersionForTests", { - exclude module:'grails-plugin-codecs' exclude module:'grails-plugin-rest' exclude module:'grails-plugin-interceptors' exclude module:'grails-test'