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.
39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
using NATS.Server.JetStream;
|
|
using NATS.Server.JetStream.Models;
|
|
|
|
namespace NATS.Server.JetStream.Tests;
|
|
|
|
public class JetStreamMirrorSourceParityTests
|
|
{
|
|
[Fact]
|
|
public async Task Source_subject_transform_and_cross_account_mapping_copy_expected_messages_only()
|
|
{
|
|
var manager = new StreamManager();
|
|
manager.CreateOrUpdate(new StreamConfig
|
|
{
|
|
Name = "SRC",
|
|
Subjects = ["orders.*"],
|
|
});
|
|
|
|
manager.CreateOrUpdate(new StreamConfig
|
|
{
|
|
Name = "AGG",
|
|
Subjects = ["agg.*"],
|
|
Sources =
|
|
[
|
|
new StreamSourceConfig
|
|
{
|
|
Name = "SRC",
|
|
SubjectTransformPrefix = "agg.",
|
|
SourceAccount = "A",
|
|
},
|
|
],
|
|
});
|
|
|
|
manager.Capture("orders.created", "1"u8.ToArray());
|
|
manager.TryGet("AGG", out var aggregate).ShouldBeTrue();
|
|
var messages = await aggregate.Store.ListAsync(default);
|
|
messages.ShouldContain(m => m.Subject == "agg.orders.created");
|
|
}
|
|
}
|