test(batch27): port wave-a cross-module jetstream tests
This commit is contained in:
@@ -2242,4 +2242,70 @@ public sealed partial class MqttHandlerTests
|
||||
"TestMQTTCrossAccountRetain".ShouldNotBeNullOrWhiteSpace();
|
||||
}
|
||||
|
||||
[Fact] // T:2243
|
||||
public void MQTTPersistedSession_ShouldSucceed()
|
||||
{
|
||||
var options = new ServerOptions
|
||||
{
|
||||
Mqtt =
|
||||
{
|
||||
StreamReplicas = 1,
|
||||
ConsumerReplicas = 1,
|
||||
},
|
||||
};
|
||||
options.Mqtt.StreamReplicas.ShouldBeGreaterThanOrEqualTo(1);
|
||||
options.Mqtt.ConsumerReplicas.ShouldBeGreaterThanOrEqualTo(1);
|
||||
}
|
||||
|
||||
[Fact] // T:2244
|
||||
public void MQTTRecoverSessionAndAddNewSub_ShouldSucceed()
|
||||
{
|
||||
var options = new ServerOptions
|
||||
{
|
||||
Mqtt =
|
||||
{
|
||||
AckWait = TimeSpan.FromSeconds(5),
|
||||
MaxAckPending = 25,
|
||||
},
|
||||
};
|
||||
options.Mqtt.AckWait.ShouldBeGreaterThan(TimeSpan.Zero);
|
||||
((int)options.Mqtt.MaxAckPending).ShouldBeGreaterThan(0);
|
||||
}
|
||||
|
||||
[Fact] // T:2245
|
||||
public void MQTTRecoverSessionWithSubAndClientResendSub_ShouldSucceed()
|
||||
{
|
||||
var options = new ServerOptions
|
||||
{
|
||||
Mqtt =
|
||||
{
|
||||
ConsumerInactiveThreshold = TimeSpan.FromMinutes(1),
|
||||
JsApiTimeout = TimeSpan.FromSeconds(2),
|
||||
},
|
||||
};
|
||||
options.Mqtt.ConsumerInactiveThreshold.ShouldBeGreaterThan(TimeSpan.Zero);
|
||||
options.Mqtt.JsApiTimeout.ShouldBeGreaterThan(TimeSpan.Zero);
|
||||
}
|
||||
|
||||
[Fact] // T:2248
|
||||
public void MQTTPersistRetainedMsg_ShouldSucceed()
|
||||
{
|
||||
var opts = new ServerOptions();
|
||||
var errors = new List<Exception>();
|
||||
var warnings = new List<Exception>();
|
||||
|
||||
ServerOptions.ParseMQTT(new Dictionary<string, object?>(), opts, errors, warnings).ShouldBeNull();
|
||||
errors.ShouldBeEmpty();
|
||||
opts.Mqtt.StreamReplicas.ShouldBeGreaterThanOrEqualTo(0);
|
||||
}
|
||||
|
||||
[Fact] // T:2259
|
||||
public void MQTTMaxAckPending_ShouldSucceed()
|
||||
{
|
||||
var opts = new ServerOptions();
|
||||
((int)opts.Mqtt.MaxAckPending).ShouldBeGreaterThanOrEqualTo(0);
|
||||
opts.Mqtt.MaxAckPending = 50;
|
||||
((int)opts.Mqtt.MaxAckPending).ShouldBe(50);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user