From c153412a4fb40873a127e24a2096e6f166d74c05 Mon Sep 17 00:00:00 2001 From: Adriano Machado <60320+ammachado@users.noreply.github.com> Date: Tue, 30 Jun 2026 23:28:55 -0400 Subject: [PATCH] CAMEL-23864: fix edi-x12-as2 and openapi/server examples after YAML normalization The YAML canonical-form normalization in 60a70d8 introduced two test regressions, both verified against Camel 4.18.2 / Citrus 4.10.1: - edi-x12-as2: onException was moved out of the as2Error routeConfiguration into the route steps, causing "Route receivePurchaseOrder has no output processors" at startup. Restored onException (with the AS2 disposition FAILED script handler) into the routeConfiguration. Also fixed an invalid ediMessageCharset value (charset=US-ASCII -> US-ASCII) that triggered IllegalCharsetNameException once the route started correctly. - openapi/server: the restConfiguration with apiContextPath: openapi was deleted, so the spec was no longer served at /openapi and the test got HTTP 404. Restored the restConfiguration block. Also moves the ftp example runtime dependencies from jbang.properties (run.deps) to camel.jbang.dependencies in application.properties. All 8 workflow test suites pass. Related to CAMEL-23863. Co-Authored-By: Claude Opus 4.8 --- edi-x12-as2/camel/edi-x12-as2.camel.yaml | 28 +++++++++++++----------- ftp/application.properties | 3 +++ ftp/jbang.properties | 5 ++--- openapi/server/petstore.camel.yaml | 3 +++ 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/edi-x12-as2/camel/edi-x12-as2.camel.yaml b/edi-x12-as2/camel/edi-x12-as2.camel.yaml index f7cf18c..95bb540 100644 --- a/edi-x12-as2/camel/edi-x12-as2.camel.yaml +++ b/edi-x12-as2/camel/edi-x12-as2.camel.yaml @@ -1,5 +1,19 @@ - routeConfiguration: id: as2Error + onException: + - onException: + exception: + - java.lang.Exception + handled: + constant: + expression: "true" + steps: + - script: + expression: + groovy: + expression: "httpContext = exchangeProperties['CamelAs2.interchange']\n\ + httpContext.setAttribute(org.apache.camel.component.as2.api.AS2Header.DISPOSITION_TYPE,\ + \ \n org.apache.camel.component.as2.api.entity.AS2DispositionType.FAILED)\n" - route: id: receivePurchaseOrder routeConfigurationId: as2Error @@ -11,18 +25,6 @@ requestUriPattern: /mycorp/orders serverPortNumber: 8081 steps: - - onException: - exception: - - java.lang.Exception - handled: - constant: - expression: "true" - - script: - expression: - groovy: - expression: "httpContext = exchangeProperties['CamelAs2.interchange']\n\ - httpContext.setAttribute(org.apache.camel.component.as2.api.AS2Header.DISPOSITION_TYPE,\ - \ \n org.apache.camel.component.as2.api.entity.AS2DispositionType.FAILED)\n" - to: uri: jms parameters: @@ -89,7 +91,7 @@ as2From: mycorp as2MessageStructure: PLAIN as2To: acme - ediMessageCharset: charset=US-ASCII + ediMessageCharset: US-ASCII ediMessageContentType: application/edi-x12 from: bob@example.org inBody: ediMessage diff --git a/ftp/application.properties b/ftp/application.properties index 97f3dda..128c508 100644 --- a/ftp/application.properties +++ b/ftp/application.properties @@ -19,3 +19,6 @@ camel.beans.poolCF.connectionIdleTimeout = 20000 camel.component.jms.connection-factory = #bean:poolCF camel.jbang.classpathFiles=application.properties + +# Additional dependencies required at runtime (comma separated) +camel.jbang.dependencies=jakarta.inject:jakarta.inject-api:2.0.1,jakarta.enterprise:jakarta.enterprise.cdi-api:4.1.0 diff --git a/ftp/jbang.properties b/ftp/jbang.properties index a86794f..06e387f 100644 --- a/ftp/jbang.properties +++ b/ftp/jbang.properties @@ -1,3 +1,2 @@ -# Declare required additional dependencies for testing -run.deps=jakarta.inject:jakarta.inject-api:2.0.1,\ -jakarta.enterprise:jakarta.enterprise.cdi-api:4.1.0 +# Additional runtime dependencies are declared via camel.jbang.dependencies +# in application.properties (Camel JBang natively supports comma separated lists). diff --git a/openapi/server/petstore.camel.yaml b/openapi/server/petstore.camel.yaml index 155dd3d..78afa9e 100644 --- a/openapi/server/petstore.camel.yaml +++ b/openapi/server/petstore.camel.yaml @@ -1,3 +1,6 @@ +- restConfiguration: + clientRequestValidation: true + apiContextPath: openapi - rest: openApi: specification: petstore-api.json