using System.Text.Json;

namespace NATS.Server.Tests;

public class ConnzParityFieldTests
{
    [Fact]
    public async Task Connz_includes_identity_tls_and_proxy_parity_fields()
    {
        await using var fx = await MonitoringParityFixture.StartAsync();
        await fx.ConnectClientAsync("u", "orders.created");

        var connz = fx.GetConnz("?subs=detail");
        connz.Conns.ShouldNotBeEmpty();

        var json = JsonSerializer.Serialize(connz);
        json.ShouldContain("tls_peer_cert_subject");
        json.ShouldContain("jwt_issuer_key");
        json.ShouldContain("proxy");
    }
}
