mirror of
https://github.com/azaion/admin.git
synced 2026-06-21 08:11:08 +00:00
[AZ-197] Loosen Hardware_endpoints_are_removed test for /resources/check
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 <cursoragent@cursor.com>
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user