mirror of
https://github.com/google/nomulus
synced 2026-09-19 22:44:26 +00:00
Require currency specific billingAccountId for registrar
For the currency specific billing account ids to work properly, any REAL registrar that is allowed to register domains in a certain TLD must have a billing account id for the currency of that TLD. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=155864711
This commit is contained in:
@@ -212,6 +212,31 @@ public class UpdateRegistrarCommandTest extends CommandTestCase<UpdateRegistrarC
|
||||
.containsExactly(CurrencyUnit.USD, "abc123", CurrencyUnit.JPY, "789xyz");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_billingAccountMap_doesNotContainEntryForTldAllowed() throws Exception {
|
||||
createTlds("foo");
|
||||
assertThat(loadByClientId("NewRegistrar").getBillingAccountMap()).isEmpty();
|
||||
thrown.expect(IllegalArgumentException.class, "USD");
|
||||
runCommand(
|
||||
"--billing_account_map=JPY=789xyz",
|
||||
"--allowed_tlds=foo",
|
||||
"--force",
|
||||
"--registrar_type=REAL",
|
||||
"NewRegistrar");
|
||||
}
|
||||
|
||||
public void testSuccess_billingAccountMap_onlyAppliesToRealRegistrar() throws Exception {
|
||||
createTlds("foo");
|
||||
assertThat(loadByClientId("NewRegistrar").getBillingAccountMap()).isEmpty();
|
||||
runCommand(
|
||||
"--billing_account_map=JPY=789xyz",
|
||||
"--allowed_tlds=foo",
|
||||
"--force",
|
||||
"NewRegistrar");
|
||||
assertThat(loadByClientId("NewRegistrar").getBillingAccountMap())
|
||||
.containsExactly(CurrencyUnit.JPY, "789xyz");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_changeBillingMethodToBraintreeWhenBalanceIsZero() throws Exception {
|
||||
createTlds("xn--q9jyb4c");
|
||||
|
||||
Reference in New Issue
Block a user