Skip to content

Commit

Permalink
fix MergeTest issues with enable(MapperFeature.ALLOW_FINAL_FIELDS_AS_…
Browse files Browse the repository at this point in the history
…MUTATORS)
  • Loading branch information
pjfanning committed Jun 15, 2024
1 parent 0003d60 commit e53bb5c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/test/scala/tools/jackson/module/scala/deser/MergeTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package tools.jackson.module.scala.deser

import com.fasterxml.jackson.annotation.JsonMerge
import tools.jackson.core.`type`.TypeReference
import tools.jackson.databind.{ObjectMapper, ObjectReader}
import tools.jackson.databind.{MapperFeature, ObjectMapper, ObjectReader}
import tools.jackson.module.scala.DefaultScalaModule

import scala.collection.{Map, mutable}
Expand All @@ -17,9 +17,16 @@ class MergeTest extends DeserializerTest {

val module: DefaultScalaModule.type = DefaultScalaModule

def newScalaMapper: ObjectMapper = newMapper
// This test replies on enabling MapperFeature.ALLOW_FINAL_FIELDS_AS_MUTATORS
// which is not enabled by default in the Jackson v2 but not in Jackson v3
def newScalaMapper: ObjectMapper = newBuilder
.enable(MapperFeature.ALLOW_FINAL_FIELDS_AS_MUTATORS)
.build()

def newMergeableScalaMapper: ObjectMapper = newBuilder.defaultMergeable(true).build()
def newMergeableScalaMapper: ObjectMapper = newBuilder
.enable(MapperFeature.ALLOW_FINAL_FIELDS_AS_MUTATORS)
.defaultMergeable(true)
.build()

behavior of "The DefaultScalaModule when reading for updating"

Expand Down

0 comments on commit e53bb5c

Please sign in to comment.