This is an automated email from the ASF dual-hosted git repository. JiriOndrusek pushed a commit to branch camel-main in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit f916127ec1417e7d7aa5f443f2f32707722bfdd2 Author: jiriOndrusek-agent <[email protected]> AuthorDate: Thu Nov 19 11:56:25 2026 +0000 Fixed jaxb, servlet test modules - jaxb: CAMEL-27052 made the part class headers opt-in, enable allowPartClassFromHeader on the header routes - servlet: CAMEL-27115 type converter lookup fails under QuarkusClassLoader, do not build the helper CamelContext in the test Co-Authored-By: Claude Opus 5.5 <[email protected]> --- .../org/apache/camel/quarkus/component/jaxb/it/JaxbRoute.java | 10 ++++++++-- .../camel/quarkus/component/servlet/CamelServletTest.java | 5 +++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/integration-tests/jaxb/src/main/java/org/apache/camel/quarkus/component/jaxb/it/JaxbRoute.java b/integration-tests/jaxb/src/main/java/org/apache/camel/quarkus/component/jaxb/it/JaxbRoute.java index 9308cceaca5..ca7b916f21e 100644 --- a/integration-tests/jaxb/src/main/java/org/apache/camel/quarkus/component/jaxb/it/JaxbRoute.java +++ b/integration-tests/jaxb/src/main/java/org/apache/camel/quarkus/component/jaxb/it/JaxbRoute.java @@ -104,7 +104,10 @@ public class JaxbRoute extends RouteBuilder { from("direct:marshalPartClassFromHeader") .setHeader(JaxbConstants.JAXB_PART_CLASS, constant(PartClassPerson.class.getName())) .setHeader(JaxbConstants.JAXB_PART_NAMESPACE, constant(String.format("{%s}person", PartClassPerson.NAMESPACE))) - .marshal().jaxb(PartClassPerson.class.getPackageName()); + .marshal(dataFormat().jaxb() + .contextPath(PartClassPerson.class.getPackageName()) + .allowPartClassFromHeader(true) + .end()); from("direct:unmarshalPartClass") .unmarshal(jaxbDataFormatWithPartClass); @@ -112,7 +115,10 @@ public class JaxbRoute extends RouteBuilder { from("direct:unmarshalPartClassFromHeader") .setHeader(JaxbConstants.JAXB_PART_CLASS, constant(PartClassPerson.class.getName())) .setHeader(JaxbConstants.JAXB_PART_NAMESPACE, constant(String.format("{%s}person", PartClassPerson.NAMESPACE))) - .unmarshal().jaxb(PartClassPerson.class.getPackageName()); + .unmarshal(dataFormat().jaxb() + .contextPath(PartClassPerson.class.getPackageName()) + .allowPartClassFromHeader(true) + .end()); from("direct:unmarshalIgnoreJaxbElement") .unmarshal(jaxbDataFormatIgnoreElement); diff --git a/integration-tests/servlet/src/test/java/org/apache/camel/quarkus/component/servlet/CamelServletTest.java b/integration-tests/servlet/src/test/java/org/apache/camel/quarkus/component/servlet/CamelServletTest.java index b87966872bf..e7a2927006f 100644 --- a/integration-tests/servlet/src/test/java/org/apache/camel/quarkus/component/servlet/CamelServletTest.java +++ b/integration-tests/servlet/src/test/java/org/apache/camel/quarkus/component/servlet/CamelServletTest.java @@ -214,8 +214,9 @@ public class CamelServletTest { .body() .asInputStream(); - // The CamelContext instance is only needed to ensure the correct ClassLoader is used for deserialization - CamelContext context = new DefaultCamelContext(); + // The CamelContext instance is only needed to ensure the correct ClassLoader is used for deserialization. + // It is not built, so it does not init a type converter, which fails under QuarkusClassLoader + CamelContext context = new DefaultCamelContext(false); context.setApplicationContextClassLoader(Thread.currentThread().getContextClassLoader()); Object exception = HttpHelper.deserializeJavaObjectFromStream(response, context); assertNotNull(exception);
