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
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
using System.Text.Json;
|
||||
using NATS.Server.Monitoring;
|
||||
|
||||
namespace NATS.Server.Tests.Monitoring;
|
||||
|
||||
public class MonitoringHealthAndSortParityBatch1Tests
|
||||
{
|
||||
[Fact]
|
||||
public void SortOpt_IsValid_matches_defined_values()
|
||||
{
|
||||
foreach (var value in Enum.GetValues<SortOpt>())
|
||||
value.IsValid().ShouldBeTrue();
|
||||
|
||||
((SortOpt)999).IsValid().ShouldBeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void HealthStatus_ok_serializes_with_go_shape_fields()
|
||||
{
|
||||
var json = JsonSerializer.Serialize(HealthStatus.Ok());
|
||||
|
||||
json.ShouldContain("\"status\":\"ok\"");
|
||||
json.ShouldContain("\"status_code\":200");
|
||||
json.ShouldContain("\"errors\":[]");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void HealthzError_serializes_enum_as_string()
|
||||
{
|
||||
var json = JsonSerializer.Serialize(new HealthzError
|
||||
{
|
||||
Type = HealthzErrorType.JetStream,
|
||||
Error = "jetstream unavailable",
|
||||
});
|
||||
|
||||
json.ShouldContain("\"type\":\"JetStream\"");
|
||||
json.ShouldContain("\"error\":\"jetstream unavailable\"");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user