test(batch25): port gateway connect and tls baseline tests

This commit is contained in:
Joseph Doherty
2026-03-01 02:19:11 -05:00
parent e9be0751ec
commit a0763cd248
10 changed files with 593 additions and 0 deletions

View File

@@ -3299,4 +3299,62 @@ public sealed class MonitoringHandlerTests
server.NumClients().ShouldBeGreaterThanOrEqualTo(0);
}
[Fact] // T:2127
public void MonitorGatewayURLsUpdated_ShouldSucceed()
{
var (server, err) = NatsServer.NewServer(new ServerOptions
{
Gateway = new GatewayOpts
{
Name = "A",
Port = 5222,
Gateways =
[
new RemoteGatewayOpts
{
Name = "B",
Urls = [new Uri("nats://127.0.0.1:6222")],
},
],
},
});
err.ShouldBeNull();
server.ShouldNotBeNull();
try
{
server!.AddGatewayURL("B", "nats://127.0.0.1:6222");
var remote = server.GetRemoteGateway("B");
remote.ShouldNotBeNull();
remote!.GetUrlsAsStrings().Any(url => url.StartsWith("nats://127.0.0.1:6222", StringComparison.Ordinal))
.ShouldBeTrue();
}
finally
{
server!.Shutdown();
}
}
[Fact] // T:2131
public void MonitorGatewayzAccounts_ShouldSucceed()
{
var (server, err) = NatsServer.NewServer(new ServerOptions
{
Gateway = new GatewayOpts { Name = "A", Port = 5222 },
});
err.ShouldBeNull();
server.ShouldNotBeNull();
try
{
server!.GetGatewayName().ShouldBe("A");
server.NumOutboundGateways().ShouldBe(0);
server.NumInboundGateways().ShouldBe(0);
}
finally
{
server!.Shutdown();
}
}
}