Add event-notification feature file template#470
Add event-notification feature file template#470rartych merged 42 commits intocamaraproject:mainfrom
Conversation
|
Thanks @bigludo7 The template should be updated with changes included in #464 (when it is merged) |
| When the request "createSubscription" is sent | ||
| Then the response code is 201 | ||
| And the response header "Content-Type" is "application/json" | ||
| And the response header "x-correlator" has same value as the request header "x-correlator" |
There was a problem hiding this comment.
Maybe we have to mention Location header that points to created subscription?
jlurien
left a comment
There was a problem hiding this comment.
We may include some additional scenario to test the "initialEvent". e.g.
@<xxx>_subscriptions_XX_subscription_creation_initial_event
Scenario: Receive initial event notification on creation
Given the API supports initial events to be sent
And a valid subscription request body with property "$.config.initialEvent" set to true
When the request "create<xxx>Subscription" is sent
Then the response code is 201 or 202
And an event notification of the subscribed type is received on callback-url
And notification body complies with the OAS schema at "#/components/schemas/Subscription"
```
This optional scenario may apply for some implementations
@_subscriptions_XX_subscription_creation_multievent_not_supported
Scenario: Multi event subscription not supported
Given the API provider only allows one event to be subscribed per subscription request
And a valid subscription request body
And the request body property "$.types" is set to an array of 2 valid items
When the request "createSubscription" is sent
Then the response code is 422
And the response property "$.status" is 422
And the response property "$.code" is "MULTIEVENT_SUBSCRIPTION_NOT_SUPPORTED"
And the response property "$.message" contains a user friendly text
artifacts/camara-cloudevents/event-subscription-template.feature
Outdated
Show resolved
Hide resolved
artifacts/camara-cloudevents/event-subscription-template.feature
Outdated
Show resolved
Hide resolved
artifacts/camara-cloudevents/event-subscription-template.feature
Outdated
Show resolved
Hide resolved
artifacts/camara-cloudevents/event-subscription-template.feature
Outdated
Show resolved
Hide resolved
artifacts/camara-cloudevents/event-subscription-template.feature
Outdated
Show resolved
Hide resolved
artifacts/camara-cloudevents/event-subscription-template.feature
Outdated
Show resolved
Hide resolved
artifacts/camara-cloudevents/event-subscription-template.feature
Outdated
Show resolved
Hide resolved
artifacts/camara-cloudevents/event-subscription-template.feature
Outdated
Show resolved
Hide resolved
artifacts/camara-cloudevents/event-subscription-template.feature
Outdated
Show resolved
Hide resolved
| And the response property "$.code" is "NOT_FOUND" | ||
| And the response property "$.message" contains a user friendly text | ||
|
|
||
| ########Specific Subscription error scenarios when Device object is used ################ |
There was a problem hiding this comment.
As we have these scenarios included in dedicated artifacts we may just reference the other artifacts to not maintain equivalent scenarios in several places
There was a problem hiding this comment.
Yes agree with your proposal @jlurien to remove them to avoid redundancy.
Before to remove them looking for OK from other "usual suspects": @PedroDiez @rartych @patrice-conil OK for you?
There was a problem hiding this comment.
I would keep here these tests because the dedicated artifacts
https://github.com/camaraproject/Commonalities/blob/main/artifacts/testing/C02-phoneNumber-errors.feature
https://github.com/camaraproject/Commonalities/blob/main/artifacts/testing/C01-device-errors.feature
They refer to "$.phoneNumber" or "$.device", and in subscription APIs, they are both under "$.config.subscriptionDetail." path so somehow it may be misleading for the reader.
Would this makes sense?
There was a problem hiding this comment.
Have aligned with Jose, please forget previous comment, yes we can take out this section from this PR and manage within ongoing #479.
There is a way to make it generic enough to cover both cases of "regular" APIs and "Subscription" APIs
There was a problem hiding this comment.
Yes, I have updated #479, so now artifacts are compatible with APIs having device or phoneNumber in paths other than $.xxx
|
@maxl2287 You may also be interested in reviewing my comments as a common agreement here will ease porting this artifact to the APIs |
artifacts/camara-cloudevents/event-subscription-template.feature
Outdated
Show resolved
Hide resolved
artifacts/camara-cloudevents/event-subscription-template.feature
Outdated
Show resolved
Hide resolved
artifacts/camara-cloudevents/event-subscription-template.feature
Outdated
Show resolved
Hide resolved
artifacts/camara-cloudevents/event-subscription-template.feature
Outdated
Show resolved
Hide resolved
artifacts/camara-cloudevents/event-subscription-template.feature
Outdated
Show resolved
Hide resolved
artifacts/camara-cloudevents/event-subscription-template.feature
Outdated
Show resolved
Hide resolved
artifacts/camara-cloudevents/event-subscription-template.feature
Outdated
Show resolved
Hide resolved
artifacts/camara-cloudevents/event-subscription-template.feature
Outdated
Show resolved
Hide resolved
artifacts/camara-cloudevents/event-subscription-template.feature
Outdated
Show resolved
Hide resolved
Co-authored-by: Pedro Díez García <pedro.diezgarcia@telefonica.com>
Co-authored-by: Pedro Díez García <pedro.diezgarcia@telefonica.com>
Co-authored-by: Jose Luis Urien <jlurien@gmail.com>
Co-authored-by: Jose Luis Urien <jlurien@gmail.com>
Co-authored-by: Jose Luis Urien <jlurien@gmail.com>
Co-authored-by: Jose Luis Urien <jlurien@gmail.com>
Co-authored-by: Pedro Díez García <pedro.diezgarcia@telefonica.com>
Co-authored-by: Jose Luis Urien <jlurien@gmail.com>
Co-authored-by: Jose Luis Urien <jlurien@gmail.com>
Co-authored-by: Jose Luis Urien <jlurien@gmail.com>
Co-authored-by: Jose Luis Urien <jlurien@gmail.com>
Co-authored-by: Jose Luis Urien <jlurien@gmail.com>
Co-authored-by: Jose Luis Urien <jlurien@gmail.com>
|
@bigludo7 please ask me to re-review when you think is ready |
Thanks - I added both. |
|
@rartych @jlurien @PedroDiez @patrice-conil Thanks all for your review !
Edit: Oh I misunderstood Pedro comment and we have already this feature file for device. I'm fine with Jose proposal just to avoid redundancy and regarding your comment Pedro we can add a note on this on the feature ? |
Editorial changes proposed by @jlurien Co-authored-by: Jose Luis Urien <jlurien@gmail.com>
Trailing spaces deleted. In line 118: And instead of Then
Co-authored-by: Jose Luis Urien <jlurien@gmail.com>
What type of PR is this?
What this PR does / why we need it:
This is a proposal of Subscription feature template.
I used the nice work done by @maxl2287 in several subscriptions API ;)
Which issue(s) this PR fixes:
Fixes #293
Does this PR introduce a breaking change?
Special notes for reviewers:
Changelog input
Additional documentation
This section can be blank.