mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-23 07:58:01 +01:00
Enable Payments Beta for more country codes
This commit is contained in:
committed by
Jon Chambers
parent
1e1394560d
commit
da5c0ae4b6
@@ -272,20 +272,20 @@ class DynamicConfigurationTest {
|
||||
final DynamicConfiguration emptyConfig =
|
||||
DynamicConfigurationManager.parseConfiguration(emptyConfigYaml, DynamicConfiguration.class).orElseThrow();
|
||||
|
||||
assertTrue(emptyConfig.getPaymentsConfiguration().getAllowedCountryCodes().isEmpty());
|
||||
assertTrue(emptyConfig.getPaymentsConfiguration().getDisallowedCountryCodes().isEmpty());
|
||||
}
|
||||
|
||||
{
|
||||
final String paymentsConfigYaml =
|
||||
"payments:\n"
|
||||
+ " allowedCountryCodes:\n"
|
||||
+ " disallowedCountryCodes:\n"
|
||||
+ " - 44";
|
||||
|
||||
final DynamicPaymentsConfiguration config =
|
||||
DynamicConfigurationManager.parseConfiguration(paymentsConfigYaml, DynamicConfiguration.class).orElseThrow()
|
||||
.getPaymentsConfiguration();
|
||||
|
||||
assertEquals(Set.of("44"), config.getAllowedCountryCodes());
|
||||
assertEquals(Set.of("44"), config.getDisallowedCountryCodes());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ class ProfileControllerTest {
|
||||
|
||||
when(dynamicConfigurationManager.getConfiguration()).thenReturn(dynamicConfiguration);
|
||||
when(dynamicConfiguration.getPaymentsConfiguration()).thenReturn(dynamicPaymentsConfiguration);
|
||||
when(dynamicPaymentsConfiguration.getAllowedCountryCodes()).thenReturn(Collections.emptySet());
|
||||
when(dynamicPaymentsConfiguration.getDisallowedCountryCodes()).thenReturn(Collections.emptySet());
|
||||
|
||||
when(rateLimiters.getProfileLimiter()).thenReturn(rateLimiter);
|
||||
when(rateLimiters.getUsernameLookupLimiter()).thenReturn(usernameRateLimiter);
|
||||
@@ -511,9 +511,6 @@ class ProfileControllerTest {
|
||||
|
||||
@Test
|
||||
void testSetProfilePaymentAddress() throws InvalidInputException {
|
||||
when(dynamicPaymentsConfiguration.getAllowedCountryCodes())
|
||||
.thenReturn(Set.of(Util.getCountryCode(AuthHelper.VALID_NUMBER_TWO)));
|
||||
|
||||
ProfileKeyCommitment commitment = new ProfileKey(new byte[32]).getCommitment(AuthHelper.VALID_UUID);
|
||||
|
||||
clearInvocations(AuthHelper.VALID_ACCOUNT_TWO);
|
||||
@@ -552,6 +549,9 @@ class ProfileControllerTest {
|
||||
|
||||
@Test
|
||||
void testSetProfilePaymentAddressCountryNotAllowed() throws InvalidInputException {
|
||||
when(dynamicPaymentsConfiguration.getDisallowedCountryCodes())
|
||||
.thenReturn(Set.of(Util.getCountryCode(AuthHelper.VALID_NUMBER_TWO)));
|
||||
|
||||
ProfileKeyCommitment commitment = new ProfileKey(new byte[32]).getCommitment(AuthHelper.VALID_UUID);
|
||||
|
||||
clearInvocations(AuthHelper.VALID_ACCOUNT_TWO);
|
||||
@@ -600,9 +600,6 @@ class ProfileControllerTest {
|
||||
|
||||
@Test
|
||||
void testSetProfileUpdatesAccountCurrentVersion() throws InvalidInputException {
|
||||
when(dynamicPaymentsConfiguration.getAllowedCountryCodes())
|
||||
.thenReturn(Set.of(Util.getCountryCode(AuthHelper.VALID_NUMBER_TWO)));
|
||||
|
||||
ProfileKeyCommitment commitment = new ProfileKey(new byte[32]).getCommitment(AuthHelper.VALID_UUID_TWO);
|
||||
|
||||
clearInvocations(AuthHelper.VALID_ACCOUNT_TWO);
|
||||
|
||||
Reference in New Issue
Block a user