|
17 | 17 | ## (Comments)
|
18 | 18 | #Sample Feature Definition Template
|
19 | 19 | Feature: Source change flow integrationtest
|
20 |
| - Scenario: Send eiffel events for source change flow and make sure EI is triggering on REST-POST subscriptions |
| 20 | + |
| 21 | + Scenario: |
| 22 | + Send eiffel events for source change flow and make sure EI is triggering on |
| 23 | + REST-POST subscriptions using buildWithParameters and JMESPATH extracted correct |
| 24 | + data to add to parameter |
| 25 | + |
21 | 26 | Given the rules "src/test/resources/SourceChangeObjectRules.json"
|
22 | 27 | And the events "src/test/resources/TestSourceChangeObjectEvents.json"
|
23 | 28 | And the upstream input "src/test/resources/UpstreamEventsForSourceChange.json"
|
24 | 29 | And the resulting aggregated object "src/test/resources/aggregatedSourceChangeObject.json";
|
25 | 30 | And the expected aggregated object ID is "sb6efi4n-25fb-4d77-b9fd-5f2xrrefe66de47"
|
26 |
| - And jenkins is set up with a job "source-change-job" |
27 |
| - And that "REST/POST" subscription with jmespath "id=='sb6efi4n-25fb-4d77-b9fd-5f2xrrefe66de47'" is uploaded |
| 31 | + # Setup jenkins |
| 32 | + Given jenkins data is prepared |
| 33 | + When job token "test-token-123" is added to jenkins data |
| 34 | + And parameter key "test_key" is added to jenkins data |
| 35 | + And bash script "echo 'param 1 ' $test_key" is added to jenkins data |
| 36 | + Then jenkins is set up with job name "sourceChangeTestJobParam" |
| 37 | + # Setup subscription |
| 38 | + Given subscription object for "REST/POST" with name "ParameterizedTriggerSubscription" is created |
| 39 | + When notification meta "http://${jenkinsHost}:${jenkinsPort}/job/${jenkinsJobName}/buildWithParameters?token='test-token-123'&test_key=id" is set in subscription |
| 40 | + And basic_auth authentication with username "admin" and password "admin" is set in subscription |
| 41 | + And rest post body media type is set to "application/x-www-form-urlencoded" is set in subscription |
| 42 | + And condition "id=='sb6efi4n-25fb-4d77-b9fd-5f2xrrefe66de47'" at requirement index '0' is added in subscription |
| 43 | + Then subscription is uploaded |
| 44 | + # Send Events and Check job triggered |
| 45 | + Given all previous steps passed |
28 | 46 | When the upstream input events are sent
|
29 |
| - And the eiffel events are sent |
30 |
| - Then the jenkins job should have been triggered. |
| 47 | + When the eiffel events are sent |
| 48 | + And jenkins job status data fetched |
| 49 | + Then verify jenkins job data timestamp is after test subscription was creted |
| 50 | + And jenkins job status data has key "test_key" with value "sb6efi4n-25fb-4d77-b9fd-5f2xrrefe66de47" |
| 51 | + And the jenkins job should be deleted |
| 52 | + |
| 53 | + Scenario: |
| 54 | + Send eiffel events for source change flow and make sure EI is triggering on |
| 55 | + REST-POST subscriptions using buildWithParameters and JMESPATH extracted correct |
| 56 | + data to add to parameter |
| 57 | + |
| 58 | + Given the rules "src/test/resources/SourceChangeObjectRules.json" |
| 59 | + And the events "src/test/resources/TestSourceChangeObjectEvents.json" |
| 60 | + And the upstream input "src/test/resources/UpstreamEventsForSourceChange.json" |
| 61 | + And the resulting aggregated object "src/test/resources/aggregatedSourceChangeObject.json"; |
| 62 | + And the expected aggregated object ID is "sb6efi4n-25fb-4d77-b9fd-5f2xrrefe66de47" |
| 63 | + # Setup jenkins |
| 64 | + Given jenkins data is prepared |
| 65 | + When job token "test-token-123" is added to jenkins data |
| 66 | + And parameter key "test_param_1" is added to jenkins data |
| 67 | + And parameter key "test_param_2" is added to jenkins data |
| 68 | + And bash script "echo 'param 1 ' $test_param_1" is added to jenkins data |
| 69 | + And bash script "echo 'param 2 ' $test_param_2" is added to jenkins data |
| 70 | + Then jenkins is set up with job name "sourceChangeTestJobBodyJson" |
| 71 | + # Setup subscription |
| 72 | + Given subscription object for "REST/POST" with name "ParameterInBodyTriggerSubscription" is created |
| 73 | + When notification meta "http://${jenkinsHost}:${jenkinsPort}/job/${jenkinsJobName}/build?token='test-token-123'" is set in subscription |
| 74 | + And basic_auth authentication with username "admin" and password "admin" is set in subscription |
| 75 | + And rest post body media type is set to "application/x-www-form-urlencoded" is set in subscription |
| 76 | + And paremeter form key "json" and form value "{parameter: [{name:'test_param_1', value:'Test Input Value'}, {name:'test_param_2', value:id}]}" is added in subscription |
| 77 | + And condition "id=='sb6efi4n-25fb-4d77-b9fd-5f2xrrefe66de47'" at requirement index '0' is added in subscription |
| 78 | + Then subscription is uploaded |
| 79 | + # Send Events and Check job triggered |
| 80 | + Given all previous steps passed |
| 81 | + When the upstream input events are sent |
| 82 | + When the eiffel events are sent |
| 83 | + And jenkins job status data fetched |
| 84 | + Then verify jenkins job data timestamp is after test subscription was creted |
| 85 | + And jenkins job status data has key "test_param_1" with value "Test Input Value" |
| 86 | + And jenkins job status data has key "test_param_2" with value "sb6efi4n-25fb-4d77-b9fd-5f2xrrefe66de47" |
| 87 | + Then the jenkins job should be deleted |
0 commit comments