test(batch7): implement t3 cross-cutting mapped tests

This commit is contained in:
Joseph Doherty
2026-02-28 11:32:36 -05:00
parent 007122a659
commit efc0d642b1
4 changed files with 144 additions and 0 deletions

View File

@@ -1121,6 +1121,43 @@ public sealed class JwtProcessorTests
"TestJWTAccountNATSResolverWrongCreds".ShouldNotBeNullOrWhiteSpace();
}
[Fact] // T:1893
public void DefaultSentinelUser_ShouldSucceed()
{
var options = new ServerOptions();
var errors = new List<Exception>();
var warnings = new List<Exception>();
options.ProcessConfigFileLine("default_sentinel", "bearer.default.sentinel", errors, warnings);
errors.ShouldBeEmpty();
warnings.ShouldBeEmpty();
options.DefaultSentinel.ShouldBe("bearer.default.sentinel");
options.ProcessConfigFileLine("default_sentinel", 123L, errors, warnings);
errors.Count.ShouldBe(1);
errors[0].Message.ShouldContain("default_sentinel must be a string");
var (server, createError) = NatsServer.NewServer(new ServerOptions
{
NoLog = true,
NoSigs = true,
});
createError.ShouldBeNull();
server.ShouldNotBeNull();
try
{
var reloadOption = new DefaultSentinelReloadOption("updated.sentinel");
reloadOption.IsAuthChange().ShouldBeFalse();
Should.NotThrow(() => reloadOption.Apply(server!));
}
finally
{
server!.Shutdown();
}
}
[Fact] // T:1895
public void JWTJetStreamClientsExcludedForMaxConnsUpdate_ShouldSucceed()
{