-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be5383e
commit 64fa372
Showing
19 changed files
with
255 additions
and
35 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
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
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
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
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
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
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
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
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
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,29 @@ | ||
apiVersion: camel.apache.org/v1 | ||
kind: Pipe | ||
metadata: | ||
name: slack-sink-pipe | ||
spec: | ||
source: | ||
ref: | ||
kind: Kamelet | ||
apiVersion: camel.apache.org/v1 | ||
name: timer-source | ||
properties: | ||
period: ${timer.source.period} | ||
message: '${slack.message}' | ||
steps: | ||
- ref: | ||
kind: Kamelet | ||
apiVersion: camel.apache.org/v1 | ||
name: log-action | ||
properties: | ||
showHeaders: true | ||
sink: | ||
ref: | ||
kind: Kamelet | ||
apiVersion: camel.apache.org/v1 | ||
name: slack-sink | ||
properties: | ||
webhookUrl: yaks:resolveURL('slack-service') | ||
channel: ${slack.channel} | ||
token: ${slack.token} |
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,40 @@ | ||
Feature: Slack Kamelet - Sink | ||
|
||
Background: | ||
Given variables | ||
| timer.source.period | 10000 | | ||
| slack.channel | announcements | | ||
| slack.message | Camel rocks! | | ||
| slack.user.id | W12345678 | | ||
| slack.team.id | T12345678 | | ||
Given HTTP server timeout is 120000 ms | ||
Given HTTP server "slack-service" | ||
|
||
Scenario: Create Http server | ||
Given create Kubernetes service slack-service | ||
|
||
Scenario: Verify Slack events | ||
Given variables | ||
| slack.token | xoxb-yaks:randomNumber(10)-yaks:randomNumber(13)-yaks:randomString(34) | | ||
# Create binding | ||
Given load Pipe slack-sink-pipe.yaml | ||
And Pipe slack-sink-pipe is available | ||
# Verify authentication test | ||
Given expect HTTP request header: Content-Type="application/json; charset=UTF-8" | ||
Then expect HTTP request body | ||
""" | ||
{ | ||
"channel": "${slack.channel}", | ||
"text": "${slack.message}", | ||
} | ||
""" | ||
When receive POST / | ||
Then send HTTP 200 OK | ||
# Verify event | ||
And Camel K integration slack-sink-pipe should print ${slack.message} | ||
|
||
Scenario: Remove resources | ||
# Remove Camel K binding | ||
Given delete Pipe slack-sink-pipe | ||
Given delete Kubernetes service slack-service | ||
And stop server component slack-service |
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,21 @@ | ||
apiVersion: camel.apache.org/v1 | ||
kind: Pipe | ||
metadata: | ||
name: slack-source-pipe | ||
spec: | ||
source: | ||
ref: | ||
kind: Kamelet | ||
apiVersion: camel.apache.org/v1 | ||
name: slack-source | ||
properties: | ||
serverUrl: yaks:resolveURL('slack-service') | ||
channel: ${slack.channel} | ||
token: ${slack.token} | ||
sink: | ||
ref: | ||
kind: Kamelet | ||
apiVersion: camel.apache.org/v1 | ||
name: log-sink | ||
properties: | ||
showHeaders: true |
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
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
Oops, something went wrong.