From 19d181bc838ef6a7b537122cce7d80ae6d731533 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Thu, 25 Jul 2024 17:28:42 +0100 Subject: [PATCH] issue due to change of default for FAIL_ON_UNKNOWN_PROPERTIES --- .../scala/deser/IgnorableFieldDeserializerTest.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/test/scala/tools/jackson/module/scala/deser/IgnorableFieldDeserializerTest.scala b/src/test/scala/tools/jackson/module/scala/deser/IgnorableFieldDeserializerTest.scala index 6559ed81..88b9fa25 100644 --- a/src/test/scala/tools/jackson/module/scala/deser/IgnorableFieldDeserializerTest.scala +++ b/src/test/scala/tools/jackson/module/scala/deser/IgnorableFieldDeserializerTest.scala @@ -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()