mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-22 07:58:07 +01:00
Control enforcement of unsealed sender rate limits via dynamic configuration.
This commit is contained in:
committed by
Jon Chambers
parent
6332552346
commit
5f49772ca6
@@ -107,6 +107,28 @@ public class DynamicConfigurationTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParseMessageRateConfiguration() throws JsonProcessingException {
|
||||
{
|
||||
final String emptyConfigYaml = "test: true";
|
||||
final DynamicConfiguration emptyConfig = DynamicConfigurationManager.OBJECT_MAPPER
|
||||
.readValue(emptyConfigYaml, DynamicConfiguration.class);
|
||||
|
||||
assertFalse(emptyConfig.getMessageRateConfiguration().isEnforceUnsealedSenderRateLimit());
|
||||
}
|
||||
|
||||
{
|
||||
final String messageRateConfigYaml =
|
||||
"messageRate:\n" +
|
||||
" enforceUnsealedSenderRateLimit: true";
|
||||
|
||||
final DynamicConfiguration emptyConfig = DynamicConfigurationManager.OBJECT_MAPPER
|
||||
.readValue(messageRateConfigYaml, DynamicConfiguration.class);
|
||||
|
||||
assertTrue(emptyConfig.getMessageRateConfiguration().isEnforceUnsealedSenderRateLimit());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParseFeatureFlags() throws JsonProcessingException {
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user