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 2026/04/09 14:42:58 UTC
(grails-core) branch spring-boot-4 updated: Adopt jackson 3
This is an automated email from the ASF dual-hosted git repository.
jdaugherty pushed a commit to branch spring-boot-4
in repository https://gitbox.apache.org/repos/asf/grails-core.git
The following commit(s) were added to refs/heads/spring-boot-4 by this push:
new 5e5a2d6d11 Adopt jackson 3
5e5a2d6d11 is described below
commit 5e5a2d6d11fc5fe8000e2af6cf77b9fbe84e4098
Author: James Daugherty <jd...@jdresources.net>
AuthorDate: Thu Apr 9 10:42:45 2026 -0400
Adopt jackson 3
---
grails-core/build.gradle | 2 +-
.../src/en/guide/upgrading/upgrading80x.adoc | 65 ++++++++++++++++++++--
grails-rest-transforms/build.gradle | 2 +-
.../web/rest/render/hal/HalJsonRendererSpec.groovy | 6 +-
grails-test-examples/issue-15228/build.gradle | 2 +-
.../views-functional-tests/build.gradle | 2 +-
grails-test-suite-uber/build.gradle | 2 +-
.../hal/HalDomainClassJsonRendererSpec.groovy | 4 +-
grails-test-suite-web/build.gradle | 2 +-
.../json/DomainClassCollectionRenderingSpec.groovy | 6 +-
grails-views-gson/build.gradle | 2 +-
.../json/view/EmbeddedAssociationsSpec.groovy | 4 +-
.../plugin/json/view/EnumRenderingSpec.groovy | 6 +-
.../grails/plugin/json/view/ExpandSpec.groovy | 4 +-
.../grails/plugin/json/view/HalEmbeddedSpec.groovy | 4 +-
.../plugin/json/view/IterableRenderSpec.groovy | 6 +-
.../plugin/json/view/JsonViewHelperSpec.groovy | 4 +-
.../grails/plugin/json/view/MapRenderSpec.groovy | 4 +-
.../plugin/json/view/NullRenderingSpec.groovy | 4 +-
.../grails/plugin/json/view/api/JsonApiSpec.groovy | 4 +-
20 files changed, 95 insertions(+), 40 deletions(-)
diff --git a/grails-core/build.gradle b/grails-core/build.gradle
index 0734b49891..5a1bc1a1cc 100644
--- a/grails-core/build.gradle
+++ b/grails-core/build.gradle
@@ -66,7 +66,7 @@ dependencies {
testImplementation 'org.hamcrest:hamcrest'
testRuntimeOnly 'com.h2database:h2'
- testRuntimeOnly 'com.fasterxml.jackson.core:jackson-databind'
+ testRuntimeOnly 'tools.jackson.core:jackson-databind'
testImplementation 'org.apache.groovy:groovy-test-junit5'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
diff --git a/grails-doc/src/en/guide/upgrading/upgrading80x.adoc b/grails-doc/src/en/guide/upgrading/upgrading80x.adoc
index 65b16b7a19..f36c009ba6 100644
--- a/grails-doc/src/en/guide/upgrading/upgrading80x.adoc
+++ b/grails-doc/src/en/guide/upgrading/upgrading80x.adoc
@@ -244,7 +244,62 @@ grails:
If you need to restore the legacy behavior temporarily, the deprecated marshallers remain available but will be removed in a future release.
-==== 9. Theme Support Removed
+==== 9. Jackson 3 is the New Default
+
+Spring Boot 4 ships Jackson 3 (`tools.jackson.*`) and auto-configures a `JsonMapper` bean instead of the Jackson 2 `ObjectMapper`.
+Grails 8 follows that change: any Grails module that previously declared `com.fasterxml.jackson.core:jackson-databind` (Jackson 2) now declares `tools.jackson.core:jackson-databind` (Jackson 3, currently 3.1.0 via the Spring Boot 4 BOM).
+
+**What stayed the same:**
+
+* **Jackson annotations.** All `@JsonProperty`, `@JsonCreator`, `@JsonIgnore`, `@JsonInclude`, `@JsonIgnoreProperties`, etc. remain at `com.fasterxml.jackson.annotation.*`.
+The Spring Boot 4 BOM explicitly permits the `jackson-annotations` 2.x artifact alongside the Jackson 3 BOM, so existing annotated DTOs and domain classes do **not** need to change.
+* The `readTree(String)`, `writeValueAsString(...)`, and `readValue(...)` method names on the mapper are unchanged.
+
+**What changed (and what you need to do if your code touches Jackson directly):**
+
+[cols="1,2,2",options="header"]
+|===
+| Concern | Jackson 2 | Jackson 3
+
+| Package
+| `com.fasterxml.jackson.databind.*`
+| `tools.jackson.databind.*`
+
+| Default mapper type
+| `ObjectMapper`
+| `tools.jackson.databind.json.JsonMapper`
+
+| Construction
+| `new ObjectMapper()`
+| `JsonMapper.builder().build()` (immutable; configuration locked after `build()`)
+
+| Exceptions
+| `JsonProcessingException` / `IOException` (checked)
+| `JacksonException` extends `RuntimeException` (unchecked)
+
+| Default date format
+| Numeric timestamps
+| ISO-8601 strings
+|===
+
+**If you inject the auto-configured mapper:**
+Spring Boot 4 provides a `tools.jackson.databind.json.JsonMapper` bean instead of `com.fasterxml.jackson.databind.ObjectMapper`.
+Update injection points to expect `JsonMapper`.
+
+**If you must stay on Jackson 2 temporarily:**
+Spring Boot 4 still manages the Jackson 2 BOM (currently 2.21.2) and provides an opt-in toggle so the auto-configured mapper preserves Jackson 2 defaults:
+
+[source,yaml]
+.application.yml
+----
+spring:
+ jackson:
+ use-jackson2-defaults: true
+----
+
+This is intended as a migration aid only; new code should target Jackson 3.
+
+==== 10. Theme Support Removed
Spring Framework 7 removed the theme infrastructure entirely.
The following theme-specific classes and interfaces no longer exist:
@@ -261,7 +316,7 @@ This was deprecated in Spring Framework 6.0 and fully removed in 7.0.
GSP layouts and views that relied on theme resolution will need to use alternative approaches such as configuration properties or session-based preferences managed in application code.
-==== 10. Embedded Server Module Relocations
+==== 11. Embedded Server Module Relocations
Spring Boot 4 reorganized embedded server classes into separate modules.
If your application or tests reference these classes directly, update the imports:
@@ -290,13 +345,13 @@ If your application or tests reference these classes directly, update the import
Applications using embedded Tomcat, Jetty, or Undertow should check for any direct class references and update accordingly.
The `spring-boot-tomcat` module must now be an explicit dependency if you reference Tomcat classes directly.
-==== 11. HandlerAdapter.getLastModified Removed
+==== 12. HandlerAdapter.getLastModified Removed
Spring Framework 7 removed the deprecated `getLastModified` method from the `HandlerAdapter` interface.
If your application implements `HandlerAdapter` directly and overrides this method, remove the override.
The framework no longer calls this method for Last-Modified header management.
-==== 12. Spring Security Filter Ordering
+==== 13. Spring Security Filter Ordering
Spring Boot 4 removed the `SecurityProperties.DEFAULT_FILTER_ORDER` constant.
Spring Security is moving toward the fluent `HttpSecurity` configuration API for filter chain management, rather than explicit filter ordering via constants.
@@ -304,7 +359,7 @@ Spring Security is moving toward the fluent `HttpSecurity` configuration API for
If your application references `DEFAULT_FILTER_ORDER` for custom filter positioning, replace it with the concrete value `-100` (computed as `OrderedFilter.REQUEST_WRAPPER_FILTER_MAX_ORDER - 100`).
Longer term, consider migrating to the fluent `HttpSecurity` API for filter chain configuration.
-==== 13. Known Plugin Incompatibilities
+==== 14. Known Plugin Incompatibilities
Some third-party plugins have not yet been updated for Spring Boot 4 / Spring Framework 7 compatibility.
The following are known blockers at this time:
diff --git a/grails-rest-transforms/build.gradle b/grails-rest-transforms/build.gradle
index e80d02dcba..3cbfdba682 100644
--- a/grails-rest-transforms/build.gradle
+++ b/grails-rest-transforms/build.gradle
@@ -53,7 +53,7 @@ dependencies {
testImplementation project(':grails-url-mappings')
testImplementation project(':grails-test-suite-base')
- testImplementation 'com.fasterxml.jackson.core:jackson-databind'
+ testImplementation 'tools.jackson.core:jackson-databind'
compileOnly 'jakarta.servlet:jakarta.servlet-api'
compileOnly 'org.springframework:spring-test', {
diff --git a/grails-rest-transforms/src/test/groovy/org/grails/plugins/web/rest/render/hal/HalJsonRendererSpec.groovy b/grails-rest-transforms/src/test/groovy/org/grails/plugins/web/rest/render/hal/HalJsonRendererSpec.groovy
index d4a7901a64..cf22043fdd 100644
--- a/grails-rest-transforms/src/test/groovy/org/grails/plugins/web/rest/render/hal/HalJsonRendererSpec.groovy
+++ b/grails-rest-transforms/src/test/groovy/org/grails/plugins/web/rest/render/hal/HalJsonRendererSpec.groovy
@@ -18,7 +18,7 @@
*/
package org.grails.plugins.web.rest.render.hal
-import com.fasterxml.jackson.databind.ObjectMapper
+import tools.jackson.databind.json.JsonMapper
import grails.config.Config
import grails.core.DefaultGrailsApplication
import grails.core.GrailsApplication
@@ -76,11 +76,11 @@ import jakarta.xml.bind.DatatypeConverter
class HalJsonRendererSpec extends Specification {
@Shared
- ObjectMapper objectMapper
+ JsonMapper objectMapper
void setupSpec() {
- objectMapper = new ObjectMapper()
+ objectMapper = JsonMapper.builder().build()
// ensure clean state
ShutdownOperations.runOperations()
diff --git a/grails-test-examples/issue-15228/build.gradle b/grails-test-examples/issue-15228/build.gradle
index 089c1b774d..dc4edcb850 100644
--- a/grails-test-examples/issue-15228/build.gradle
+++ b/grails-test-examples/issue-15228/build.gradle
@@ -42,7 +42,7 @@ dependencies {
testImplementation 'org.apache.grails:grails-testing-support-views-gson'
testImplementation 'org.apache.grails.testing:grails-testing-support-core'
- integrationTestImplementation 'com.fasterxml.jackson.core:jackson-databind'
+ integrationTestImplementation 'tools.jackson.core:jackson-databind'
integrationTestImplementation 'org.apache.grails:grails-testing-support-http-client'
}
diff --git a/grails-test-examples/views-functional-tests/build.gradle b/grails-test-examples/views-functional-tests/build.gradle
index d335e0a01d..43e92420d0 100644
--- a/grails-test-examples/views-functional-tests/build.gradle
+++ b/grails-test-examples/views-functional-tests/build.gradle
@@ -72,7 +72,7 @@ dependencies {
testImplementation 'org.apache.grails:grails-testing-support-views-gson'
testImplementation 'org.apache.grails.testing:grails-testing-support-core'
- integrationTestImplementation 'com.fasterxml.jackson.core:jackson-databind'
+ integrationTestImplementation 'tools.jackson.core:jackson-databind'
integrationTestImplementation 'org.apache.grails:grails-testing-support-http-client'
}
diff --git a/grails-test-suite-uber/build.gradle b/grails-test-suite-uber/build.gradle
index 019ff129a0..4748427967 100644
--- a/grails-test-suite-uber/build.gradle
+++ b/grails-test-suite-uber/build.gradle
@@ -47,7 +47,7 @@ dependencies {
testImplementation 'org.apache.groovy:groovy'
testImplementation 'org.apache.groovy:groovy-test-junit5'
testImplementation 'org.junit.jupiter:junit-jupiter-api'
- testImplementation 'com.fasterxml.jackson.core:jackson-databind'
+ testImplementation 'tools.jackson.core:jackson-databind'
testImplementation project(':grails-data-hibernate5-core')
testImplementation project(':grails-gsp')
if(System.getenv('SITEMESH3_TESTING_ENABLED') == 'true') {
diff --git a/grails-test-suite-uber/src/test/groovy/org/grails/plugins/web/rest/render/hal/HalDomainClassJsonRendererSpec.groovy b/grails-test-suite-uber/src/test/groovy/org/grails/plugins/web/rest/render/hal/HalDomainClassJsonRendererSpec.groovy
index 4169ef8eea..d95a5f2345 100644
--- a/grails-test-suite-uber/src/test/groovy/org/grails/plugins/web/rest/render/hal/HalDomainClassJsonRendererSpec.groovy
+++ b/grails-test-suite-uber/src/test/groovy/org/grails/plugins/web/rest/render/hal/HalDomainClassJsonRendererSpec.groovy
@@ -18,7 +18,7 @@
*/
package org.grails.plugins.web.rest.render.hal
-import com.fasterxml.jackson.databind.ObjectMapper
+import tools.jackson.databind.json.JsonMapper
import grails.rest.render.Renderer
import grails.rest.render.hal.HalJsonRenderer
import grails.util.GrailsWebUtil
@@ -33,7 +33,7 @@ import spock.lang.Shared
class HalDomainClassJsonRendererSpec extends BaseDomainClassRendererSpec {
@Shared
- ObjectMapper objectMapper = new ObjectMapper()
+ JsonMapper objectMapper = JsonMapper.builder().build()
void 'Test that the HAL renderer renders domain objects with appropriate links'() {
given: 'A HAL renderer'
diff --git a/grails-test-suite-web/build.gradle b/grails-test-suite-web/build.gradle
index 8f2d856bfa..3d7755cf18 100644
--- a/grails-test-suite-web/build.gradle
+++ b/grails-test-suite-web/build.gradle
@@ -40,7 +40,7 @@ dependencies {
testImplementation project(':grails-interceptors')
testImplementation project(':grails-rest-transforms')
testImplementation 'org.apache.groovy:groovy'
- testImplementation 'com.fasterxml.jackson.core:jackson-databind'
+ testImplementation 'tools.jackson.core:jackson-databind'
testImplementation project(':grails-testing-support-web'), {
// This is a local project dependency
exclude group: 'org.apache.grails', module: 'grails-testing-support-core'
diff --git a/grails-test-suite-web/src/test/groovy/org/grails/web/json/DomainClassCollectionRenderingSpec.groovy b/grails-test-suite-web/src/test/groovy/org/grails/web/json/DomainClassCollectionRenderingSpec.groovy
index 8dd7ad6e32..845ec7dae0 100644
--- a/grails-test-suite-web/src/test/groovy/org/grails/web/json/DomainClassCollectionRenderingSpec.groovy
+++ b/grails-test-suite-web/src/test/groovy/org/grails/web/json/DomainClassCollectionRenderingSpec.groovy
@@ -18,7 +18,7 @@
*/
package org.grails.web.json
-import com.fasterxml.jackson.databind.ObjectMapper
+import tools.jackson.databind.json.JsonMapper
import grails.persistence.Entity
import grails.rest.render.json.JsonRenderer
import grails.testing.gorm.DataTest
@@ -38,10 +38,10 @@ class DomainClassCollectionRenderingSpec extends Specification implements Grails
}
@Shared
- ObjectMapper objectMapper
+ JsonMapper objectMapper
void setupSpec() {
- objectMapper = new ObjectMapper()
+ objectMapper = JsonMapper.builder().build()
}
void setup() {
diff --git a/grails-views-gson/build.gradle b/grails-views-gson/build.gradle
index c0781804d2..3848ebd373 100644
--- a/grails-views-gson/build.gradle
+++ b/grails-views-gson/build.gradle
@@ -53,7 +53,7 @@ dependencies {
testImplementation project(':grails-testing-support-datamapping')
testImplementation project(':grails-data-hibernate5-core')
testImplementation 'org.spockframework:spock-core'
- testImplementation 'com.fasterxml.jackson.core:jackson-databind'
+ testImplementation 'tools.jackson.core:jackson-databind'
testImplementation 'jakarta.servlet:jakarta.servlet-api'
testRuntimeOnly 'org.slf4j:slf4j-nop' // Get rid of warning about missing slf4j implementation during test task
diff --git a/grails-views-gson/src/test/groovy/grails/plugin/json/view/EmbeddedAssociationsSpec.groovy b/grails-views-gson/src/test/groovy/grails/plugin/json/view/EmbeddedAssociationsSpec.groovy
index de6085607c..3ef0500c07 100644
--- a/grails-views-gson/src/test/groovy/grails/plugin/json/view/EmbeddedAssociationsSpec.groovy
+++ b/grails-views-gson/src/test/groovy/grails/plugin/json/view/EmbeddedAssociationsSpec.groovy
@@ -18,7 +18,7 @@
*/
package grails.plugin.json.view
-import com.fasterxml.jackson.databind.ObjectMapper
+import tools.jackson.databind.json.JsonMapper
import grails.gorm.annotation.Entity
import grails.plugin.json.view.test.JsonViewTest
import org.grails.testing.GrailsUnitTest
@@ -29,7 +29,7 @@ import spock.lang.Specification
class EmbeddedAssociationsSpec extends Specification implements JsonViewTest, GrailsUnitTest {
@Shared
- ObjectMapper objectMapper = new ObjectMapper()
+ JsonMapper objectMapper = JsonMapper.builder().build()
void 'Test render domain object with embedded associations'() {
given: 'A domain class with embedded associations'
diff --git a/grails-views-gson/src/test/groovy/grails/plugin/json/view/EnumRenderingSpec.groovy b/grails-views-gson/src/test/groovy/grails/plugin/json/view/EnumRenderingSpec.groovy
index 14d5914b40..b0afdfaff8 100644
--- a/grails-views-gson/src/test/groovy/grails/plugin/json/view/EnumRenderingSpec.groovy
+++ b/grails-views-gson/src/test/groovy/grails/plugin/json/view/EnumRenderingSpec.groovy
@@ -18,7 +18,7 @@
*/
package grails.plugin.json.view
-import com.fasterxml.jackson.databind.ObjectMapper
+import tools.jackson.databind.json.JsonMapper
import grails.persistence.Entity
import grails.views.json.test.JsonViewUnitTest
import spock.lang.Shared
@@ -27,10 +27,10 @@ import spock.lang.Specification
class EnumRenderingSpec extends Specification implements JsonViewUnitTest {
@Shared
- ObjectMapper objectMapper
+ JsonMapper objectMapper
void setupSpec() {
- objectMapper = new ObjectMapper()
+ objectMapper = JsonMapper.builder().build()
}
void 'Test the render method when a domain instance defines an enum'() {
diff --git a/grails-views-gson/src/test/groovy/grails/plugin/json/view/ExpandSpec.groovy b/grails-views-gson/src/test/groovy/grails/plugin/json/view/ExpandSpec.groovy
index 12fc931f8a..7dfe5befdf 100644
--- a/grails-views-gson/src/test/groovy/grails/plugin/json/view/ExpandSpec.groovy
+++ b/grails-views-gson/src/test/groovy/grails/plugin/json/view/ExpandSpec.groovy
@@ -18,7 +18,7 @@
*/
package grails.plugin.json.view
-import com.fasterxml.jackson.databind.ObjectMapper
+import tools.jackson.databind.json.JsonMapper
import grails.plugin.json.view.test.JsonRenderResult
import grails.plugin.json.view.test.JsonViewTest
import org.grails.datastore.mapping.core.Session
@@ -29,7 +29,7 @@ import spock.lang.Specification
class ExpandSpec extends Specification implements JsonViewTest, GrailsUnitTest {
@Shared
- ObjectMapper objectMapper = new ObjectMapper()
+ JsonMapper objectMapper = JsonMapper.builder().build()
void setup() {
mappingContext.addPersistentEntities(Team, Player)
diff --git a/grails-views-gson/src/test/groovy/grails/plugin/json/view/HalEmbeddedSpec.groovy b/grails-views-gson/src/test/groovy/grails/plugin/json/view/HalEmbeddedSpec.groovy
index fc8c9e3fb0..f108e39452 100644
--- a/grails-views-gson/src/test/groovy/grails/plugin/json/view/HalEmbeddedSpec.groovy
+++ b/grails-views-gson/src/test/groovy/grails/plugin/json/view/HalEmbeddedSpec.groovy
@@ -18,7 +18,7 @@
*/
package grails.plugin.json.view
-import com.fasterxml.jackson.databind.ObjectMapper
+import tools.jackson.databind.json.JsonMapper
import grails.gorm.annotation.Entity
import grails.plugin.json.view.test.JsonViewTest
import spock.lang.Shared
@@ -30,7 +30,7 @@ import spock.lang.Specification
class HalEmbeddedSpec extends Specification implements JsonViewTest {
@Shared
- ObjectMapper objectMapper = new ObjectMapper()
+ JsonMapper objectMapper = JsonMapper.builder().build()
void setup() {
mappingContext.addPersistentEntities(Team, Player)
diff --git a/grails-views-gson/src/test/groovy/grails/plugin/json/view/IterableRenderSpec.groovy b/grails-views-gson/src/test/groovy/grails/plugin/json/view/IterableRenderSpec.groovy
index 7e2015a0fc..f74bd9e37a 100644
--- a/grails-views-gson/src/test/groovy/grails/plugin/json/view/IterableRenderSpec.groovy
+++ b/grails-views-gson/src/test/groovy/grails/plugin/json/view/IterableRenderSpec.groovy
@@ -18,7 +18,7 @@
*/
package grails.plugin.json.view
-import com.fasterxml.jackson.databind.ObjectMapper
+import tools.jackson.databind.json.JsonMapper
import grails.views.ViewException
import grails.views.json.test.JsonViewUnitTest
import spock.lang.Shared
@@ -27,10 +27,10 @@ import spock.lang.Specification
class IterableRenderSpec extends Specification implements JsonViewUnitTest {
@Shared
- ObjectMapper objectMapper
+ JsonMapper objectMapper
def setupSpec() {
- objectMapper = new ObjectMapper()
+ objectMapper = JsonMapper.builder().build()
}
void 'Test render a collection type'() {
diff --git a/grails-views-gson/src/test/groovy/grails/plugin/json/view/JsonViewHelperSpec.groovy b/grails-views-gson/src/test/groovy/grails/plugin/json/view/JsonViewHelperSpec.groovy
index 4496d94d14..8b16be336e 100644
--- a/grails-views-gson/src/test/groovy/grails/plugin/json/view/JsonViewHelperSpec.groovy
+++ b/grails-views-gson/src/test/groovy/grails/plugin/json/view/JsonViewHelperSpec.groovy
@@ -18,7 +18,7 @@
*/
package grails.plugin.json.view
-import com.fasterxml.jackson.databind.ObjectMapper
+import tools.jackson.databind.json.JsonMapper
import grails.core.support.proxy.ProxyHandler
import grails.persistence.Entity
import grails.plugin.json.view.api.JsonView
@@ -37,7 +37,7 @@ import spock.lang.Specification
class JsonViewHelperSpec extends Specification implements JsonViewTest, GrailsUnitTest {
@Shared
- ObjectMapper objectMapper = new ObjectMapper()
+ JsonMapper objectMapper = JsonMapper.builder().build()
void 'test render toMany association'() {
given: 'A view helper'
diff --git a/grails-views-gson/src/test/groovy/grails/plugin/json/view/MapRenderSpec.groovy b/grails-views-gson/src/test/groovy/grails/plugin/json/view/MapRenderSpec.groovy
index eb4972aead..6527a9fb62 100644
--- a/grails-views-gson/src/test/groovy/grails/plugin/json/view/MapRenderSpec.groovy
+++ b/grails-views-gson/src/test/groovy/grails/plugin/json/view/MapRenderSpec.groovy
@@ -18,7 +18,7 @@
*/
package grails.plugin.json.view
-import com.fasterxml.jackson.databind.ObjectMapper
+import tools.jackson.databind.json.JsonMapper
import grails.plugin.json.view.test.JsonViewTest
import grails.testing.gorm.DataTest
import grails.validation.Validateable
@@ -31,7 +31,7 @@ import spock.lang.Specification
class MapRenderSpec extends Specification implements JsonViewTest, DataTest {
@Shared
- ObjectMapper objectMapper = new ObjectMapper()
+ JsonMapper objectMapper = JsonMapper.builder().build()
@Override
Class[] getDomainClassesToMock() {
diff --git a/grails-views-gson/src/test/groovy/grails/plugin/json/view/NullRenderingSpec.groovy b/grails-views-gson/src/test/groovy/grails/plugin/json/view/NullRenderingSpec.groovy
index 76af0b3898..990121a391 100644
--- a/grails-views-gson/src/test/groovy/grails/plugin/json/view/NullRenderingSpec.groovy
+++ b/grails-views-gson/src/test/groovy/grails/plugin/json/view/NullRenderingSpec.groovy
@@ -18,7 +18,7 @@
*/
package grails.plugin.json.view
-import com.fasterxml.jackson.databind.ObjectMapper
+import tools.jackson.databind.json.JsonMapper
import grails.plugin.json.view.test.JsonViewTest
import spock.lang.Shared
import spock.lang.Specification
@@ -26,7 +26,7 @@ import spock.lang.Specification
class NullRenderingSpec extends Specification implements JsonViewTest {
@Shared
- ObjectMapper objectMapper = new ObjectMapper()
+ JsonMapper objectMapper = JsonMapper.builder().build()
void 'test rendering nulls with a domain'() {
given:
diff --git a/grails-views-gson/src/test/groovy/grails/plugin/json/view/api/JsonApiSpec.groovy b/grails-views-gson/src/test/groovy/grails/plugin/json/view/api/JsonApiSpec.groovy
index cbbcc90d9c..afbc012a01 100644
--- a/grails-views-gson/src/test/groovy/grails/plugin/json/view/api/JsonApiSpec.groovy
+++ b/grails-views-gson/src/test/groovy/grails/plugin/json/view/api/JsonApiSpec.groovy
@@ -18,7 +18,7 @@
*/
package grails.plugin.json.view.api
-import com.fasterxml.jackson.databind.ObjectMapper
+import tools.jackson.databind.json.JsonMapper
import grails.persistence.Entity
import grails.plugin.json.view.test.JsonRenderResult
import grails.plugin.json.view.test.JsonViewTest
@@ -34,7 +34,7 @@ class JsonApiSpec extends Specification implements JsonViewTest, GrailsUnitTest
private static final Class<?> STATIC_FIELD_HELPER = Class.forName('grails.validation.Validateable$Trait$StaticFieldHelper')
@Shared
- ObjectMapper objectMapper = new ObjectMapper()
+ JsonMapper objectMapper = JsonMapper.builder().build()
void setup() {
ConstraintEvalUtils.clearDefaultConstraints()