Move 225 JetStream-related test files from NATS.Server.Tests into a dedicated NATS.Server.JetStream.Tests project. This includes root-level JetStream*.cs files, storage test files (FileStore, MemStore, StreamStoreContract), and the full JetStream/ subfolder tree (Api, Cluster, Consumers, MirrorSource, Snapshots, Storage, Streams). Updated all namespaces, added InternalsVisibleTo, registered in the solution file, and added the JETSTREAM_INTEGRATION_MATRIX define.
20 lines
658 B
C#
20 lines
658 B
C#
using NATS.Server.TestUtilities;
|
|
|
|
namespace NATS.Server.JetStream.Tests;
|
|
|
|
public class JetStreamSnapshotRestoreApiTests
|
|
{
|
|
[Fact]
|
|
public async Task Snapshot_then_restore_reconstructs_messages()
|
|
{
|
|
await using var fx = await JetStreamApiFixture.StartWithStreamAsync("ORDERS", "orders.*");
|
|
_ = await fx.PublishAndGetAckAsync("orders.created", "1");
|
|
|
|
var snap = await fx.RequestLocalAsync("$JS.API.STREAM.SNAPSHOT.ORDERS", "{}");
|
|
snap.Snapshot.ShouldNotBeNull();
|
|
|
|
var restore = await fx.RequestLocalAsync("$JS.API.STREAM.RESTORE.ORDERS", snap.Snapshot!.Payload);
|
|
restore.Success.ShouldBeTrue();
|
|
}
|
|
}
|