Switch to a disallowed prefix model instead of a disallowed country code model

This commit is contained in:
Jon Chambers
2021-11-11 17:41:38 -05:00
committed by Jon Chambers
parent 7033a0f68f
commit 2015ba77ca
4 changed files with 18 additions and 21 deletions

View File

@@ -272,20 +272,20 @@ class DynamicConfigurationTest {
final DynamicConfiguration emptyConfig =
DynamicConfigurationManager.parseConfiguration(emptyConfigYaml, DynamicConfiguration.class).orElseThrow();
assertTrue(emptyConfig.getPaymentsConfiguration().getDisallowedCountryCodes().isEmpty());
assertTrue(emptyConfig.getPaymentsConfiguration().getDisallowedPrefixes().isEmpty());
}
{
final String paymentsConfigYaml =
"payments:\n"
+ " disallowedCountryCodes:\n"
+ " - 44";
+ " disallowedPrefixes:\n"
+ " - +44";
final DynamicPaymentsConfiguration config =
DynamicConfigurationManager.parseConfiguration(paymentsConfigYaml, DynamicConfiguration.class).orElseThrow()
.getPaymentsConfiguration();
assertEquals(Set.of("44"), config.getDisallowedCountryCodes());
assertEquals(List.of("+44"), config.getDisallowedPrefixes());
}
}