rest_test integrations to YAML
MODIFY
e2e/common/cron_test.go
e2e/common/cron_test.go
@@ -37,7 +37,7 @@ func TestRunCronExample(t *testing.T) {
Expect(Kamel("install", "-n", ns).Execute()).To(Succeed())
t.Run("cron", func(t *testing.T) {
- Expect(Kamel("run", "-n", ns, "files/cron.groovy").Execute()).To(Succeed())
+ Expect(Kamel("run", "-n", ns, "files/cron.yaml").Execute()).To(Succeed())
Eventually(IntegrationCronJob(ns, "cron"), TestTimeoutMedium).ShouldNot(BeNil())
Eventually(IntegrationCondition(ns, "cron", camelv1.IntegrationConditionReady), TestTimeoutMedium).Should(Equal(v1.ConditionTrue))
Eventually(IntegrationLogs(ns, "cron"), TestTimeoutMedium).Should(ContainSubstring("Magicstring!"))
@@ -53,7 +53,7 @@ func TestRunCronExample(t *testing.T) {
})
t.Run("cron-timer", func(t *testing.T) {
- Expect(Kamel("run", "-n", ns, "files/cron-timer.groovy").Execute()).To(Succeed())
+ Expect(Kamel("run", "-n", ns, "files/cron-timer.yaml").Execute()).To(Succeed())
Eventually(IntegrationCronJob(ns, "cron-timer"), TestTimeoutMedium).ShouldNot(BeNil())
Eventually(IntegrationCondition(ns, "cron-timer", camelv1.IntegrationConditionReady), TestTimeoutMedium).Should(Equal(v1.ConditionTrue))
Eventually(IntegrationLogs(ns, "cron-timer"), TestTimeoutMedium).Should(ContainSubstring("Magicstring!"))
@@ -61,7 +61,7 @@ func TestRunCronExample(t *testing.T) {
})
t.Run("cron-fallback", func(t *testing.T) {
- Expect(Kamel("run", "-n", ns, "files/cron-fallback.groovy").Execute()).To(Succeed())
+ Expect(Kamel("run", "-n", ns, "files/cron-fallback.yaml").Execute()).To(Succeed())
Eventually(IntegrationPodPhase(ns, "cron-fallback"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
Eventually(IntegrationCondition(ns, "cron-fallback", camelv1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(v1.ConditionTrue))
Eventually(IntegrationLogs(ns, "cron-fallback"), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
@@ -69,7 +69,7 @@ func TestRunCronExample(t *testing.T) {
})
t.Run("cron-quartz", func(t *testing.T) {
- Expect(Kamel("run", "-n", ns, "files/cron-quartz.groovy").Execute()).To(Succeed())
+ Expect(Kamel("run", "-n", ns, "files/cron-quartz.yaml").Execute()).To(Succeed())
Eventually(IntegrationPodPhase(ns, "cron-quartz"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
Eventually(IntegrationCondition(ns, "cron-quartz", camelv1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(v1.ConditionTrue))
Eventually(IntegrationLogs(ns, "cron-quartz"), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))

ADD
e2e/common/files/rest-consumer.yaml
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+- rest:
+ verb:
+ - method: get
+ uri: "/customers/{name}"
+ to: "direct:start"
+
+- from:
+ uri: "direct:start"
+ steps:
+ - log:
+ message: "get ${header.name}"
+ - set-body:
+ simple: "${header.name} Doe"

ADD
e2e/common/files/rest-producer.yaml
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+- from:
+ uri: "timer:tick"
+ steps:
+ - to:
+ uri: "http:{{serviceName}}/customers/{{name}}"
+ - log:
+ message: "${body}"

MODIFY
e2e/common/rest_test.go
e2e/common/rest_test.go
@@ -48,17 +48,17 @@ func TestRunRest(t *testing.T) {
}
Expect(Kamel("install", "-n", ns, "--trait-profile", profile).Execute()).To(Succeed())
- Expect(Kamel("run", "-n", ns, "files/RestConsumer.java").Execute()).To(Succeed())
+ Expect(Kamel("run", "-n", ns, "files/rest-consumer.yaml").Execute()).To(Succeed())
Eventually(IntegrationPodPhase(ns, "rest-consumer"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
t.Run("Service works", func(t *testing.T) {
name := "John"
service := Service(ns, "rest-consumer")
Eventually(service, TestTimeoutShort).ShouldNot(BeNil())
- Expect(Kamel("run", "-n", ns, "files/RestProducer.groovy", "-p", "serviceName=rest-consumer", "-p", "name="+name).Execute()).To(Succeed())
+ Expect(Kamel("run", "-n", ns, "files/rest-producer.yaml", "-p", "serviceName=rest-consumer", "-p", "name="+name).Execute()).To(Succeed())
Eventually(IntegrationPodPhase(ns, "rest-producer"), TestTimeoutMedium).Should(Equal(v1.PodRunning))
- Eventually(IntegrationLogs(ns, "rest-consumer"), TestTimeoutShort).Should(ContainSubstring(fmt.Sprintf("get %s", name)))
- Eventually(IntegrationLogs(ns, "rest-producer"), TestTimeoutShort).Should(ContainSubstring(fmt.Sprintf("%s Doe", name)))
+ Eventually(IntegrationLogs(ns, "rest-consumer"), TestTimeoutLong).Should(ContainSubstring(fmt.Sprintf("get %s", name)))
+ Eventually(IntegrationLogs(ns, "rest-producer"), TestTimeoutLong).Should(ContainSubstring(fmt.Sprintf("%s Doe", name)))
})
if ocp {

rest_test integrations to YAML