mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-22 03:08:01 +01:00
Add a dynamically-configured list of allowed country codes for payments.
This commit is contained in:
committed by
Jon Chambers
parent
c3c46f2f74
commit
5965f0fd22
@@ -252,4 +252,28 @@ class DynamicConfigurationTest {
|
||||
assertEquals(List.of("2135551212", "2135551313"), config.getNumbers());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParsePaymentsConfiguration() throws JsonProcessingException {
|
||||
{
|
||||
final String emptyConfigYaml = "test: true";
|
||||
final DynamicConfiguration emptyConfig = DynamicConfigurationManager.OBJECT_MAPPER
|
||||
.readValue(emptyConfigYaml, DynamicConfiguration.class);
|
||||
|
||||
assertTrue(emptyConfig.getPaymentsConfiguration().getAllowedCountryCodes().isEmpty());
|
||||
}
|
||||
|
||||
{
|
||||
final String paymentsConfigYaml =
|
||||
"payments:\n"
|
||||
+ " allowedCountryCodes:\n"
|
||||
+ " - 44";
|
||||
|
||||
final DynamicPaymentsConfiguration config = DynamicConfigurationManager.OBJECT_MAPPER
|
||||
.readValue(paymentsConfigYaml, DynamicConfiguration.class)
|
||||
.getPaymentsConfiguration();
|
||||
|
||||
assertEquals(Set.of("44"), config.getAllowedCountryCodes());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user