You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2024/03/25 14:29:36 UTC
(camel) branch main updated: yaml-dsl: add a test with processor referenced by class name
This is an automated email from the ASF dual-hosted git repository.
lburgazzoli pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 379318b5d5b yaml-dsl: add a test with processor referenced by class name
379318b5d5b is described below
commit 379318b5d5bd30f758d248ba9d7ec7b6558b36c9
Author: Luca Burgazzoli <lb...@gmail.com>
AuthorDate: Mon Mar 25 15:09:10 2024 +0100
yaml-dsl: add a test with processor referenced by class name
---
.../org/apache/camel/dsl/yaml/ProcessTest.groovy | 26 ++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/ProcessTest.groovy b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/ProcessTest.groovy
index 14fe85c5e7f..46f3d6c14b9 100644
--- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/ProcessTest.groovy
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/ProcessTest.groovy
@@ -16,6 +16,7 @@
*/
package org.apache.camel.dsl.yaml
+import org.apache.camel.component.mock.MockEndpoint
import org.apache.camel.dsl.yaml.support.YamlTestSupport
import org.apache.camel.model.ProcessDefinition
@@ -35,4 +36,29 @@ class ProcessTest extends YamlTestSupport {
ref == 'myProcessor'
}
}
+
+ def "process with class ref"() {
+ setup:
+ loadRoutes '''
+ - from:
+ uri: "direct:route"
+ steps:
+ - process:
+ ref: "#class:org.apache.camel.dsl.yaml.support.model.MyUppercaseProcessor"
+ - to: "mock:route"
+ '''
+
+ withMock('mock:route') {
+ expectedBodiesReceived 'TEST'
+ }
+
+ when:
+ context.start()
+
+ withTemplate {
+ to('direct:route').withBody('test').send()
+ }
+ then:
+ MockEndpoint.assertIsSatisfied(context)
+ }
}