Skip to content

Commit

Permalink
chore(test): test correct filtering of messages from Knative broker
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaferraro committed Mar 12, 2021
1 parent b4835d2 commit 1438041
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
51 changes: 51 additions & 0 deletions 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
24 changes: 24 additions & 0 deletions 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

0 comments on commit 1438041

Please sign in to comment.