From 7d8bc91c7e7dd2db5aaf49a3c5f9a5455c9bb520 Mon Sep 17 00:00:00 2001 From: kzangeli Date: Wed, 27 May 2026 15:32:34 +0200 Subject: [PATCH] fix: Delete CSR-subscription keyword must not raise on expected 4xx (042_02/03) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The keyword "Delete Context Source Registration Subscription" issued its DELETE without expected_status=any, so RequestsLibrary raised an HTTPError on any status >= 400. 042_02_01 (invalid URI, expects 400 BadRequestData) and 042_03_01 (unknown id, expects 404 ResourceNotFound) are negative-path tests, so the keyword aborted before they could assert the status code. Every sibling keyword in ContextSourceRegistrationSubscription.resource already carries expected_status=any (lines 37, 70, 89, 100, 111), as does the regular Delete Subscription keyword — the Delete keyword here was the one that was missed. Add it. The broker is correct (400 for invalid URI, 404 for unknown). Documented as testsuite-doubts.md #76. Co-Authored-By: Claude Opus 4.7 --- ...extSourceRegistrationSubscription.resource | 1 + testsuite-doubts.md | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/resources/ApiUtils/ContextSourceRegistrationSubscription.resource b/resources/ApiUtils/ContextSourceRegistrationSubscription.resource index 373d0bba..c0ca365d 100755 --- a/resources/ApiUtils/ContextSourceRegistrationSubscription.resource +++ b/resources/ApiUtils/ContextSourceRegistrationSubscription.resource @@ -44,6 +44,7 @@ Delete Context Source Registration Subscription ${response}= DELETE ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + ... expected_status=any Output ${response} Delete Context Source Registration Subscription RETURN ${response} diff --git a/testsuite-doubts.md b/testsuite-doubts.md index 37911a5d..93def5a4 100644 --- a/testsuite-doubts.md +++ b/testsuite-doubts.md @@ -2291,3 +2291,29 @@ Or the geometry param should switch to `LineString` (with the existing coordinate shape) — but then the test is no longer a "Within Polygon" test, so option 1 is the right fix. + +## 76. `042_02_01` / `042_03_01` — Delete CSR-subscription keyword raises on the 4xx it is meant to assert + +**Hit:** `042_02_01` (delete with invalid URI, expects **400** +`BadRequestData`) and `042_03_01` (delete unknown id, expects **404** +`ResourceNotFound`) both fail with an `HTTPError` exception +(`400 Client Error` / `404 Client Error`) raised *before* the +`Check Response Status Code` assertion is reached. + +**Why:** the keyword `Delete Context Source Registration Subscription` in +`resources/ApiUtils/ContextSourceRegistrationSubscription.resource` issues +its `DELETE` without `expected_status=any`, so RequestsLibrary raises on +any status ≥ 400. These two are negative-path tests that *expect* a 4xx, +so the keyword aborts before they can assert it. Every sibling keyword in +the same file already carries `expected_status=any` (lines 37, 70, 89, +100, 111), as does the regular `Delete Subscription` keyword — the Delete +keyword here is simply the one that was missed. + +**Impact / broker:** none — the broker correctly returns 400 for an +invalid URI and 404 for an unknown subscription, with the right +ProblemDetails. The defect is entirely test-side. + +**Fix wanted:** add `... expected_status=any` to the `DELETE` call in +`Delete Context Source Registration Subscription`, matching the other +keywords in the file. **Verified:** with the one-line fix both tests pass +(and `042_01_01`, the happy-path delete, still passes). -- GitLab