Skip to content

Commit

Permalink
issue due to change of default for FAIL_ON_UNKNOWN_PROPERTIES
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning committed Jul 25, 2024
1 parent 1bcccd6 commit 19d181b
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ class IgnorableFieldDeserializerTest extends DeserializerTest {

lazy val module: JacksonModule = DefaultScalaModule

"An ObjectMapper with the DefaultScalaModule" should "fail if field is not expected" in {
val mapper = newMapper
"An ObjectMapper with the DefaultScalaModule" should "fail if field is not expected (DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES enabled)" in {
val mapper = newBuilder
.enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
.build()
intercept[UnrecognizedPropertyException] {
mapper.readValue(genJson(100), classOf[ExtractFields])
}
}

it should "succeed if field is not expected" in {
it should "succeed if field is not expected (DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES disabled)" in {
val mapper = newBuilder
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
.build()
Expand Down

0 comments on commit 19d181b

Please sign in to comment.