test(batch25): port gateway connect and tls baseline tests
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user