using Microsoft.Extensions.Logging.Abstractions;
using NATS.Server.Configuration;
using NATS.Server.Gateways;

namespace NATS.Server.Tests;

public class JetStreamCrossClusterRuntimeParityTests
{
    [Fact]
    public async Task Jetstream_cross_cluster_messages_are_forward_counted()
    {
        var manager = new GatewayManager(
            new GatewayOptions { Host = "127.0.0.1", Port = 0, Name = "A" },
            new ServerStats(),
            "S1",
            _ => { },
            _ => { },
            NullLogger<GatewayManager>.Instance);

        await manager.ForwardJetStreamClusterMessageAsync(
            new GatewayMessage("$JS.CLUSTER.REPL", null, "x"u8.ToArray()),
            default);

        manager.ForwardedJetStreamClusterMessages.ShouldBe(1);
    }
}
