You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2023/02/22 13:31:38 UTC
[camel] branch main updated: CAMEL-19084: Add basic YAML tests for resume strategies
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton 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 0fe09a20ad4 CAMEL-19084: Add basic YAML tests for resume strategies
0fe09a20ad4 is described below
commit 0fe09a20ad450342451e149b092edc02fd090600
Author: James Netherton <ja...@gmail.com>
AuthorDate: Wed Feb 22 09:24:59 2023 +0000
CAMEL-19084: Add basic YAML tests for resume strategies
---
.../org/apache/camel/dsl/yaml/PausableTest.groovy | 42 ++++++++++++++++++++++
.../org/apache/camel/dsl/yaml/ResumableTest.groovy | 41 +++++++++++++++++++++
2 files changed, 83 insertions(+)
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/PausableTest.groovy b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/PausableTest.groovy
new file mode 100644
index 00000000000..44a72eacb26
--- /dev/null
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/PausableTest.groovy
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dsl.yaml
+
+import org.apache.camel.dsl.yaml.support.YamlTestSupport
+import org.apache.camel.model.PausableDefinition
+
+class PausableTest extends YamlTestSupport {
+
+ def "pausable definition"() {
+ when:
+ loadRoutes '''
+ - from:
+ uri: "direct:start"
+ steps:
+ - pausable:
+ consumer-listener: myConsumerListenerBeanRef
+ until-check: myUntilCheckBeanRef
+ - to: mock:result
+
+ '''
+ then:
+ with(context.routeDefinitions[0].outputs[0], PausableDefinition) {
+ consumerListener == "myConsumerListenerBeanRef"
+ untilCheck == "myUntilCheckBeanRef"
+ }
+ }
+}
diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/ResumableTest.groovy b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/ResumableTest.groovy
new file mode 100644
index 00000000000..13eada5a304
--- /dev/null
+++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/test/groovy/org/apache/camel/dsl/yaml/ResumableTest.groovy
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.dsl.yaml
+
+import org.apache.camel.dsl.yaml.support.YamlTestSupport
+import org.apache.camel.model.ResumableDefinition
+
+class ResumableTest extends YamlTestSupport {
+
+ def "resumable definition"() {
+ when:
+ loadRoutes '''
+ - from:
+ uri: "direct:start"
+ steps:
+ - resumable:
+ resume-strategy: myResumeStrategyBeanRef
+ intermittent: true
+ - to: mock:result
+ '''
+ then:
+ with(context.routeDefinitions[0].outputs[0], ResumableDefinition) {
+ resumeStrategy == "myResumeStrategyBeanRef"
+ intermittent == "true"
+ }
+ }
+}