test(batch56): port 66 reload and auth integration tests

Port config hot-reload (44 tests), opts (1 test), account isolation
(5 tests), auth callout (5 tests), and JWT validation (11 tests) from
Go reload_test.go, opts_test.go, accounts_test.go, auth_callout_test.go,
and jwt_test.go as behavioral blackbox integration tests against the
.NET NatsServer using ReloadOptions() and the public NATS client API.
This commit is contained in:
Joseph Doherty
2026-03-01 12:21:44 -05:00
parent 41ea272c8a
commit 96ca90672f
10 changed files with 5215 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
// Copyright 2012-2026 The NATS Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using Xunit.Abstractions;
namespace ZB.MOM.NatsNet.Server.IntegrationTests;
/// <summary>
/// Abstract base class for all integration tests.
/// Skips the entire test class if the server cannot boot (i.e., the .NET server
/// runtime is not yet complete). Individual test classes inherit from this class.
/// </summary>
[Trait("Category", "Integration")]
public abstract class IntegrationTestBase : IDisposable
{
// =========================================================================
// Constructor — Skip guard
// =========================================================================
/// <summary>
/// Initializes the test base and verifies that the server can boot.
/// If <see cref="Helpers.TestServerHelper.CanBoot()"/> returns false the test
/// is skipped via <c>Xunit.SkippableFact</c>'s <c>Skip.If</c> mechanism.
/// </summary>
protected IntegrationTestBase(ITestOutputHelper output)
{
Output = output;
Skip.If(!Helpers.TestServerHelper.CanBoot(), "Server cannot boot — skipping integration tests.");
}
// =========================================================================
// Protected members
// =========================================================================
/// <summary>xUnit output helper, available to derived test classes.</summary>
protected ITestOutputHelper Output { get; }
// =========================================================================
// IDisposable
// =========================================================================
/// <summary>
/// Override in subclasses to perform per-test cleanup (e.g., shut down servers,
/// delete temp dirs). The base implementation does nothing.
/// </summary>
public virtual void Dispose() { }
}