Add MessagePersisterServiceCommand

This commit is contained in:
Chris Eager
2023-05-10 16:49:56 -05:00
committed by Chris Eager
parent 859fbe9ab1
commit 3e53884979
8 changed files with 152 additions and 30 deletions

View File

@@ -360,33 +360,37 @@ class DynamicConfigurationTest {
final DynamicConfiguration emptyConfig =
DynamicConfigurationManager.parseConfiguration(emptyConfigYaml, DynamicConfiguration.class).orElseThrow();
assertTrue(emptyConfig.getMessagePersisterConfiguration().isPersistenceEnabled());
assertTrue(emptyConfig.getMessagePersisterConfiguration().isServerPersistenceEnabled());
assertFalse(emptyConfig.getMessagePersisterConfiguration().isDedicatedProcessEnabled());
}
{
final String messagePersisterEnabledYaml = REQUIRED_CONFIG.concat("""
messagePersister:
persistenceEnabled: true
serverPersistenceEnabled: true
dedicatedProcessEnabled: true
""");
final DynamicConfiguration config =
DynamicConfigurationManager.parseConfiguration(messagePersisterEnabledYaml, DynamicConfiguration.class)
.orElseThrow();
assertTrue(config.getMessagePersisterConfiguration().isPersistenceEnabled());
assertTrue(config.getMessagePersisterConfiguration().isServerPersistenceEnabled());
assertTrue(config.getMessagePersisterConfiguration().isDedicatedProcessEnabled());
}
{
final String messagePersisterDisabledYaml = REQUIRED_CONFIG.concat("""
messagePersister:
persistenceEnabled: false
serverPersistenceEnabled: false
""");
final DynamicConfiguration config =
DynamicConfigurationManager.parseConfiguration(messagePersisterDisabledYaml, DynamicConfiguration.class)
.orElseThrow();
assertFalse(config.getMessagePersisterConfiguration().isPersistenceEnabled());
assertFalse(config.getMessagePersisterConfiguration().isServerPersistenceEnabled());
assertFalse(config.getMessagePersisterConfiguration().isDedicatedProcessEnabled());
}
}