Skip to content
Snippets Groups Projects
Verified Commit 69384d97 authored by Georgi Michev's avatar Georgi Michev
Browse files

Update webhook for policy change


Update the test with more relevant scenarios, which are meant for
demonstration only.

Signed-off-by: default avatarGeorgi Michev <georgi.michev@vereign.com>
parent 16906070
Branches
No related tags found
1 merge request!51Update webhook for policy change
Pipeline #68300 passed
{
"successful_address": {
"subscriber": "vereign.test.policy",
"webhook_url": "https://webhook.site/4d79f1a0-9608-4d5b-9187-dfe18ae3467b"
},
"missing_url": {
"subscriber": "vereign.rest.policy"
},
"missing_subscriber": {
"webhook_url": "https://webhook.site/4d79f1a0-9608-4d5b-9187-dfe18ae3467b"
}
}
\ No newline at end of file
#Copyright (c) 2023 Vereign AG [https://www.vereign.com] #Copyright (c) 2023 Vereign AG [https://www.vereign.com]
@rest @all @tsa @policy @phase2 @IDM.TSA.E1.00007 @wip @rest @all @tsa @policy @phase2 @IDM.TSA.E1.00007 @IDM.TSA.E1.00008 @wip
Feature: API - TSA -Policy - :group/:name/:version/notifychange POST Feature: API - TSA -Policy - :group/:name/:version/notifychange POST
As user As user
I want to be able to subscribe for events for the Policy service I want to be able to subscribe for events for the Policy service
...@@ -21,3 +21,42 @@ Feature: API - TSA -Policy - :group/:name/:version/notifychange POST ...@@ -21,3 +21,42 @@ Feature: API - TSA -Policy - :group/:name/:version/notifychange POST
And The same message should have field {type} which has value {update_policy} And The same message should have field {type} which has value {update_policy}
And the response is valid according to the {update_policy_message_schema.json} REST schema And the response is valid according to the {update_policy_message_schema.json} REST schema
Then I unlock the policy group {example} name {test} version {1.0} Then I unlock the policy group {example} name {test} version {1.0}
Scenario: TSA - Get notifications from Webhook for policy change - Positive
When I load the REST request {Webhook.json} with profile {successful_address}
And I send the request to the notify change
Then the status code should be {200}
And I lock the Policy group {example} name {test} version {1.0}
Then the status code should be {200}
Then I should see a message with field {repository} which has value {policies}
Then I should see a message with field {name} which has value {locked}
Then I should see a message with field {version} which has value {1.0}
Then I should see a message with field {group} which has value {example}
@negative
Scenario: TSA - Subscribe for second time to the Webhook for policy change - Negative
When I load the REST request {Webhook.json} with profile {successful_address}
And I send the request to the notify change with group {example} name {test} version {1.0} via TSA Policy API
Then the status code should be {500}
Then the field {message} has the value {subscriber already exists}
@negative
Scenario: TSA - Get notifications from Webhook for policy change with missing url - Negative
When I load the REST request {Webhook.json} with profile {missing_url}
And I send the request to the notify change with group {example} name {test} version {1.0} via TSA Policy API
Then the status code should be {400}
Then the field {message} has the value {"webhook_url" is missing from body}
@negative
Scenario: TSA - Get notifications from Webhook for policy change with missing subscriber - Negative
When I load the REST request {Webhook.json} with profile {missing_subscriber}
And I send the request to the notify change with group {example} name {test} version {1.0} via TSA Policy API
Then the status code should be {400}
Then the field {message} has the value {"subscriber" is missing from body}
@negative
Scenario: TSA - Get notifications from Webhook for non-existing policy - Negative
When I load the REST request {Webhook.json} with profile {successful_address}
And I send the request to the notify change with group {example} name {non_existing} version {1.0} via TSA Policy API
Then the status code should be {500}
Then the field {message} has the value {mongo: no documents in result}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment