This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch fix/CAMEL-24426-reifier-test
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 0b427b71984a4460fa392aca6d30d4d53d111a87
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Oct 21 07:01:39 2026 +0200

    CAMEL-24426: camel-core - JsonDataFormatReifierTest expects 
allowUnmarshallType for Gson and Jsonb
    
    acc4e469d515 made the reifier pass allowUnmarshallType to Gson and Jsonb, 
but
    JsonDataFormatReifierTest still listed it as a Jackson-only option, so
    testGsonDoesNotIncludeJacksonOnlyOptions failed on the main build. The test 
now
    expects the option for Gson and Jsonb, and still not for Fastjson.
    
    Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
    Signed-off-by: Claus Ibsen <[email protected]>
---
 .../dataformat/JsonDataFormatReifierTest.java      | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git 
a/core/camel-core/src/test/java/org/apache/camel/reifier/dataformat/JsonDataFormatReifierTest.java
 
b/core/camel-core/src/test/java/org/apache/camel/reifier/dataformat/JsonDataFormatReifierTest.java
index a5f05c5d4786..acca3665deab 100644
--- 
a/core/camel-core/src/test/java/org/apache/camel/reifier/dataformat/JsonDataFormatReifierTest.java
+++ 
b/core/camel-core/src/test/java/org/apache/camel/reifier/dataformat/JsonDataFormatReifierTest.java
@@ -40,23 +40,24 @@ public class JsonDataFormatReifierTest {
 
     @Test
     public void testGsonDoesNotIncludeJacksonOnlyOptions() {
-        assertNoJacksonOptions(JsonLibrary.Gson);
+        // Gson supports allowUnmarshallType, so only check the rest
+        assertNoJacksonOptions(JsonLibrary.Gson, 
Set.of("allowUnmarshallType"));
     }
 
     @Test
     public void testFastjsonDoesNotIncludeJacksonOnlyOptions() {
-        assertNoJacksonOptions(JsonLibrary.Fastjson);
+        assertNoJacksonOptions(JsonLibrary.Fastjson, Set.of());
     }
 
     @Test
     public void testJsonbDoesNotIncludeJacksonOnlyOptions() {
         Map<String, Object> properties = getProperties(JsonLibrary.Jsonb);
-        // Jsonb supports objectMapper, so only check the rest
+        // Jsonb supports objectMapper and allowUnmarshallType, so only check 
the rest
         Set<String> jsonbExcluded = Set.of(
                 "useDefaultObjectMapper", "autoDiscoverObjectMapper",
                 "include", "allowJmsType", "collectionType", "useList",
                 "combineUnicodeSurrogates", "moduleClassNames", "moduleRefs",
-                "enableFeatures", "disableFeatures", "allowUnmarshallType",
+                "enableFeatures", "disableFeatures",
                 "schemaResolver", "autoDiscoverSchemaResolver", 
"namingStrategy",
                 "timezone", "maxStringLength");
         for (String option : jsonbExcluded) {
@@ -65,6 +66,8 @@ public class JsonDataFormatReifierTest {
         }
         assertTrue(properties.containsKey("objectMapper"),
                 "Jsonb should include objectMapper");
+        assertTrue(properties.containsKey("allowUnmarshallType"),
+                "Jsonb should include allowUnmarshallType");
     }
 
     @Test
@@ -76,11 +79,16 @@ public class JsonDataFormatReifierTest {
         }
     }
 
-    private void assertNoJacksonOptions(JsonLibrary library) {
+    private void assertNoJacksonOptions(JsonLibrary library, Set<String> 
supported) {
         Map<String, Object> properties = getProperties(library);
         for (String option : JACKSON_ONLY_OPTIONS) {
-            assertFalse(properties.containsKey(option),
-                    library.name() + " should not include Jackson-only option: 
" + option);
+            if (supported.contains(option)) {
+                assertTrue(properties.containsKey(option),
+                        library.name() + " should include option: " + option);
+            } else {
+                assertFalse(properties.containsKey(option),
+                        library.name() + " should not include Jackson-only 
option: " + option);
+            }
         }
     }
 

Reply via email to