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,46 @@
|
||||
using System.Text.Json;
|
||||
using NATS.Server.Events;
|
||||
|
||||
namespace NATS.Server.Tests.Events;
|
||||
|
||||
public class EventServerInfoCapabilityParityBatch1Tests
|
||||
{
|
||||
[Fact]
|
||||
public void ServerCapability_flags_match_expected_values()
|
||||
{
|
||||
((ulong)ServerCapability.JetStreamEnabled).ShouldBe(1UL << 0);
|
||||
((ulong)ServerCapability.BinaryStreamSnapshot).ShouldBe(1UL << 1);
|
||||
((ulong)ServerCapability.AccountNRG).ShouldBe(1UL << 2);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EventServerInfo_capability_methods_set_and_read_flags()
|
||||
{
|
||||
var info = new EventServerInfo();
|
||||
|
||||
info.SetJetStreamEnabled();
|
||||
info.SetBinaryStreamSnapshot();
|
||||
info.SetAccountNRG();
|
||||
|
||||
info.JetStream.ShouldBeTrue();
|
||||
info.JetStreamEnabled().ShouldBeTrue();
|
||||
info.BinaryStreamSnapshot().ShouldBeTrue();
|
||||
info.AccountNRG().ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ServerID_serializes_with_name_host_id_fields()
|
||||
{
|
||||
var payload = new ServerID
|
||||
{
|
||||
Name = "srv-a",
|
||||
Host = "127.0.0.1",
|
||||
Id = "N1",
|
||||
};
|
||||
|
||||
var json = JsonSerializer.Serialize(payload);
|
||||
json.ShouldContain("\"name\":\"srv-a\"");
|
||||
json.ShouldContain("\"host\":\"127.0.0.1\"");
|
||||
json.ShouldContain("\"id\":\"N1\"");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user