mirror of
https://github.com/google/nomulus
synced 2026-02-09 06:20:29 +00:00
Remove all uses of the billingIdentifier field (#1608)
* Remove all uses of the billingIdentifier field * Add @ignore flag * Add tag
This commit is contained in:
@@ -204,7 +204,6 @@ public class SyncRegistrarsSheetTest {
|
||||
assertThat(row).containsEntry("registrarName", "AAA Registrar Inc.");
|
||||
assertThat(row).containsEntry("state", "SUSPENDED");
|
||||
assertThat(row).containsEntry("ianaIdentifier", "8");
|
||||
assertThat(row).containsEntry("billingIdentifier", "");
|
||||
assertThat(row)
|
||||
.containsEntry(
|
||||
"primaryContacts",
|
||||
@@ -300,7 +299,6 @@ public class SyncRegistrarsSheetTest {
|
||||
assertThat(row).containsEntry("registrarName", "Another Registrar LLC");
|
||||
assertThat(row).containsEntry("state", "ACTIVE");
|
||||
assertThat(row).containsEntry("ianaIdentifier", "1");
|
||||
assertThat(row).containsEntry("billingIdentifier", "");
|
||||
assertThat(row).containsEntry("primaryContacts", "");
|
||||
assertThat(row).containsEntry("techContacts", "");
|
||||
assertThat(row).containsEntry("marketingContacts", "");
|
||||
@@ -350,7 +348,6 @@ public class SyncRegistrarsSheetTest {
|
||||
assertThat(row).containsEntry("registrarName", "Some Registrar");
|
||||
assertThat(row).containsEntry("state", "ACTIVE");
|
||||
assertThat(row).containsEntry("ianaIdentifier", "8");
|
||||
assertThat(row).containsEntry("billingIdentifier", "");
|
||||
assertThat(row).containsEntry("primaryContacts", "");
|
||||
assertThat(row).containsEntry("techContacts", "");
|
||||
assertThat(row).containsEntry("marketingContacts", "");
|
||||
|
||||
@@ -121,7 +121,6 @@ class RegistrarTest extends EntityTestCase {
|
||||
.setIcannReferralEmail("foo@example.com")
|
||||
.setDriveFolderId("drive folder id")
|
||||
.setIanaIdentifier(8L)
|
||||
.setBillingIdentifier(5325L)
|
||||
.setBillingAccountMap(
|
||||
ImmutableMap.of(CurrencyUnit.USD, "abc123", CurrencyUnit.JPY, "789xyz"))
|
||||
.setPhonePasscode("01234")
|
||||
@@ -261,12 +260,11 @@ class RegistrarTest extends EntityTestCase {
|
||||
}
|
||||
|
||||
@TestOfyAndSql
|
||||
void testSuccess_clearingIanaAndBillingIds() {
|
||||
void testSuccess_clearingIanaId() {
|
||||
registrar
|
||||
.asBuilder()
|
||||
.setType(Type.TEST)
|
||||
.setIanaIdentifier(null)
|
||||
.setBillingIdentifier(null)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@@ -545,28 +545,6 @@ class CreateRegistrarCommandTest extends CommandTestCase<CreateRegistrarCommand>
|
||||
assertThat(registrar.get().getIanaIdentifier()).isEqualTo(12345);
|
||||
}
|
||||
|
||||
@TestOfyAndSql
|
||||
void testSuccess_billingId() throws Exception {
|
||||
runCommandForced(
|
||||
"--name=blobio",
|
||||
"--password=some_password",
|
||||
"--registrar_type=REAL",
|
||||
"--iana_id=8",
|
||||
"--billing_id=12345",
|
||||
"--passcode=01234",
|
||||
"--icann_referral_email=foo@bar.test",
|
||||
"--street=\"123 Fake St\"",
|
||||
"--city Fakington",
|
||||
"--state MA",
|
||||
"--zip 00351",
|
||||
"--cc US",
|
||||
"clientz");
|
||||
|
||||
Optional<Registrar> registrar = Registrar.loadByRegistrarId("clientz");
|
||||
assertThat(registrar).isPresent();
|
||||
assertThat(registrar.get().getBillingIdentifier()).isEqualTo(12345);
|
||||
}
|
||||
|
||||
@TestOfyAndSql
|
||||
void testSuccess_poNumber() throws Exception {
|
||||
runCommandForced(
|
||||
@@ -805,7 +783,6 @@ class CreateRegistrarCommandTest extends CommandTestCase<CreateRegistrarCommand>
|
||||
"--registrar_type=TEST",
|
||||
"--icann_referral_email=foo@bar.test",
|
||||
"--iana_id=null",
|
||||
"--billing_id=null",
|
||||
"--phone=null",
|
||||
"--fax=null",
|
||||
"--url=null",
|
||||
@@ -821,7 +798,6 @@ class CreateRegistrarCommandTest extends CommandTestCase<CreateRegistrarCommand>
|
||||
assertThat(registrarOptional).isPresent();
|
||||
Registrar registrar = registrarOptional.get();
|
||||
assertThat(registrar.getIanaIdentifier()).isNull();
|
||||
assertThat(registrar.getBillingIdentifier()).isNull();
|
||||
assertThat(registrar.getPhoneNumber()).isNull();
|
||||
assertThat(registrar.getFaxNumber()).isNull();
|
||||
assertThat(registrar.getUrl()).isNull();
|
||||
@@ -835,7 +811,6 @@ class CreateRegistrarCommandTest extends CommandTestCase<CreateRegistrarCommand>
|
||||
"--password=some_password",
|
||||
"--registrar_type=TEST",
|
||||
"--iana_id=",
|
||||
"--billing_id=",
|
||||
"--phone=",
|
||||
"--fax=",
|
||||
"--url=",
|
||||
@@ -852,7 +827,6 @@ class CreateRegistrarCommandTest extends CommandTestCase<CreateRegistrarCommand>
|
||||
assertThat(registrarOptional).isPresent();
|
||||
Registrar registrar = registrarOptional.get();
|
||||
assertThat(registrar.getIanaIdentifier()).isNull();
|
||||
assertThat(registrar.getBillingIdentifier()).isNull();
|
||||
assertThat(registrar.getPhoneNumber()).isNull();
|
||||
assertThat(registrar.getFaxNumber()).isNull();
|
||||
assertThat(registrar.getUrl()).isNull();
|
||||
@@ -1514,48 +1488,6 @@ class CreateRegistrarCommandTest extends CommandTestCase<CreateRegistrarCommand>
|
||||
"clientz"));
|
||||
}
|
||||
|
||||
@TestOfyAndSql
|
||||
void testFailure_negativeBillingId() {
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--name=blobio",
|
||||
"--password=some_password",
|
||||
"--registrar_type=REAL",
|
||||
"--iana_id=8",
|
||||
"--billing_id=-1",
|
||||
"--passcode=01234",
|
||||
"--icann_referral_email=foo@bar.test",
|
||||
"--street=\"123 Fake St\"",
|
||||
"--city Fakington",
|
||||
"--state MA",
|
||||
"--zip 00351",
|
||||
"--cc US",
|
||||
"clientz"));
|
||||
}
|
||||
|
||||
@TestOfyAndSql
|
||||
void testFailure_nonIntegerBillingId() {
|
||||
assertThrows(
|
||||
ParameterException.class,
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--name=blobio",
|
||||
"--password=some_password",
|
||||
"--registrar_type=REAL",
|
||||
"--iana_id=8",
|
||||
"--billing_id=ABC12345",
|
||||
"--passcode=01234",
|
||||
"--icann_referral_email=foo@bar.test",
|
||||
"--street=\"123 Fake St\"",
|
||||
"--city Fakington",
|
||||
"--state MA",
|
||||
"--zip 00351",
|
||||
"--cc US",
|
||||
"clientz"));
|
||||
}
|
||||
|
||||
@TestOfyAndSql
|
||||
void testFailure_missingPhonePasscode() {
|
||||
assertThrows(
|
||||
|
||||
@@ -33,6 +33,7 @@ import google.registry.model.registrar.Registrar;
|
||||
import google.registry.persistence.VKey;
|
||||
import google.registry.testing.AppEngineExtension;
|
||||
import java.util.Arrays;
|
||||
import java.util.Optional;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -58,7 +59,7 @@ public class MutatingCommandTest {
|
||||
void beforeEach() {
|
||||
registrar1 = persistNewRegistrar("Registrar1", "Registrar1", Registrar.Type.REAL, 1L);
|
||||
registrar2 = persistNewRegistrar("Registrar2", "Registrar2", Registrar.Type.REAL, 2L);
|
||||
newRegistrar1 = registrar1.asBuilder().setBillingIdentifier(42L).build();
|
||||
newRegistrar1 = registrar1.asBuilder().setPoNumber(Optional.of("23")).build();
|
||||
newRegistrar2 = registrar2.asBuilder().setBlockPremiumNames(true).build();
|
||||
|
||||
createTld("tld");
|
||||
@@ -94,18 +95,19 @@ public class MutatingCommandTest {
|
||||
};
|
||||
command.init();
|
||||
String changes = command.prompt();
|
||||
assertThat(changes).isEqualTo(
|
||||
"Update HostResource@2-ROID\n"
|
||||
+ "lastEppUpdateTime: null -> 2014-09-09T09:09:09.000Z\n"
|
||||
+ "\n"
|
||||
+ "Update HostResource@3-ROID\n"
|
||||
+ "currentSponsorClientId: TheRegistrar -> Registrar2\n"
|
||||
+ "\n"
|
||||
+ "Update Registrar@Registrar1\n"
|
||||
+ "billingIdentifier: null -> 42\n"
|
||||
+ "\n"
|
||||
+ "Update Registrar@Registrar2\n"
|
||||
+ "blockPremiumNames: false -> true\n");
|
||||
assertThat(changes)
|
||||
.isEqualTo(
|
||||
"Update HostResource@2-ROID\n"
|
||||
+ "lastEppUpdateTime: null -> 2014-09-09T09:09:09.000Z\n"
|
||||
+ "\n"
|
||||
+ "Update HostResource@3-ROID\n"
|
||||
+ "currentSponsorClientId: TheRegistrar -> Registrar2\n"
|
||||
+ "\n"
|
||||
+ "Update Registrar@Registrar1\n"
|
||||
+ "poNumber: null -> 23\n"
|
||||
+ "\n"
|
||||
+ "Update Registrar@Registrar2\n"
|
||||
+ "blockPremiumNames: false -> true\n");
|
||||
String results = command.execute();
|
||||
assertThat(results).isEqualTo("Updated 4 entities.\n");
|
||||
assertThat(loadByEntity(host1)).isEqualTo(newHost1);
|
||||
|
||||
@@ -347,13 +347,6 @@ class UpdateRegistrarCommandTest extends CommandTestCase<UpdateRegistrarCommand>
|
||||
assertThat(loadRegistrar("NewRegistrar").getIanaIdentifier()).isEqualTo(12345);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSuccess_billingId() throws Exception {
|
||||
assertThat(loadRegistrar("NewRegistrar").getBillingIdentifier()).isNull();
|
||||
runCommand("--billing_id=12345", "--force", "NewRegistrar");
|
||||
assertThat(loadRegistrar("NewRegistrar").getBillingIdentifier()).isEqualTo(12345);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSuccess_poNumber() throws Exception {
|
||||
assertThat(loadRegistrar("NewRegistrar").getPoNumber()).isEmpty();
|
||||
@@ -504,7 +497,7 @@ class UpdateRegistrarCommandTest extends CommandTestCase<UpdateRegistrarCommand>
|
||||
.setContactsRequireSyncing(true)
|
||||
.build());
|
||||
// Make some unrelated change where we don't specify the flags for the booleans.
|
||||
runCommandForced("--billing_id=12345", "NewRegistrar");
|
||||
runCommandForced("NewRegistrar");
|
||||
// Make sure that the boolean fields didn't get reset back to false.
|
||||
Registrar reloadedRegistrar = loadRegistrar("NewRegistrar");
|
||||
assertThat(reloadedRegistrar.getBlockPremiumNames()).isTrue();
|
||||
@@ -529,7 +522,6 @@ class UpdateRegistrarCommandTest extends CommandTestCase<UpdateRegistrarCommand>
|
||||
.asBuilder()
|
||||
.setType(Type.PDT) // for non-null IANA ID
|
||||
.setIanaIdentifier(9995L)
|
||||
.setBillingIdentifier(1L)
|
||||
.setPhoneNumber("+1.2125555555")
|
||||
.setFaxNumber("+1.2125555556")
|
||||
.setUrl("http://www.example.tld")
|
||||
@@ -537,7 +529,6 @@ class UpdateRegistrarCommandTest extends CommandTestCase<UpdateRegistrarCommand>
|
||||
.build());
|
||||
|
||||
assertThat(registrar.getIanaIdentifier()).isNotNull();
|
||||
assertThat(registrar.getBillingIdentifier()).isNotNull();
|
||||
assertThat(registrar.getPhoneNumber()).isNotNull();
|
||||
assertThat(registrar.getFaxNumber()).isNotNull();
|
||||
assertThat(registrar.getUrl()).isNotNull();
|
||||
@@ -546,7 +537,6 @@ class UpdateRegistrarCommandTest extends CommandTestCase<UpdateRegistrarCommand>
|
||||
runCommand(
|
||||
"--registrar_type=TEST", // necessary for null IANA ID
|
||||
"--iana_id=null",
|
||||
"--billing_id=null",
|
||||
"--phone=null",
|
||||
"--fax=null",
|
||||
"--url=null",
|
||||
@@ -556,7 +546,6 @@ class UpdateRegistrarCommandTest extends CommandTestCase<UpdateRegistrarCommand>
|
||||
|
||||
registrar = loadRegistrar("NewRegistrar");
|
||||
assertThat(registrar.getIanaIdentifier()).isNull();
|
||||
assertThat(registrar.getBillingIdentifier()).isNull();
|
||||
assertThat(registrar.getPhoneNumber()).isNull();
|
||||
assertThat(registrar.getFaxNumber()).isNull();
|
||||
assertThat(registrar.getUrl()).isNull();
|
||||
@@ -572,7 +561,6 @@ class UpdateRegistrarCommandTest extends CommandTestCase<UpdateRegistrarCommand>
|
||||
.asBuilder()
|
||||
.setType(Type.PDT) // for non-null IANA ID
|
||||
.setIanaIdentifier(9995L)
|
||||
.setBillingIdentifier(1L)
|
||||
.setPhoneNumber("+1.2125555555")
|
||||
.setFaxNumber("+1.2125555556")
|
||||
.setUrl("http://www.example.tld")
|
||||
@@ -580,7 +568,6 @@ class UpdateRegistrarCommandTest extends CommandTestCase<UpdateRegistrarCommand>
|
||||
.build());
|
||||
|
||||
assertThat(registrar.getIanaIdentifier()).isNotNull();
|
||||
assertThat(registrar.getBillingIdentifier()).isNotNull();
|
||||
assertThat(registrar.getPhoneNumber()).isNotNull();
|
||||
assertThat(registrar.getFaxNumber()).isNotNull();
|
||||
assertThat(registrar.getUrl()).isNotNull();
|
||||
@@ -589,7 +576,6 @@ class UpdateRegistrarCommandTest extends CommandTestCase<UpdateRegistrarCommand>
|
||||
runCommand(
|
||||
"--registrar_type=TEST", // necessary for null IANA ID
|
||||
"--iana_id=",
|
||||
"--billing_id=",
|
||||
"--phone=",
|
||||
"--fax=",
|
||||
"--url=",
|
||||
@@ -599,7 +585,6 @@ class UpdateRegistrarCommandTest extends CommandTestCase<UpdateRegistrarCommand>
|
||||
|
||||
registrar = loadRegistrar("NewRegistrar");
|
||||
assertThat(registrar.getIanaIdentifier()).isNull();
|
||||
assertThat(registrar.getBillingIdentifier()).isNull();
|
||||
assertThat(registrar.getPhoneNumber()).isNull();
|
||||
assertThat(registrar.getFaxNumber()).isNull();
|
||||
assertThat(registrar.getUrl()).isNull();
|
||||
@@ -663,20 +648,6 @@ class UpdateRegistrarCommandTest extends CommandTestCase<UpdateRegistrarCommand>
|
||||
ParameterException.class, () -> runCommand("--iana_id=ABC123", "--force", "NewRegistrar"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFailure_negativeBillingId() {
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> runCommand("--billing_id=-1", "--force", "NewRegistrar"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFailure_nonIntegerBillingId() {
|
||||
assertThrows(
|
||||
ParameterException.class,
|
||||
() -> runCommand("--billing_id=ABC123", "--force", "NewRegistrar"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFailure_passcodeTooShort() {
|
||||
assertThrows(
|
||||
|
||||
@@ -568,7 +568,6 @@ class google.registry.model.registrar.Registrar {
|
||||
google.registry.model.registrar.Registrar$Type type;
|
||||
google.registry.model.registrar.RegistrarAddress internationalizedAddress;
|
||||
google.registry.model.registrar.RegistrarAddress localizedAddress;
|
||||
java.lang.Long billingIdentifier;
|
||||
java.lang.Long ianaIdentifier;
|
||||
java.lang.String clientCertificate;
|
||||
java.lang.String clientCertificateHash;
|
||||
|
||||
Reference in New Issue
Block a user