test(data): verify legacy metadata guard before mutation

This commit is contained in:
aj committed 2026-10-11 16:51:56 -04:00
1 parent 914c197181
commit 5f1eeb00eb
1 file changed
+4 -3
+4 -3
View File
@@ -215,15 +215,16 @@ public class RemoteNestRepositoryTests
}
[Fact]
public async Task UpdateMetadataAsync_RefusesUntilGuardedHistoryIsAvailable()
public async Task UpdateMetadataAsync_RefusesLegacyServerBeforeMutation()
{
var id = Guid.NewGuid();
var record = SampleRecord(id);
var handler = new StubHandler(_ => StubHandler.Json(record));
record.Revision = 1;
var handler = new StubHandler(_ => new HttpResponseMessage(HttpStatusCode.NotFound));
using var repo = new RemoteNestRepository(new HttpClient(handler), "http://s");
await Assert.ThrowsAsync<IOException>(() => repo.UpdateMetadataAsync(id, record));
Assert.Empty(handler.Requests); // Metadata history is delivered in S3.
Assert.Equal(HttpMethod.Get, Assert.Single(handler.Requests).Method);
}
[Fact]