Files
natsdotnet/tests/NATS.Server.Tests/Configuration/ConfigWarningsParityBatch1Tests.cs
Joseph Doherty c30e67a69d Fix E2E test gaps and add comprehensive E2E + parity test suites
- Fix pull consumer fetch: send original stream subject in HMSG (not inbox)
  so NATS client distinguishes data messages from control messages
- Fix MaxAge expiry: add background timer in StreamManager for periodic pruning
- Fix JetStream wire format: Go-compatible anonymous objects with string enums,
  proper offset-based pagination for stream/consumer list APIs
- Add 42 E2E black-box tests (core messaging, auth, TLS, accounts, JetStream)
- Add ~1000 parity tests across all subsystems (gaps closure)
- Update gap inventory docs to reflect implementation status
2026-03-12 14:09:23 -04:00

32 lines
1.0 KiB
C#

using NATS.Server.Configuration;
namespace NATS.Server.Tests.Configuration;
public class ConfigWarningsParityBatch1Tests
{
[Fact]
public void Config_warning_types_expose_message_and_source()
{
var warning = new ConfigWarningException("warn", "conf:1:2");
var unknown = new UnknownConfigFieldWarning("mystery_field", "conf:3:1");
warning.Message.ShouldBe("warn");
warning.SourceLocation.ShouldBe("conf:1:2");
unknown.Field.ShouldBe("mystery_field");
unknown.SourceLocation.ShouldBe("conf:3:1");
unknown.Message.ShouldContain("unknown field");
}
[Fact]
public void ProcessConfig_collects_unknown_field_warnings_when_errors_are_present()
{
var ex = Should.Throw<ConfigProcessorException>(() => ConfigProcessor.ProcessConfig("""
max_sub_tokens: 300
totally_unknown_field: 1
"""));
ex.Errors.ShouldNotBeEmpty();
ex.Warnings.ShouldContain(w => w.Contains("unknown field totally_unknown_field", StringComparison.Ordinal));
}
}