-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(test): test correct filtering of messages from Knative broker
- Loading branch information
1 parent
b4835d2
commit 1438041
Showing
2 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |