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

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

commit a55ae3957b3c98a2079d897b8538d832ac56e46c
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue Jul 6 12:20:22 2021 +0200

    CAMEL-16757: camel-core - Global error handling, interceptor in all DSL
---
 .../camel/dsl/yaml/RoutesConfigurationTest.groovy  | 48 ++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git 
a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/RoutesConfigurationTest.groovy
 
b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/RoutesConfigurationTest.groovy
index 427748a..33ba988 100644
--- 
a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/RoutesConfigurationTest.groovy
+++ 
b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/RoutesConfigurationTest.groovy
@@ -58,4 +58,52 @@ class RoutesConfigurationTest extends YamlTestSupport {
         then:
             MockEndpoint.assertIsSatisfied(context)
     }
+
+    def "routes-configuration-separate"() {
+        setup:
+        // global configurations
+        loadRoutes """
+                - beans:
+                  - name: myFailingProcessor
+                    type: ${MyFailingProcessor.name}
+                - routes-configuration:
+                    - on-exception:
+                        handled:
+                          constant: "true"
+                        exception:
+                          - ${MyException.name}
+                        steps:
+                          - transform:
+                              constant: "Sorry"
+                          - to: "mock:on-exception"  
+            """
+        // routes
+        loadRoutes """
+                - from:
+                    uri: "direct:start"
+                    steps:
+                      - process: 
+                          ref: "myFailingProcessor"            
+                - from:
+                    uri: "direct:start2"
+                    steps:
+                      - process: 
+                          ref: "myFailingProcessor"            
+            """
+
+        withMock('mock:on-exception') {
+            expectedBodiesReceived 'Sorry', 'Sorry'
+        }
+
+        when:
+        context.start()
+
+        withTemplate {
+            to('direct:start').withBody('hello').send()
+            to('direct:start2').withBody('hello2').send()
+        }
+        then:
+        MockEndpoint.assertIsSatisfied(context)
+    }
+
 }

Reply via email to