|
| 1 | +Feature: Search SDS Device - failure scenarios |
| 2 | + These scenarios demonstrate failure SDS Device searching |
| 3 | + |
| 4 | + Background: |
| 5 | + Given "default" request headers: |
| 6 | + | name | value | |
| 7 | + | version | 1 | |
| 8 | + | Authorization | letmein | |
| 9 | + |
| 10 | + Scenario: Unsuccessfully search an SDS Device without query params |
| 11 | + When I make a "GET" request with "default" headers to "searchSdsDevice" |
| 12 | + Then I receive a status code "400" with body |
| 13 | + | path | value | |
| 14 | + | errors.0.code | MISSING_VALUE | |
| 15 | + | errors.0.message | SearchSDSDeviceQueryParams.nhs_id_code: field required | |
| 16 | + | errors.1.code | MISSING_VALUE | |
| 17 | + | errors.1.message | SearchSDSDeviceQueryParams.nhs_as_svc_ia: field required | |
| 18 | + And the response headers contain: |
| 19 | + | name | value | |
| 20 | + | Content-Type | application/json | |
| 21 | + | Content-Length | 206 | |
| 22 | + |
| 23 | + Scenario: Unsuccessfully search an SDS Device without nhs_id_code query param |
| 24 | + When I make a "GET" request with "default" headers to "searchSdsDevice?nhs_as_svc_ia=Foo" |
| 25 | + Then I receive a status code "400" with body |
| 26 | + | path | value | |
| 27 | + | errors.0.code | MISSING_VALUE | |
| 28 | + | errors.0.message | SearchSDSDeviceQueryParams.nhs_id_code: field required | |
| 29 | + And the response headers contain: |
| 30 | + | name | value | |
| 31 | + | Content-Type | application/json | |
| 32 | + | Content-Length | 108 | |
| 33 | + |
| 34 | + Scenario: Unsuccessfully search an SDS Device without nhs_as_svc_ia query param |
| 35 | + When I make a "GET" request with "default" headers to "searchSdsDevice?nhs_id_code=Foo" |
| 36 | + Then I receive a status code "400" with body |
| 37 | + | path | value | |
| 38 | + | errors.0.code | MISSING_VALUE | |
| 39 | + | errors.0.message | SearchSDSDeviceQueryParams.nhs_as_svc_ia: field required | |
| 40 | + And the response headers contain: |
| 41 | + | name | value | |
| 42 | + | Content-Type | application/json | |
| 43 | + | Content-Length | 110 | |
| 44 | + |
| 45 | + Scenario: Unsuccessfully search an SDS Device with unknown query param |
| 46 | + When I make a "GET" request with "default" headers to "searchSdsDevice?nhs_id_code=Foo&nhs_as_svc_ia=Bar&foo=bar" |
| 47 | + Then I receive a status code "400" with body |
| 48 | + | path | value | |
| 49 | + | errors.0.code | VALIDATION_ERROR | |
| 50 | + | errors.0.message | SearchSDSDeviceQueryParams.foo: extra fields not permitted | |
| 51 | + And the response headers contain: |
| 52 | + | name | value | |
| 53 | + | Content-Type | application/json | |
| 54 | + | Content-Length | 115 | |
0 commit comments