-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcall-external-script.feature
59 lines (53 loc) · 2.63 KB
/
call-external-script.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Feature: call-external-script
Background:
Given input topic
| topic | alias | key_type | value_type |
| topic-string | topic_in | string | string |
And output topic
| topic | alias | key_type | value_type | readTimeoutInSecond |
| topic-string | topic_out | string | string | 10 |
And var uuid = call function: uuid
Scenario: call-scripts
Given var foo = bar
Given var foo2 = "bar"
When call script : /features/scripts/runExternalTool.sh 42
And call script :
"""
echo This a test for simply echoing 42
"""
And var myValue = call script : /features/scripts/runExternalTool.sh 43
And var myKey = call script :
"""
echo 44
"""
And assert var myKey $ == 44
And assert var myValue $ == "Hello World 43"
Scenario: call script after sending events
It should produce two records : one directly from Kapoeira, and another one from an interaction with an external system
that produces back to kafka.
When records with key and value are sent
| topic_alias | key | value | batch |
| topic_in | aTestKey_${uuid} | someValue | 1 |
And call script: /features/scripts/externalEffectProducingToKafka.sh send topic-string aTestKey2_${uuid}#producedByExternalSystem_${uuid}
Then expected records
| topic_alias | key | value | batch |
| topic_out | aTestKey_${uuid} | aValue1 | 1 |
| topic_out | aTestKey2_${uuid} | aValue2 | 1 |
And assert aValue1 $ == "someValue"
And assert aValue2 $ == "producedByExternalSystem_${uuid}"
Scenario: call script after sending events in multiple batches
It should produce three records : two directly from Kapoeira, and another one from an interaction with an external system
that produces back to kafka in the last batch declared.
When records with key and value are sent
| topic_alias | key | value | batch |
| topic_in | aTestKey3_${uuid} | someValue | 1 |
| topic_in | aTestKey3_${uuid} | someValue | 2 |
And call script: /features/scripts/externalEffectProducingToKafka.sh send topic-string aTestKey4_${uuid}#producedByExternalSystem_${uuid}
Then expected records
| topic_alias | key | value | batch |
| topic_out | aTestKey3_${uuid} | aValue1 | 1 |
| topic_out | aTestKey3_${uuid} | aValue2 | 2 |
| topic_out | aTestKey4_${uuid} | aValue3 | 2 |
And assert aValue1 $ == "someValue"
And assert aValue2 $ == "someValue"
And assert aValue3 $ == "producedByExternalSystem_${uuid}"