feat: execute full-repo remaining parity closure plan

This commit is contained in:
Joseph Doherty
2026-02-23 13:08:52 -05:00
parent cbe1fa6121
commit 2b64d762f6
75 changed files with 2325 additions and 121 deletions

View File

@@ -0,0 +1,40 @@
using NATS.Server.JetStream.MirrorSource;
using NATS.Server.JetStream.Models;
using NATS.Server.JetStream.Storage;
namespace NATS.Server.Tests;
public class JetStreamMirrorSourceRuntimeParityTests
{
[Fact]
public async Task Mirror_source_runtime_tracks_sync_state_and_subject_mapping()
{
var mirrorTarget = new MemStore();
var sourceTarget = new MemStore();
var mirror = new MirrorCoordinator(mirrorTarget);
var source = new SourceCoordinator(sourceTarget, new StreamSourceConfig
{
Name = "SRC",
SubjectTransformPrefix = "agg.",
SourceAccount = "A",
});
var message = new StoredMessage
{
Sequence = 10,
Subject = "orders.created",
Payload = "ok"u8.ToArray(),
TimestampUtc = DateTime.UtcNow,
};
await mirror.OnOriginAppendAsync(message, default);
await source.OnOriginAppendAsync(message, default);
mirror.LastOriginSequence.ShouldBe((ulong)10);
source.LastOriginSequence.ShouldBe((ulong)10);
var sourced = await sourceTarget.LoadAsync(1, default);
sourced.ShouldNotBeNull();
sourced.Subject.ShouldBe("agg.orders.created");
}
}