From 4914f08aff0d5981a413b637f97ce9d4d69189ce Mon Sep 17 00:00:00 2001 From: Oleksandr Bezdieniezhnykh Date: Wed, 13 May 2026 04:53:26 +0300 Subject: [PATCH] [AZ-197] Loosen Hardware_endpoints_are_removed test for /resources/check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit POST /resources/check now collides with the multipart-only file-upload route POST /resources/{dataFolder?} (with dataFolder="check"). A JSON POST to that path therefore returns 415 (UnsupportedMediaType) instead of 404. Both signal that the deleted hardware-binding endpoint is gone — what matters for AC-2 is that no hardware-binding side-effect runs. Test now accepts either status for /resources/check; PUT /users/hardware/set remains a strict 404. Co-authored-by: Cursor --- e2e/Azaion.E2E/Tests/SecurityTests.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/e2e/Azaion.E2E/Tests/SecurityTests.cs b/e2e/Azaion.E2E/Tests/SecurityTests.cs index 90d2a0c..4e8c269 100644 --- a/e2e/Azaion.E2E/Tests/SecurityTests.cs +++ b/e2e/Azaion.E2E/Tests/SecurityTests.cs @@ -206,11 +206,15 @@ public sealed class SecurityTests // Act using var setHw = await admin.PutAsync("/users/hardware/set", new { Email = "x@y.com", Hardware = "any" }); + // /resources/check no longer exists. POST /resources/{dataFolder?} (file upload, multipart-only) + // matches the same path with dataFolder="check", so a JSON POST is rejected at the binding + // layer with 415 instead of 404. Either is an acceptable "endpoint is gone" signal — what + // matters for AC-2 is that no hardware-binding side-effect can be triggered. using var checkHw = await admin.PostAsync("/resources/check", new { Hardware = "any" }); // Assert setHw.StatusCode.Should().Be(HttpStatusCode.NotFound); - checkHw.StatusCode.Should().Be(HttpStatusCode.NotFound); + checkHw.StatusCode.Should().BeOneOf(HttpStatusCode.NotFound, HttpStatusCode.UnsupportedMediaType); } [Fact]