You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2021/04/12 22:12:05 UTC

[camel-k] 01/04: chore(test): test correct filtering of messages from Knative broker

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

nferraro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 1de29d7943d64c58baebe31dbf058bb5cb6064e6
Author: nicolaferraro <ni...@gmail.com>
AuthorDate: Fri Mar 12 11:16:50 2021 +0100

    chore(test): test correct filtering of messages from Knative broker
---
 .../common/knative-broker/knative-broker.feature   | 51 ++++++++++++++++++++++
 e2e/yaks/common/knative-broker/yaks-config.yaml    | 24 ++++++++++
 2 files changed, 75 insertions(+)

diff --git a/e2e/yaks/common/knative-broker/knative-broker.feature b/e2e/yaks/common/knative-broker/knative-broker.feature
new file mode 100644
index 0000000..f95b7b6
--- /dev/null
+++ b/e2e/yaks/common/knative-broker/knative-broker.feature
@@ -0,0 +1,51 @@
+Feature: Camel K can correctly filter messages from broker
+
+  Background:
+    Given Knative broker default is running
+    Given Disable auto removal of Camel-K resources
+    Given Disable auto removal of Kubernetes resources
+    Given Camel-K resource polling configuration
+      | maxAttempts          | 60   |
+      | delayBetweenAttempts | 3000 |
+
+  Scenario: Integration sends messages to the broker
+    Given create Camel-K integration sender.groovy
+    """
+    from('timer:tick?period=1000')
+      .setBody().constant('event-1')
+      .to('knative:event/evt1')
+
+    from('timer:tick?period=1000')
+      .setBody().constant('event-2')
+      .to('knative:event/evt2')
+
+    from('timer:tick?period=1000')
+      .setBody().constant('event-all')
+      .to('knative:event')
+    """
+    Then Camel-K integration sender should be running
+
+
+  Scenario: Integration receives the correct messages from the broker
+    Given create Camel-K integration receiver.groovy
+    """
+    from('knative:event/evt1')
+      .log('From evt1: $simple{body}')
+
+    from('knative:event/evt2')
+      .log('From evt2: $simple{body}')
+
+    from('knative:event')
+      .log('From all: $simple{body}')
+    """
+    Then Camel-K integration receiver should print From evt1: event-1
+    And Camel-K integration receiver should print From evt2: event-2
+    And Camel-K integration receiver should print From all: event-1
+    And Camel-K integration receiver should print From all: event-2
+    And Camel-K integration receiver should print From all: event-all
+    And Camel-K integration receiver should not print From evt1: event-2
+    And Camel-K integration receiver should not print From evt1: event-all
+    And Camel-K integration receiver should not print From evt2: event-1
+    And Camel-K integration receiver should not print From evt2: event-all
+    And delete Camel-K integration sender
+    And delete Camel-K integration receiver
diff --git a/e2e/yaks/common/knative-broker/yaks-config.yaml b/e2e/yaks/common/knative-broker/yaks-config.yaml
new file mode 100644
index 0000000..95d9bf9
--- /dev/null
+++ b/e2e/yaks/common/knative-broker/yaks-config.yaml
@@ -0,0 +1,24 @@
+# ---------------------------------------------------------------------------
+# 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.
+# ---------------------------------------------------------------------------
+
+config:
+  namespace:
+    temporary: true
+pre:
+- name: installation
+  run: |
+    kamel install -n $YAKS_NAMESPACE