Add a dynamically-configured list of allowed country codes for payments.

This commit is contained in:
Jon Chambers authored and Jon Chambers committed 2021-03-26 12:21:11 -04:00
1 parent c3c46f2f74
commit 5965f0fd22
3 files changed
+52

No files matched your search

@@ -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());
}
}
}