fix: gate mqtt retries until startup cleanup
This commit is contained in:
@@ -14,8 +14,8 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
class MqttCommandAckConfigUnitTest {
|
||||
|
||||
@Test
|
||||
void commandAckMaxRetryCountIsThree() throws Exception {
|
||||
Integer maxRetryCount = null;
|
||||
void commandAckRetrySettingsMatchRuntimeRequirements() throws Exception {
|
||||
Map<?, ?> commandAckConfig = null;
|
||||
Yaml yaml = new Yaml();
|
||||
try (InputStream inputStream = new ClassPathResource("application.yml").getInputStream()) {
|
||||
for (Object document : yaml.loadAll(inputStream)) {
|
||||
@@ -27,17 +27,16 @@ class MqttCommandAckConfigUnitTest {
|
||||
continue;
|
||||
}
|
||||
Object commandAck = mqttConfig.get("command-ack");
|
||||
if (!(commandAck instanceof Map<?, ?> commandAckConfig)) {
|
||||
continue;
|
||||
}
|
||||
Object value = commandAckConfig.get("max-retry-count");
|
||||
if (value instanceof Number number) {
|
||||
maxRetryCount = number.intValue();
|
||||
if (commandAck instanceof Map<?, ?> config) {
|
||||
commandAckConfig = config;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
assertThat(maxRetryCount).isEqualTo(3);
|
||||
assertThat(commandAckConfig).isNotNull();
|
||||
assertThat(commandAckConfig.get("retry-interval-ms")).isEqualTo(10000);
|
||||
assertThat(commandAckConfig.get("scan-interval-ms")).isEqualTo(5000);
|
||||
assertThat(commandAckConfig.get("max-retry-count")).isEqualTo(3);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user