test(batch18): port behavioral batch-18 tests

This commit is contained in:
Joseph Doherty
2026-02-28 19:29:19 -05:00
parent 108d06dd57
commit eb05308b5a
4 changed files with 66 additions and 0 deletions

View File

@@ -13,6 +13,31 @@ namespace ZB.MOM.NatsNet.Server.Tests.ImplBacklog;
public sealed class MonitoringHandlerTests
{
[Fact] // T:2111
public void MonitorHandler_ShouldSucceed()
{
var opts = new ServerOptions
{
HttpHost = "127.0.0.1",
HttpPort = -1,
};
var (server, error) = NatsServer.NewServer(opts);
error.ShouldBeNull();
server.ShouldNotBeNull();
server!.StartMonitoring().ShouldBeNull();
server.HTTPHandler().ShouldNotBeNull();
var listenerField = typeof(NatsServer).GetField("_http", BindingFlags.Instance | BindingFlags.NonPublic);
listenerField.ShouldNotBeNull();
var listener = listenerField!.GetValue(server).ShouldBeOfType<TcpListener>();
listener.Stop();
var transitioned = SpinWait.SpinUntil(() => server.HTTPHandler() == null, TimeSpan.FromSeconds(5));
transitioned.ShouldBeTrue();
server.HTTPHandler().ShouldBeNull();
}
[Fact]
public void GetMonitoringTLSConfig_WithServerTlsConfig_DisablesClientCertificateRequirementOnClone()
{