Remove Ofy from RegistrarContact (#1680)

Also renamed the class to RegistrarPoc and deleted some unused methods.
This commit is contained in:
Lai Jiang
2022-06-27 20:17:28 -04:00
committed by GitHub
parent 2c3279ba95
commit 63e4f4f10a
52 changed files with 551 additions and 700 deletions
@@ -35,8 +35,8 @@ import google.registry.batch.SendExpiringCertificateNotificationEmailAction.Regi
import google.registry.flows.certs.CertificateChecker;
import google.registry.model.registrar.Registrar;
import google.registry.model.registrar.RegistrarAddress;
import google.registry.model.registrar.RegistrarContact;
import google.registry.model.registrar.RegistrarContact.Type;
import google.registry.model.registrar.RegistrarPoc;
import google.registry.model.registrar.RegistrarPoc.Type;
import google.registry.testing.AppEngineExtension;
import google.registry.testing.DualDatabaseTest;
import google.registry.testing.FakeClock;
@@ -220,15 +220,15 @@ class SendExpiringCertificateNotificationEmailActionTest {
.asBuilder()
.setFailoverClientCertificate(cert.get(), clock.nowUtc())
.build());
ImmutableList<RegistrarContact> contacts =
ImmutableList<RegistrarPoc> contacts =
ImmutableList.of(
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Will Doe")
.setEmailAddress("will@example-registrar.tld")
.setPhoneNumber("+1.3105551213")
.setFaxNumber("+1.3105551213")
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
.setVisibleInWhoisAsAdmin(true)
.setVisibleInWhoisAsTech(false)
.build());
@@ -510,51 +510,51 @@ class SendExpiringCertificateNotificationEmailActionTest {
@TestOfyAndSql
void getEmailAddresses_success_returnsAListOfEmails() throws Exception {
Registrar registrar = persistResource(makeRegistrar1());
ImmutableList<RegistrarContact> contacts =
ImmutableList<RegistrarPoc> contacts =
ImmutableList.of(
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("John Doe")
.setEmailAddress("jd@example-registrar.tld")
.setPhoneNumber("+1.3105551213")
.setFaxNumber("+1.3105551213")
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
.setVisibleInWhoisAsAdmin(true)
.setVisibleInWhoisAsTech(false)
.build(),
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("John Smith")
.setEmailAddress("js@example-registrar.tld")
.setPhoneNumber("+1.1111111111")
.setFaxNumber("+1.1111111111")
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
.build(),
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Will Doe")
.setEmailAddress("will@example-registrar.tld")
.setPhoneNumber("+1.3105551213")
.setFaxNumber("+1.3105551213")
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
.setVisibleInWhoisAsAdmin(true)
.setVisibleInWhoisAsTech(false)
.build(),
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Mike Doe")
.setEmailAddress("mike@example-registrar.tld")
.setPhoneNumber("+1.1111111111")
.setFaxNumber("+1.1111111111")
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
.build(),
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("John T")
.setEmailAddress("john@example-registrar.tld")
.setPhoneNumber("+1.3105551215")
.setFaxNumber("+1.3105551216")
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
.setVisibleInWhoisAsTech(true)
.build());
persistSimpleResources(contacts);
@@ -710,20 +710,20 @@ class SendExpiringCertificateNotificationEmailActionTest {
}
/** Returns persisted sample contacts with a customized contact email type. */
private ImmutableList<RegistrarContact> persistSampleContacts(
Registrar registrar, RegistrarContact.Type emailType) {
private ImmutableList<RegistrarPoc> persistSampleContacts(
Registrar registrar, RegistrarPoc.Type emailType) {
return persistSimpleResources(
ImmutableList.of(
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Will Doe")
.setEmailAddress("will@example-registrar.tld")
.setPhoneNumber("+1.0105551213")
.setFaxNumber("+1.0105551213")
.setTypes(ImmutableSet.of(emailType))
.build(),
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Will Smith")
.setEmailAddress("will@test-registrar.tld")
.setPhoneNumber("+1.3105551213")
@@ -16,9 +16,9 @@ package google.registry.export;
import static com.google.common.truth.Truth.assertThat;
import static google.registry.export.SyncGroupMembersAction.getGroupEmailAddressForContactType;
import static google.registry.model.registrar.RegistrarContact.Type.ADMIN;
import static google.registry.model.registrar.RegistrarContact.Type.MARKETING;
import static google.registry.model.registrar.RegistrarContact.Type.TECH;
import static google.registry.model.registrar.RegistrarPoc.Type.ADMIN;
import static google.registry.model.registrar.RegistrarPoc.Type.MARKETING;
import static google.registry.model.registrar.RegistrarPoc.Type.TECH;
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
import static google.registry.testing.DatabaseHelper.loadRegistrar;
import static google.registry.testing.DatabaseHelper.persistResource;
@@ -37,7 +37,7 @@ import com.google.common.collect.Iterables;
import google.registry.groups.DirectoryGroupsConnection;
import google.registry.groups.GroupsConnection.Role;
import google.registry.model.registrar.Registrar;
import google.registry.model.registrar.RegistrarContact;
import google.registry.model.registrar.RegistrarPoc;
import google.registry.request.Response;
import google.registry.testing.AppEngineExtension;
import google.registry.testing.DualDatabaseTest;
@@ -78,10 +78,9 @@ public class SyncGroupMembersActionTest {
@TestOfyAndSql
void test_getGroupEmailAddressForContactType_convertsToLowercase() {
assertThat(getGroupEmailAddressForContactType(
"SomeRegistrar",
RegistrarContact.Type.ADMIN,
"domain-registry.example"))
assertThat(
getGroupEmailAddressForContactType(
"SomeRegistrar", RegistrarPoc.Type.ADMIN, "domain-registry.example"))
.isEqualTo("someregistrar-primary-contacts@domain-registry.example");
}
@@ -156,15 +155,15 @@ public class SyncGroupMembersActionTest {
when(connection.getMembersOfGroup("theregistrar-primary-contacts@domain-registry.example"))
.thenReturn(ImmutableSet.of());
persistResource(
new RegistrarContact.Builder()
.setParent(loadRegistrar("NewRegistrar"))
new RegistrarPoc.Builder()
.setRegistrar(loadRegistrar("NewRegistrar"))
.setName("Binary Star")
.setEmailAddress("binarystar@example.tld")
.setTypes(ImmutableSet.of(ADMIN, MARKETING))
.build());
persistResource(
new RegistrarContact.Builder()
.setParent(loadRegistrar("TheRegistrar"))
new RegistrarPoc.Builder()
.setRegistrar(loadRegistrar("TheRegistrar"))
.setName("Hexadecimal")
.setEmailAddress("hexadecimal@snow.fall")
.setTypes(ImmutableSet.of(TECH))
@@ -38,7 +38,7 @@ import google.registry.model.common.Cursor;
import google.registry.model.ofy.Ofy;
import google.registry.model.registrar.Registrar;
import google.registry.model.registrar.RegistrarAddress;
import google.registry.model.registrar.RegistrarContact;
import google.registry.model.registrar.RegistrarPoc;
import google.registry.testing.AppEngineExtension;
import google.registry.testing.DatabaseHelper;
import google.registry.testing.DualDatabaseTest;
@@ -85,7 +85,7 @@ public class SyncRegistrarsSheetTest {
// We don't do this for ofy because ofy's loadAllOf() can't be called in a transaction but
// _must_ be called in a transaction in JPA.
if (!tm().isOfy()) {
tm().transact(() -> tm().loadAllOf(RegistrarContact.class))
tm().transact(() -> tm().loadAllOf(RegistrarPoc.class))
.forEach(DatabaseHelper::deleteResource);
}
Registrar.loadAll().forEach(DatabaseHelper::deleteResource);
@@ -161,33 +161,34 @@ public class SyncRegistrarsSheetTest {
.setUrl("http://www.example.org/aaa_registrar")
.setBillingAccountMap(ImmutableMap.of(USD, "USD1234", JPY, "JPY7890"))
.build();
ImmutableList<RegistrarContact> contacts = ImmutableList.of(
new RegistrarContact.Builder()
.setParent(registrar)
.setName("Jane Doe")
.setEmailAddress("contact@example.com")
.setPhoneNumber("+1.1234567890")
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN, RegistrarContact.Type.BILLING))
.build(),
new RegistrarContact.Builder()
.setParent(registrar)
.setName("John Doe")
.setEmailAddress("john.doe@example.tld")
.setPhoneNumber("+1.1234567890")
.setFaxNumber("+1.1234567891")
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
// Purposely flip the internal/external admin/tech
// distinction to make sure we're not relying on it. Sigh.
.setVisibleInWhoisAsAdmin(false)
.setVisibleInWhoisAsTech(true)
.setGaeUserId("light")
.build(),
new RegistrarContact.Builder()
.setParent(registrar)
.setName("Jane Smith")
.setEmailAddress("pride@example.net")
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH))
.build());
ImmutableList<RegistrarPoc> contacts =
ImmutableList.of(
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Jane Doe")
.setEmailAddress("contact@example.com")
.setPhoneNumber("+1.1234567890")
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN, RegistrarPoc.Type.BILLING))
.build(),
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("John Doe")
.setEmailAddress("john.doe@example.tld")
.setPhoneNumber("+1.1234567890")
.setFaxNumber("+1.1234567891")
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
// Purposely flip the internal/external admin/tech
// distinction to make sure we're not relying on it. Sigh.
.setVisibleInWhoisAsAdmin(false)
.setVisibleInWhoisAsTech(true)
.setGaeUserId("light")
.build(),
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Jane Smith")
.setEmailAddress("pride@example.net")
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
.build());
// Use registrar key for contacts' parent.
DateTime registrarCreationTime = persistResource(registrar).getCreationTime();
persistSimpleResources(contacts);
@@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import com.google.common.collect.ImmutableList;
import google.registry.model.registrar.Registrar;
import google.registry.model.registrar.RegistrarContact;
import google.registry.model.registrar.RegistrarPoc;
import google.registry.model.tld.Registry;
import google.registry.model.tld.Registry.TldState;
import google.registry.testing.AppEngineExtension;
@@ -93,9 +93,8 @@ public final class OteAccountBuilderTest {
private void assertContactExists(String registrarId, String email) {
Registrar registrar = Registrar.loadByRegistrarId(registrarId).get();
assertThat(registrar.getContacts().stream().map(RegistrarContact::getEmailAddress))
.contains(email);
RegistrarContact contact =
assertThat(registrar.getContacts().stream().map(RegistrarPoc::getEmailAddress)).contains(email);
RegistrarPoc contact =
registrar.getContacts().stream()
.filter(c -> email.equals(c.getEmailAddress()))
.findAny()
@@ -34,7 +34,6 @@ import google.registry.model.index.ForeignKeyIndex.ForeignKeyHostIndex;
import google.registry.model.poll.PollMessage;
import google.registry.model.rde.RdeRevision;
import google.registry.model.registrar.Registrar;
import google.registry.model.registrar.RegistrarContact;
import google.registry.model.replay.LastSqlTransaction;
import google.registry.model.replay.ReplayGap;
import google.registry.model.reporting.HistoryEntry;
@@ -70,7 +69,6 @@ public class ClassPathManagerTest {
assertThat(ClassPathManager.getClass("ReplayGap")).isEqualTo(ReplayGap.class);
assertThat(ClassPathManager.getClass("ContactResource")).isEqualTo(ContactResource.class);
assertThat(ClassPathManager.getClass("Cancellation")).isEqualTo(Cancellation.class);
assertThat(ClassPathManager.getClass("RegistrarContact")).isEqualTo(RegistrarContact.class);
assertThat(ClassPathManager.getClass("LastSqlTransaction")).isEqualTo(LastSqlTransaction.class);
assertThat(ClassPathManager.getClass("GaeUserIdConverter")).isEqualTo(GaeUserIdConverter.class);
assertThat(ClassPathManager.getClass("EppResourceIndexBucket"))
@@ -130,7 +128,6 @@ public class ClassPathManagerTest {
assertThat(ClassPathManager.getClassName(ReplayGap.class)).isEqualTo("ReplayGap");
assertThat(ClassPathManager.getClassName(ContactResource.class)).isEqualTo("ContactResource");
assertThat(ClassPathManager.getClassName(Cancellation.class)).isEqualTo("Cancellation");
assertThat(ClassPathManager.getClassName(RegistrarContact.class)).isEqualTo("RegistrarContact");
assertThat(ClassPathManager.getClassName(LastSqlTransaction.class))
.isEqualTo("LastSqlTransaction");
assertThat(ClassPathManager.getClassName(GaeUserIdConverter.class))
@@ -63,7 +63,7 @@ import org.junit.jupiter.api.BeforeEach;
class RegistrarTest extends EntityTestCase {
private Registrar registrar;
private RegistrarContact abuseAdminContact;
private RegistrarPoc abuseAdminContact;
@BeforeEach
void setUp() {
@@ -127,27 +127,26 @@ class RegistrarTest extends EntityTestCase {
.build());
persistResource(registrar);
abuseAdminContact =
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("John Abused")
.setEmailAddress("johnabuse@example.com")
.setVisibleInWhoisAsAdmin(true)
.setVisibleInWhoisAsTech(false)
.setPhoneNumber("+1.2125551213")
.setFaxNumber("+1.2125551213")
.setTypes(ImmutableSet.of(RegistrarContact.Type.ABUSE, RegistrarContact.Type.ADMIN))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ABUSE, RegistrarPoc.Type.ADMIN))
.build();
persistSimpleResources(
ImmutableList.of(
abuseAdminContact,
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("John Doe")
.setEmailAddress("johndoe@example.com")
.setPhoneNumber("+1.2125551213")
.setFaxNumber("+1.2125551213")
.setTypes(
ImmutableSet.of(RegistrarContact.Type.LEGAL, RegistrarContact.Type.MARKETING))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.LEGAL, RegistrarPoc.Type.MARKETING))
.build()));
}
@@ -296,50 +295,50 @@ class RegistrarTest extends EntityTestCase {
@TestOfyAndSql
void testSuccess_emptyContactTypesAllowed() {
persistSimpleResource(
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("John Abussy")
.setEmailAddress("johnabussy@example.com")
.setPhoneNumber("+1.2125551213")
.setFaxNumber("+1.2125551213")
// No setTypes(...)
.build());
for (RegistrarContact rc : registrar.getContacts()) {
for (RegistrarPoc rc : registrar.getContacts()) {
rc.toJsonMap();
}
}
@TestOfyAndSql
void testSuccess_getContactsByType() {
RegistrarContact newTechContact =
RegistrarPoc newTechContact =
persistSimpleResource(
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Jake Tech")
.setEmailAddress("jaketech@example.com")
.setVisibleInWhoisAsAdmin(true)
.setVisibleInWhoisAsTech(true)
.setPhoneNumber("+1.2125551213")
.setFaxNumber("+1.2125551213")
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
.build());
RegistrarContact newTechAbuseContact =
RegistrarPoc newTechAbuseContact =
persistSimpleResource(
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Jim Tech-Abuse")
.setEmailAddress("jimtechAbuse@example.com")
.setVisibleInWhoisAsAdmin(true)
.setVisibleInWhoisAsTech(true)
.setPhoneNumber("+1.2125551213")
.setFaxNumber("+1.2125551213")
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH, RegistrarContact.Type.ABUSE))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH, RegistrarPoc.Type.ABUSE))
.build());
ImmutableSortedSet<RegistrarContact> techContacts =
registrar.getContactsOfType(RegistrarContact.Type.TECH);
ImmutableSortedSet<RegistrarPoc> techContacts =
registrar.getContactsOfType(RegistrarPoc.Type.TECH);
assertThat(techContacts).containsExactly(newTechContact, newTechAbuseContact).inOrder();
ImmutableSortedSet<RegistrarContact> abuseContacts =
registrar.getContactsOfType(RegistrarContact.Type.ABUSE);
ImmutableSortedSet<RegistrarPoc> abuseContacts =
registrar.getContactsOfType(RegistrarPoc.Type.ABUSE);
assertThat(abuseContacts).containsExactly(newTechAbuseContact, abuseAdminContact).inOrder();
}
@@ -25,7 +25,7 @@ import google.registry.model.billing.BillingEvent.OneTime;
import google.registry.model.common.ClassPathManager;
import google.registry.model.domain.DomainBase;
import google.registry.model.host.HostResource;
import google.registry.model.registrar.RegistrarContact;
import google.registry.model.registrar.RegistrarPoc;
import google.registry.testing.AppEngineExtension;
import google.registry.testing.TestObject;
import org.junit.jupiter.api.BeforeAll;
@@ -68,7 +68,7 @@ class VKeyTest {
IllegalArgumentException thrown =
assertThrows(
IllegalArgumentException.class,
() -> VKey.create(RegistrarContact.class, "fake@example.com"));
() -> VKey.create(RegistrarPoc.class, "fake@example.com"));
assertThat(thrown).hasMessageThat().contains("BackupGroupRoot");
}
@@ -32,7 +32,7 @@ import com.google.common.io.Resources;
import google.registry.model.registrar.Registrar;
import google.registry.model.registrar.Registrar.State;
import google.registry.model.registrar.RegistrarAddress;
import google.registry.model.registrar.RegistrarContact;
import google.registry.model.registrar.RegistrarPoc;
import google.registry.persistence.HibernateSchemaExporter;
import google.registry.persistence.NomulusPostgreSql;
import google.registry.persistence.PersistenceModule;
@@ -388,15 +388,15 @@ abstract class JpaTransactionManagerExtension implements BeforeEachCallback, Aft
* Public factory for first RegistrarContact to allow comparison against stored value in unit
* tests.
*/
public static RegistrarContact makeRegistrarContact1() {
return new RegistrarContact.Builder()
.setParent(makeRegistrar1())
public static RegistrarPoc makeRegistrarContact1() {
return new RegistrarPoc.Builder()
.setRegistrar(makeRegistrar1())
.setName("Jane Doe")
.setVisibleInWhoisAsAdmin(true)
.setVisibleInWhoisAsTech(false)
.setEmailAddress("janedoe@theregistrar.com")
.setPhoneNumber("+1.1234567890")
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
.build();
}
@@ -404,25 +404,25 @@ abstract class JpaTransactionManagerExtension implements BeforeEachCallback, Aft
* Public factory for second RegistrarContact to allow comparison against stored value in unit
* tests.
*/
public static RegistrarContact makeRegistrarContact2() {
return new RegistrarContact.Builder()
.setParent(makeRegistrar2())
public static RegistrarPoc makeRegistrarContact2() {
return new RegistrarPoc.Builder()
.setRegistrar(makeRegistrar2())
.setName("John Doe")
.setEmailAddress("johndoe@theregistrar.com")
.setPhoneNumber("+1.1234567890")
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
.setGaeUserId(THE_REGISTRAR_GAE_USER_ID)
.build();
}
public static RegistrarContact makeRegistrarContact3() {
return new RegistrarContact.Builder()
.setParent(makeRegistrar2())
public static RegistrarPoc makeRegistrarContact3() {
return new RegistrarPoc.Builder()
.setRegistrar(makeRegistrar2())
.setName("Marla Singer")
.setEmailAddress("Marla.Singer@crr.com")
.setRegistryLockEmailAddress("Marla.Singer.RegistryLock@crr.com")
.setPhoneNumber("+1.2128675309")
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
.setGaeUserId(MARLA_SINGER_GAE_USER_ID)
.setAllowedToSetRegistryLockPassword(true)
.setRegistryLockPassword("hi")
@@ -40,7 +40,7 @@ import google.registry.model.eppcommon.StatusValue;
import google.registry.model.host.HostResource;
import google.registry.model.ofy.Ofy;
import google.registry.model.registrar.Registrar;
import google.registry.model.registrar.RegistrarContact;
import google.registry.model.registrar.RegistrarPoc;
import google.registry.model.reporting.HistoryEntry;
import google.registry.model.transfer.DomainTransferData;
import google.registry.model.transfer.TransferStatus;
@@ -260,43 +260,43 @@ class RdapJsonFormatterTest {
clock.nowUtc().minusMonths(3)));
}
static ImmutableList<RegistrarContact> makeMoreRegistrarContacts(Registrar registrar) {
static ImmutableList<RegistrarPoc> makeMoreRegistrarContacts(Registrar registrar) {
return ImmutableList.of(
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Baby Doe")
.setEmailAddress("babydoe@example.com")
.setPhoneNumber("+1.2125551217")
.setFaxNumber("+1.2125551218")
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
.setVisibleInWhoisAsAdmin(false)
.setVisibleInWhoisAsTech(false)
.build(),
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("John Doe")
.setEmailAddress("johndoe@example.com")
.setFaxNumber("+1.2125551213")
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
.setVisibleInWhoisAsAdmin(false)
.setVisibleInWhoisAsTech(true)
.build(),
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Jane Doe")
.setEmailAddress("janedoe@example.com")
.setPhoneNumber("+1.2125551215")
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH, RegistrarContact.Type.ADMIN))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH, RegistrarPoc.Type.ADMIN))
.setVisibleInWhoisAsAdmin(true)
.setVisibleInWhoisAsTech(false)
.build(),
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Play Doe")
.setEmailAddress("playdoe@example.com")
.setPhoneNumber("+1.2125551217")
.setFaxNumber("+1.2125551218")
.setTypes(ImmutableSet.of(RegistrarContact.Type.BILLING))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.BILLING))
.setVisibleInWhoisAsAdmin(true)
.setVisibleInWhoisAsTech(true)
.build());
@@ -15,7 +15,7 @@
package google.registry.schema.registrar;
import static com.google.common.truth.Truth.assertThat;
import static google.registry.model.registrar.RegistrarContact.Type.WHOIS;
import static google.registry.model.registrar.RegistrarPoc.Type.WHOIS;
import static google.registry.persistence.transaction.TransactionManagerFactory.jpaTm;
import static google.registry.testing.DatabaseHelper.insertInDb;
import static google.registry.testing.DatabaseHelper.loadByEntity;
@@ -23,7 +23,7 @@ import static google.registry.testing.SqlHelper.saveRegistrar;
import com.google.common.collect.ImmutableSet;
import google.registry.model.registrar.Registrar;
import google.registry.model.registrar.RegistrarContact;
import google.registry.model.registrar.RegistrarPoc;
import google.registry.persistence.transaction.JpaTestExtensions;
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationWithCoverageExtension;
import google.registry.testing.DatastoreEntityExtension;
@@ -33,8 +33,8 @@ import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
/** Unit tests for persisting {@link RegistrarContact} entities. */
class RegistrarContactTest {
/** Unit tests for persisting {@link RegistrarPoc} entities. */
class RegistrarPocTest {
@RegisterExtension
@Order(value = 1)
@@ -46,14 +46,14 @@ class RegistrarContactTest {
private Registrar testRegistrar;
private RegistrarContact testRegistrarPoc;
private RegistrarPoc testRegistrarPoc;
@BeforeEach
public void beforeEach() {
testRegistrar = saveRegistrar("registrarId");
testRegistrarPoc =
new RegistrarContact.Builder()
.setParent(testRegistrar)
new RegistrarPoc.Builder()
.setRegistrar(testRegistrar)
.setName("Judith Registrar")
.setEmailAddress("judith.doe@example.com")
.setRegistryLockEmailAddress("judith.doe@external.com")
@@ -75,7 +75,7 @@ class RegistrarContactTest {
@Test
void testSerializable_succeeds() {
insertInDb(testRegistrarPoc);
RegistrarContact persisted = jpaTm().transact(() -> jpaTm().loadByEntity(testRegistrarPoc));
RegistrarPoc persisted = jpaTm().transact(() -> jpaTm().loadByEntity(testRegistrarPoc));
assertThat(SerializeUtils.serializeDeserialize(persisted)).isEqualTo(persisted);
}
}
@@ -49,7 +49,7 @@ import google.registry.model.ofy.ObjectifyService;
import google.registry.model.registrar.Registrar;
import google.registry.model.registrar.Registrar.State;
import google.registry.model.registrar.RegistrarAddress;
import google.registry.model.registrar.RegistrarContact;
import google.registry.model.registrar.RegistrarPoc;
import google.registry.persistence.transaction.JpaTestExtensions;
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationTestExtension;
import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationWithCoverageExtension;
@@ -326,15 +326,15 @@ public final class AppEngineExtension implements BeforeEachCallback, AfterEachCa
* Public factory for first RegistrarContact to allow comparison against stored value in unit
* tests.
*/
public static RegistrarContact makeRegistrarContact1() {
return new RegistrarContact.Builder()
.setParent(makeRegistrar1())
public static RegistrarPoc makeRegistrarContact1() {
return new RegistrarPoc.Builder()
.setRegistrar(makeRegistrar1())
.setName("Jane Doe")
.setVisibleInWhoisAsAdmin(true)
.setVisibleInWhoisAsTech(false)
.setEmailAddress("janedoe@theregistrar.com")
.setPhoneNumber("+1.1234567890")
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
.build();
}
@@ -342,25 +342,25 @@ public final class AppEngineExtension implements BeforeEachCallback, AfterEachCa
* Public factory for second RegistrarContact to allow comparison against stored value in unit
* tests.
*/
public static RegistrarContact makeRegistrarContact2() {
return new RegistrarContact.Builder()
.setParent(makeRegistrar2())
public static RegistrarPoc makeRegistrarContact2() {
return new RegistrarPoc.Builder()
.setRegistrar(makeRegistrar2())
.setName("John Doe")
.setEmailAddress("johndoe@theregistrar.com")
.setPhoneNumber("+1.1234567890")
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
.setGaeUserId(THE_REGISTRAR_GAE_USER_ID)
.build();
}
public static RegistrarContact makeRegistrarContact3() {
return new RegistrarContact.Builder()
.setParent(makeRegistrar2())
public static RegistrarPoc makeRegistrarContact3() {
return new RegistrarPoc.Builder()
.setRegistrar(makeRegistrar2())
.setName("Marla Singer")
.setEmailAddress("Marla.Singer@crr.com")
.setRegistryLockEmailAddress("Marla.Singer.RegistryLock@crr.com")
.setPhoneNumber("+1.2128675309")
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
.setGaeUserId(MARLA_SINGER_GAE_USER_ID)
.setAllowedToSetRegistryLockPassword(true)
.setRegistryLockPassword("hi")
@@ -37,7 +37,7 @@ import google.registry.model.eppcommon.Trid;
import google.registry.model.host.HostResource;
import google.registry.model.registrar.Registrar;
import google.registry.model.registrar.RegistrarAddress;
import google.registry.model.registrar.RegistrarContact;
import google.registry.model.registrar.RegistrarPoc;
import google.registry.model.reporting.HistoryEntry;
import google.registry.persistence.VKey;
import google.registry.util.Idn;
@@ -89,34 +89,34 @@ public final class FullFieldsTestEntityHelper {
.build();
}
public static ImmutableList<RegistrarContact> makeRegistrarContacts(Registrar registrar) {
public static ImmutableList<RegistrarPoc> makeRegistrarContacts(Registrar registrar) {
return ImmutableList.of(
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("John Doe")
.setEmailAddress("johndoe@example.com")
.setPhoneNumber("+1.2125551213")
.setFaxNumber("+1.2125551213")
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
// Purposely flip the internal/external admin/tech
// distinction to make sure we're not relying on it. Sigh.
.setVisibleInWhoisAsAdmin(false)
.setVisibleInWhoisAsTech(true)
.build(),
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Jane Doe")
.setEmailAddress("janedoe@example.com")
.setPhoneNumber("+1.2125551215")
.setFaxNumber("+1.2125551216")
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
// Purposely flip the internal/external admin/tech
// distinction to make sure we're not relying on it. Sigh.
.setVisibleInWhoisAsAdmin(true)
.setVisibleInWhoisAsTech(false)
.build(),
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Jake Doe")
.setEmailAddress("jakedoe@example.com")
.setPhoneNumber("+1.2125551216")
@@ -15,10 +15,10 @@
package google.registry.tools;
import static com.google.common.truth.Truth.assertThat;
import static google.registry.model.registrar.RegistrarContact.Type.ABUSE;
import static google.registry.model.registrar.RegistrarContact.Type.ADMIN;
import static google.registry.model.registrar.RegistrarContact.Type.TECH;
import static google.registry.model.registrar.RegistrarContact.Type.WHOIS;
import static google.registry.model.registrar.RegistrarPoc.Type.ABUSE;
import static google.registry.model.registrar.RegistrarPoc.Type.ADMIN;
import static google.registry.model.registrar.RegistrarPoc.Type.TECH;
import static google.registry.model.registrar.RegistrarPoc.Type.WHOIS;
import static google.registry.testing.DatabaseHelper.loadRegistrar;
import static google.registry.testing.DatabaseHelper.persistResource;
import static google.registry.testing.DatabaseHelper.persistSimpleResource;
@@ -30,14 +30,14 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import google.registry.model.registrar.Registrar;
import google.registry.model.registrar.RegistrarContact;
import google.registry.model.registrar.RegistrarPoc;
import java.nio.file.Files;
import java.nio.file.Paths;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
/** Unit tests for {@link RegistrarContactCommand}. */
class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactCommand> {
/** Unit tests for {@link RegistrarPocCommand}. */
class RegistrarPocCommandTest extends CommandTestCase<RegistrarPocCommand> {
private String output;
@@ -49,11 +49,11 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
@Test
void testList() throws Exception {
Registrar registrar = loadRegistrar("NewRegistrar");
RegistrarContact.updateContacts(
RegistrarPoc.updateContacts(
registrar,
ImmutableSet.of(
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("John Doe")
.setEmailAddress("john.doe@example.com")
.setTypes(ImmutableSet.of(ADMIN))
@@ -75,16 +75,17 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
@Test
void testUpdate() throws Exception {
Registrar registrar = loadRegistrar("NewRegistrar");
ImmutableList<RegistrarContact> contacts = ImmutableList.of(
new RegistrarContact.Builder()
.setParent(registrar)
.setName("Judith Doe")
.setEmailAddress("judith.doe@example.com")
.setTypes(ImmutableSet.of(WHOIS))
.setVisibleInWhoisAsAdmin(true)
.setVisibleInWhoisAsTech(true)
.setVisibleInDomainWhoisAsAbuse(false)
.build());
ImmutableList<RegistrarPoc> contacts =
ImmutableList.of(
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Judith Doe")
.setEmailAddress("judith.doe@example.com")
.setTypes(ImmutableSet.of(WHOIS))
.setVisibleInWhoisAsAdmin(true)
.setVisibleInWhoisAsTech(true)
.setVisibleInDomainWhoisAsAbuse(false)
.build());
persistSimpleResources(contacts);
runCommandForced(
"--mode=UPDATE",
@@ -98,11 +99,11 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
"--visible_in_whois_as_tech=false",
"--visible_in_domain_whois_as_abuse=false",
"NewRegistrar");
RegistrarContact registrarContact = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
assertThat(registrarContact)
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
assertThat(registrarPoc)
.isEqualTo(
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Judith Registrar")
.setEmailAddress("judith.doe@example.com")
.setRegistryLockEmailAddress("judith.doe@external.com")
@@ -119,8 +120,8 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
void testUpdate_enableConsoleAccess() throws Exception {
Registrar registrar = loadRegistrar("NewRegistrar");
persistSimpleResource(
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Jane Doe")
.setEmailAddress("jane.doe@example.com")
.build());
@@ -129,20 +130,20 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
"--email=jane.doe@example.com",
"--allow_console_access=true",
"NewRegistrar");
RegistrarContact registrarContact =
RegistrarPoc registrarPoc =
loadRegistrar("NewRegistrar").getContacts().stream()
.filter(rc -> rc.getEmailAddress().equals("jane.doe@example.com"))
.findFirst()
.get();
assertThat(registrarContact.getGaeUserId()).matches("-?[0-9]+");
assertThat(registrarPoc.getGaeUserId()).matches("-?[0-9]+");
}
@Test
void testUpdate_disableConsoleAccess() throws Exception {
Registrar registrar = loadRegistrar("NewRegistrar");
persistSimpleResource(
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Judith Doe")
.setEmailAddress("judith.doe@example.com")
.setGaeUserId("11111")
@@ -152,23 +153,23 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
"--email=judith.doe@example.com",
"--allow_console_access=false",
"NewRegistrar");
RegistrarContact registrarContact = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
assertThat(registrarContact.getGaeUserId()).isNull();
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
assertThat(registrarPoc.getGaeUserId()).isNull();
}
@Test
void testUpdate_unsetOtherWhoisAbuseFlags() throws Exception {
Registrar registrar = loadRegistrar("NewRegistrar");
persistSimpleResource(
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("John Doe")
.setEmailAddress("john.doe@example.com")
.setGaeUserId("11111")
.build());
persistSimpleResource(
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Johnna Doe")
.setEmailAddress("johnna.doe@example.com")
.setGaeUserId("11112")
@@ -179,13 +180,13 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
"--email=john.doe@example.com",
"--visible_in_domain_whois_as_abuse=true",
"NewRegistrar");
ImmutableList<RegistrarContact> registrarContacts =
ImmutableList<RegistrarPoc> registrarPocs =
loadRegistrar("NewRegistrar").getContacts().asList();
for (RegistrarContact registrarContact : registrarContacts) {
if (registrarContact.getName().equals("John Doe")) {
assertThat(registrarContact.getVisibleInDomainWhoisAsAbuse()).isTrue();
for (RegistrarPoc registrarPoc : registrarPocs) {
if (registrarPoc.getName().equals("John Doe")) {
assertThat(registrarPoc.getVisibleInDomainWhoisAsAbuse()).isTrue();
} else {
assertThat(registrarContact.getVisibleInDomainWhoisAsAbuse()).isFalse();
assertThat(registrarPoc.getVisibleInDomainWhoisAsAbuse()).isFalse();
}
}
}
@@ -194,8 +195,8 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
void testUpdate_cannotUnsetOnlyWhoisAbuseContact() {
Registrar registrar = loadRegistrar("NewRegistrar");
persistSimpleResource(
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("John Doe")
.setEmailAddress("john.doe@example.com")
.setGaeUserId("11111")
@@ -213,39 +214,40 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
assertThat(thrown)
.hasMessageThat()
.contains("Cannot clear visible_in_domain_whois_as_abuse flag");
RegistrarContact registrarContact = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
assertThat(registrarContact.getVisibleInDomainWhoisAsAbuse()).isTrue();
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
assertThat(registrarPoc.getVisibleInDomainWhoisAsAbuse()).isTrue();
}
@Test
void testUpdate_emptyCommandModifiesNothing() throws Exception {
Registrar registrar = loadRegistrar("NewRegistrar");
RegistrarContact existingContact = persistSimpleResource(
new RegistrarContact.Builder()
.setParent(registrar)
.setName("John Doe")
.setEmailAddress("john.doe@example.com")
.setGaeUserId("11111")
.setPhoneNumber("123-456-7890")
.setFaxNumber("123-456-7890")
.setTypes(ImmutableSet.of(ADMIN, ABUSE))
.setVisibleInWhoisAsAdmin(true)
.setVisibleInWhoisAsTech(true)
.setVisibleInDomainWhoisAsAbuse(true)
.build());
RegistrarPoc existingContact =
persistSimpleResource(
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("John Doe")
.setEmailAddress("john.doe@example.com")
.setGaeUserId("11111")
.setPhoneNumber("123-456-7890")
.setFaxNumber("123-456-7890")
.setTypes(ImmutableSet.of(ADMIN, ABUSE))
.setVisibleInWhoisAsAdmin(true)
.setVisibleInWhoisAsTech(true)
.setVisibleInDomainWhoisAsAbuse(true)
.build());
runCommandForced("--mode=UPDATE", "--email=john.doe@example.com", "NewRegistrar");
RegistrarContact registrarContact = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
assertThat(registrarContact.getEmailAddress()).isEqualTo(existingContact.getEmailAddress());
assertThat(registrarContact.getName()).isEqualTo(existingContact.getName());
assertThat(registrarContact.getGaeUserId()).isEqualTo(existingContact.getGaeUserId());
assertThat(registrarContact.getPhoneNumber()).isEqualTo(existingContact.getPhoneNumber());
assertThat(registrarContact.getFaxNumber()).isEqualTo(existingContact.getFaxNumber());
assertThat(registrarContact.getTypes()).isEqualTo(existingContact.getTypes());
assertThat(registrarContact.getVisibleInWhoisAsAdmin())
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
assertThat(registrarPoc.getEmailAddress()).isEqualTo(existingContact.getEmailAddress());
assertThat(registrarPoc.getName()).isEqualTo(existingContact.getName());
assertThat(registrarPoc.getGaeUserId()).isEqualTo(existingContact.getGaeUserId());
assertThat(registrarPoc.getPhoneNumber()).isEqualTo(existingContact.getPhoneNumber());
assertThat(registrarPoc.getFaxNumber()).isEqualTo(existingContact.getFaxNumber());
assertThat(registrarPoc.getTypes()).isEqualTo(existingContact.getTypes());
assertThat(registrarPoc.getVisibleInWhoisAsAdmin())
.isEqualTo(existingContact.getVisibleInWhoisAsAdmin());
assertThat(registrarContact.getVisibleInWhoisAsTech())
assertThat(registrarPoc.getVisibleInWhoisAsTech())
.isEqualTo(existingContact.getVisibleInWhoisAsTech());
assertThat(registrarContact.getVisibleInDomainWhoisAsAbuse())
assertThat(registrarPoc.getVisibleInDomainWhoisAsAbuse())
.isEqualTo(existingContact.getVisibleInDomainWhoisAsAbuse());
}
@@ -253,8 +255,8 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
void testUpdate_listOfTypesWorks() throws Exception {
Registrar registrar = loadRegistrar("NewRegistrar");
persistSimpleResource(
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("John Doe")
.setEmailAddress("john.doe@example.com")
.setGaeUserId("11111")
@@ -270,16 +272,16 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
"--email=john.doe@example.com",
"--contact_type=ADMIN,TECH",
"NewRegistrar");
RegistrarContact registrarContact = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
assertThat(registrarContact.getTypes()).containsExactly(ADMIN, TECH);
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
assertThat(registrarPoc.getTypes()).containsExactly(ADMIN, TECH);
}
@Test
void testUpdate_clearAllTypes() throws Exception {
Registrar registrar = loadRegistrar("NewRegistrar");
persistSimpleResource(
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("John Doe")
.setEmailAddress("john.doe@example.com")
.setTypes(ImmutableSet.of(ADMIN, ABUSE))
@@ -289,8 +291,8 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
"--email=john.doe@example.com",
"--contact_type=",
"NewRegistrar");
RegistrarContact registrarContact = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
assertThat(registrarContact.getTypes()).isEmpty();
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
assertThat(registrarPoc.getTypes()).isEmpty();
}
@Test
@@ -306,11 +308,11 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
"--visible_in_whois_as_tech=false",
"--visible_in_domain_whois_as_abuse=true",
"NewRegistrar");
RegistrarContact registrarContact = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
assertThat(registrarContact)
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
assertThat(registrarPoc)
.isEqualTo(
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Jim Doe")
.setEmailAddress("jim.doe@example.com")
.setRegistryLockEmailAddress("jim.doe@external.com")
@@ -319,7 +321,7 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
.setVisibleInWhoisAsTech(false)
.setVisibleInDomainWhoisAsAbuse(true)
.build());
assertThat(registrarContact.getGaeUserId()).isNull();
assertThat(registrarPoc.getGaeUserId()).isNull();
}
@Test
@@ -334,8 +336,8 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
@Test
void testDelete_failsOnDomainWhoisAbuseContact() {
RegistrarContact registrarContact = loadRegistrar("NewRegistrar").getContacts().asList().get(0);
putInDb(registrarContact.asBuilder().setVisibleInDomainWhoisAsAbuse(true).build());
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(0);
putInDb(registrarPoc.asBuilder().setVisibleInDomainWhoisAsAbuse(true).build());
IllegalArgumentException thrown =
assertThrows(
IllegalArgumentException.class,
@@ -355,16 +357,16 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
"--allow_console_access=true",
"--contact_type=ADMIN,ABUSE",
"NewRegistrar");
RegistrarContact registrarContact = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
assertThat(registrarContact.getGaeUserId()).matches("-?[0-9]+");
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
assertThat(registrarPoc.getGaeUserId()).matches("-?[0-9]+");
}
@Test
void testCreate_withNoContactTypes() throws Exception {
runCommandForced(
"--mode=CREATE", "--name=Jim Doe", "--email=jim.doe@example.com", "NewRegistrar");
RegistrarContact registrarContact = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
assertThat(registrarContact.getTypes()).isEmpty();
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
assertThat(registrarPoc.getTypes()).isEmpty();
}
@Test
@@ -387,27 +389,27 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
"--registry_lock_email=jim.doe.registry.lock@example.com",
"--allowed_to_set_registry_lock_password=true",
"NewRegistrar");
RegistrarContact registrarContact = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
assertThat(registrarContact.isAllowedToSetRegistryLockPassword()).isTrue();
registrarContact.asBuilder().setRegistryLockPassword("foo");
RegistrarPoc registrarPoc = loadRegistrar("NewRegistrar").getContacts().asList().get(1);
assertThat(registrarPoc.isAllowedToSetRegistryLockPassword()).isTrue();
registrarPoc.asBuilder().setRegistryLockPassword("foo");
}
@Test
void testUpdate_setAllowedToSetRegistryLockPassword() throws Exception {
Registrar registrar = loadRegistrar("NewRegistrar");
RegistrarContact registrarContact =
RegistrarPoc registrarPoc =
persistSimpleResource(
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Jim Doe")
.setEmailAddress("jim.doe@example.com")
.build());
assertThat(registrarContact.isAllowedToSetRegistryLockPassword()).isFalse();
assertThat(registrarPoc.isAllowedToSetRegistryLockPassword()).isFalse();
// First, try (and fail) to set the password directly
assertThrows(
IllegalArgumentException.class,
() -> registrarContact.asBuilder().setRegistryLockPassword("foo"));
() -> registrarPoc.asBuilder().setRegistryLockPassword("foo"));
// Next, try (and fail) to allow registry lock without a registry lock email
assertThat(
@@ -429,7 +431,7 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
"--registry_lock_email=jim.doe.registry.lock@example.com",
"--allowed_to_set_registry_lock_password=true",
"NewRegistrar");
RegistrarContact newContact = reloadResource(registrarContact);
RegistrarPoc newContact = reloadResource(registrarPoc);
assertThat(newContact.isAllowedToSetRegistryLockPassword()).isTrue();
// should be allowed to set the password now
newContact.asBuilder().setRegistryLockPassword("foo");
@@ -438,25 +440,25 @@ class RegistrarContactCommandTest extends CommandTestCase<RegistrarContactComman
@Test
void testUpdate_setAllowedToSetRegistryLockPassword_removesOldPassword() throws Exception {
Registrar registrar = loadRegistrar("NewRegistrar");
RegistrarContact registrarContact =
RegistrarPoc registrarPoc =
persistSimpleResource(
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Jim Doe")
.setEmailAddress("jim.doe@example.com")
.setRegistryLockEmailAddress("jim.doe.registry.lock@example.com")
.setAllowedToSetRegistryLockPassword(true)
.setRegistryLockPassword("hi")
.build());
assertThat(registrarContact.verifyRegistryLockPassword("hi")).isTrue();
assertThat(registrarContact.verifyRegistryLockPassword("hello")).isFalse();
assertThat(registrarPoc.verifyRegistryLockPassword("hi")).isTrue();
assertThat(registrarPoc.verifyRegistryLockPassword("hello")).isFalse();
runCommandForced(
"--mode=UPDATE",
"--email=jim.doe@example.com",
"--allowed_to_set_registry_lock_password=true",
"NewRegistrar");
registrarContact = reloadResource(registrarContact);
assertThat(registrarContact.verifyRegistryLockPassword("hi")).isFalse();
registrarPoc = reloadResource(registrarPoc);
assertThat(registrarPoc.verifyRegistryLockPassword("hi")).isFalse();
}
@Test
@@ -33,7 +33,7 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSortedMap;
import google.registry.model.registrar.Registrar;
import google.registry.model.registrar.RegistrarContact;
import google.registry.model.registrar.RegistrarPoc;
import google.registry.model.tld.Registry;
import google.registry.model.tld.Registry.TldState;
import google.registry.testing.DeterministicStringGenerator;
@@ -109,13 +109,12 @@ class SetupOteCommandTest extends CommandTestCase<SetupOteCommand> {
}
private void verifyRegistrarContactCreation(String registrarName, String email) {
ImmutableSet<RegistrarContact> registrarContacts =
loadRegistrar(registrarName).getContacts();
assertThat(registrarContacts).hasSize(1);
RegistrarContact registrarContact = registrarContacts.stream().findAny().get();
assertThat(registrarContact.getEmailAddress()).isEqualTo(email);
assertThat(registrarContact.getName()).isEqualTo(email);
assertThat(registrarContact.getGaeUserId()).isNotNull();
ImmutableSet<RegistrarPoc> registrarPocs = loadRegistrar(registrarName).getContacts();
assertThat(registrarPocs).hasSize(1);
RegistrarPoc registrarPoc = registrarPocs.stream().findAny().get();
assertThat(registrarPoc.getEmailAddress()).isEqualTo(email);
assertThat(registrarPoc.getName()).isEqualTo(email);
assertThat(registrarPoc.getGaeUserId()).isNotNull();
}
@Test
@@ -32,7 +32,7 @@ import com.google.common.collect.ImmutableSetMultimap;
import google.registry.config.RegistryEnvironment;
import google.registry.model.registrar.Registrar;
import google.registry.model.registrar.RegistrarAddress;
import google.registry.model.registrar.RegistrarContact;
import google.registry.model.registrar.RegistrarPoc;
import google.registry.request.Action.Method;
import google.registry.request.auth.AuthLevel;
import google.registry.request.auth.AuthResult;
@@ -218,8 +218,8 @@ final class ConsoleRegistrarCreatorActionTest {
assertThat(registrar.getContacts())
.containsExactly(
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setGaeUserId("-1509175207")
.setGaeUserId(convertEmailAddressToGaeUserId("myclientid@registry.example"))
.setName("myclientid@registry.example")
@@ -23,8 +23,8 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables;
import google.registry.model.registrar.Registrar;
import google.registry.model.registrar.RegistrarContact;
import google.registry.model.registrar.RegistrarContact.Type;
import google.registry.model.registrar.RegistrarPoc;
import google.registry.model.registrar.RegistrarPoc.Type;
import google.registry.testing.AppEngineExtension;
import java.util.List;
import java.util.Map;
@@ -80,8 +80,7 @@ class ContactSettingsTest extends RegistrarSettingsActionTestCase {
action.handleJsonRequest(ImmutableMap.of("op", "update", "id", CLIENT_ID, "args", regMap));
assertThat(response).containsEntry("status", "SUCCESS");
RegistrarContact foundContact =
Iterables.getOnlyElement(loadRegistrar(CLIENT_ID).getContacts());
RegistrarPoc foundContact = Iterables.getOnlyElement(loadRegistrar(CLIENT_ID).getContacts());
assertThat(foundContact.getName()).isEqualTo(adminContact.get("name"));
assertThat(foundContact.getEmailAddress()).isEqualTo(adminContact.get("emailAddress"));
assertThat(foundContact.getPhoneNumber()).isEqualTo(adminContact.get("phoneNumber"));
@@ -130,7 +129,7 @@ class ContactSettingsTest extends RegistrarSettingsActionTestCase {
void testPost_updateContacts_cannotRemoveWhoisAbuseContact_error() {
// First make the contact's info visible in whois as abuse contact info.
Registrar registrar = loadRegistrar(CLIENT_ID);
RegistrarContact rc =
RegistrarPoc rc =
AppEngineExtension.makeRegistrarContact2()
.asBuilder()
.setVisibleInDomainWhoisAsAbuse(true)
@@ -157,7 +156,7 @@ class ContactSettingsTest extends RegistrarSettingsActionTestCase {
void testPost_updateContacts_whoisAbuseContactMustHavePhoneNumber_error() {
// First make the contact's info visible in whois as abuse contact info.
Registrar registrar = loadRegistrar(CLIENT_ID);
RegistrarContact rc =
RegistrarPoc rc =
AppEngineExtension.makeRegistrarContact2()
.asBuilder()
.setVisibleInDomainWhoisAsAbuse(true)
@@ -184,7 +183,7 @@ class ContactSettingsTest extends RegistrarSettingsActionTestCase {
void testSuccess_setRegistryLockPassword() {
addPasswordToContactTwo();
String emailAddress = AppEngineExtension.makeRegistrarContact2().getEmailAddress();
RegistrarContact newContactWithPassword =
RegistrarPoc newContactWithPassword =
loadRegistrar(CLIENT_ID).getContacts().stream()
.filter(rc -> rc.getEmailAddress().equals(emailAddress))
.findFirst()
@@ -197,7 +196,7 @@ class ContactSettingsTest extends RegistrarSettingsActionTestCase {
void testSuccess_setRegistryLockPassword_notOverriddenLater() {
addPasswordToContactTwo();
String emailAddress = AppEngineExtension.makeRegistrarContact2().getEmailAddress();
RegistrarContact newContactWithPassword =
RegistrarPoc newContactWithPassword =
loadRegistrar(CLIENT_ID).getContacts().stream()
.filter(rc -> rc.getEmailAddress().equals(emailAddress))
.findFirst()
@@ -226,7 +225,7 @@ class ContactSettingsTest extends RegistrarSettingsActionTestCase {
}
private void addPasswordToContactTwo() {
RegistrarContact contact =
RegistrarPoc contact =
persistResource(
AppEngineExtension.makeRegistrarContact2()
.asBuilder()
@@ -331,7 +330,7 @@ class ContactSettingsTest extends RegistrarSettingsActionTestCase {
addPasswordToContactTwo();
Map<String, Object> reqJson = loadRegistrar(CLIENT_ID).toJsonMap();
String emailAddress = AppEngineExtension.makeRegistrarContact2().getEmailAddress();
RegistrarContact newContactWithPassword =
RegistrarPoc newContactWithPassword =
loadRegistrar(CLIENT_ID).getContacts().stream()
.filter(rc -> rc.getEmailAddress().equals(emailAddress))
.findFirst()
@@ -37,7 +37,7 @@ import com.google.common.collect.ImmutableSortedMap;
import com.google.common.truth.Truth;
import google.registry.flows.certs.CertificateChecker;
import google.registry.model.ofy.Ofy;
import google.registry.model.registrar.RegistrarContact;
import google.registry.model.registrar.RegistrarPoc;
import google.registry.request.JsonActionRunner;
import google.registry.request.JsonResponse;
import google.registry.request.ResponseImpl;
@@ -94,7 +94,7 @@ public abstract class RegistrarSettingsActionTestCase {
final RegistrarSettingsAction action = new RegistrarSettingsAction();
private final StringWriter writer = new StringWriter();
RegistrarContact techContact;
RegistrarPoc techContact;
CloudTasksHelper cloudTasksHelper = new CloudTasksHelper();
@@ -107,7 +107,7 @@ public abstract class RegistrarSettingsActionTestCase {
// Add a technical contact to the registrar (in addition to the default admin contact created by
// AppEngineExtension).
techContact =
getOnlyElement(loadRegistrar(CLIENT_ID).getContactsOfType(RegistrarContact.Type.TECH));
getOnlyElement(loadRegistrar(CLIENT_ID).getContactsOfType(RegistrarPoc.Type.TECH));
action.registrarAccessor = null;
action.jsonActionRunner =
@@ -33,7 +33,7 @@ import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSetMultimap;
import com.google.gson.Gson;
import google.registry.model.domain.RegistryLock;
import google.registry.model.registrar.RegistrarContact;
import google.registry.model.registrar.RegistrarPoc;
import google.registry.request.Action.Method;
import google.registry.request.auth.AuthLevel;
import google.registry.request.auth.AuthResult;
@@ -70,7 +70,7 @@ final class RegistryLockGetActionTest {
@BeforeEach
void beforeEach() {
user = userFromRegistrarContact(AppEngineExtension.makeRegistrarContact3());
user = userFromRegistrarPoc(AppEngineExtension.makeRegistrarContact3());
fakeClock.setTo(DateTime.parse("2000-06-08T22:00:00.0Z"));
authResult = AuthResult.create(AuthLevel.USER, UserAuthInfo.create(user, false));
accessor =
@@ -356,8 +356,7 @@ final class RegistryLockGetActionTest {
assertThat(response.getStatus()).isEqualTo(SC_FORBIDDEN);
}
static User userFromRegistrarContact(RegistrarContact registrarContact) {
return new User(
registrarContact.getEmailAddress(), "gmail.com", registrarContact.getGaeUserId());
static User userFromRegistrarPoc(RegistrarPoc registrarPoc) {
return new User(registrarPoc.getEmailAddress(), "gmail.com", registrarPoc.getGaeUserId());
}
}
@@ -25,7 +25,7 @@ import static google.registry.testing.SqlHelper.getMostRecentRegistryLockByRepoI
import static google.registry.testing.SqlHelper.getRegistryLockByVerificationCode;
import static google.registry.testing.SqlHelper.saveRegistryLock;
import static google.registry.tools.LockOrUnlockDomainCommand.REGISTRY_LOCK_STATUSES;
import static google.registry.ui.server.registrar.RegistryLockGetActionTest.userFromRegistrarContact;
import static google.registry.ui.server.registrar.RegistryLockGetActionTest.userFromRegistrarPoc;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
@@ -99,8 +99,8 @@ final class RegistryLockPostActionTest {
@BeforeEach
void beforeEach() throws Exception {
userWithLockPermission = userFromRegistrarContact(AppEngineExtension.makeRegistrarContact3());
userWithoutPermission = userFromRegistrarContact(AppEngineExtension.makeRegistrarContact2());
userWithLockPermission = userFromRegistrarPoc(AppEngineExtension.makeRegistrarContact3());
userWithoutPermission = userFromRegistrarPoc(AppEngineExtension.makeRegistrarContact2());
createTld("tld");
domain = persistResource(newDomainBase("example.tld"));
@@ -314,7 +314,7 @@ final class RegistryLockPostActionTest {
}
@Test
void testFailure_notEnabledForRegistrarContact() {
void testFailure_notEnabledForRegistrarPoc() {
action =
createAction(
AuthResult.create(AuthLevel.USER, UserAuthInfo.create(userWithoutPermission, false)));
@@ -34,7 +34,7 @@ import google.registry.model.domain.DomainBase;
import google.registry.model.domain.RegistryLock;
import google.registry.model.ofy.OfyFilter;
import google.registry.model.registrar.Registrar.State;
import google.registry.model.registrar.RegistrarContact;
import google.registry.model.registrar.RegistrarPoc;
import google.registry.module.frontend.FrontendServlet;
import google.registry.server.RegistryTestServer;
import google.registry.testing.AppEngineExtension;
@@ -181,7 +181,7 @@ class RegistrarConsoleScreenshotTest extends WebDriverTestCase {
server.runInAppEngineEnvironment(
() -> {
RegistrarContact contact =
RegistrarPoc contact =
loadRegistrar("TheRegistrar").getContacts().stream()
.filter(c -> c.getEmailAddress().equals("johndoe@theregistrar.com"))
.findFirst()
@@ -25,7 +25,7 @@ import com.googlecode.objectify.ObjectifyFilter;
import google.registry.model.ofy.OfyFilter;
import google.registry.model.registrar.Registrar;
import google.registry.model.registrar.RegistrarAddress;
import google.registry.model.registrar.RegistrarContact;
import google.registry.model.registrar.RegistrarPoc;
import google.registry.module.frontend.FrontendServlet;
import google.registry.server.RegistryTestServer;
import org.junit.jupiter.api.extension.RegisterExtension;
@@ -179,10 +179,10 @@ public class RegistrarConsoleWebTest extends WebDriverTestCase {
void testContactSettingsView() throws Throwable {
driver.get(server.getUrl("/registrar#contact-settings"));
driver.waitForDisplayedElement(By.id("reg-app-btn-add"));
ImmutableList<RegistrarContact> contacts =
ImmutableList<RegistrarPoc> contacts =
server.runInAppEngineEnvironment(
() -> loadRegistrar("TheRegistrar").getContacts().asList());
for (RegistrarContact contact : contacts) {
for (RegistrarPoc contact : contacts) {
assertEltTextPresent(By.id("contacts[0].name"), contact.getName());
assertEltTextPresent(By.id("contacts[0].emailAddress"), contact.getEmailAddress());
assertEltTextPresent(By.id("contacts[0].phoneNumber"), contact.getPhoneNumber());
@@ -35,7 +35,7 @@ import google.registry.model.domain.secdns.DelegationSignerData;
import google.registry.model.eppcommon.StatusValue;
import google.registry.model.host.HostResource;
import google.registry.model.registrar.Registrar;
import google.registry.model.registrar.RegistrarContact;
import google.registry.model.registrar.RegistrarPoc;
import google.registry.persistence.VKey;
import google.registry.testing.AppEngineExtension;
import google.registry.testing.DualDatabaseTest;
@@ -55,7 +55,7 @@ class DomainWhoisResponseTest {
private HostResource hostResource1;
private HostResource hostResource2;
private RegistrarContact abuseContact;
private RegistrarPoc abuseContact;
private ContactResource adminContact;
private ContactResource registrant;
private ContactResource techContact;
@@ -74,14 +74,15 @@ class DomainWhoisResponseTest {
.setIanaIdentifier(5555555L)
.build());
abuseContact = persistResource(
new RegistrarContact.Builder()
.setParent(registrar)
.setName("Jake Doe")
.setEmailAddress("jakedoe@theregistrar.com")
.setPhoneNumber("+1.2125551216")
.setVisibleInDomainWhoisAsAbuse(true)
.build());
abuseContact =
persistResource(
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Jake Doe")
.setEmailAddress("jakedoe@theregistrar.com")
.setPhoneNumber("+1.2125551216")
.setVisibleInDomainWhoisAsAbuse(true)
.build());
createTld("tld");
@@ -24,7 +24,7 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import google.registry.model.registrar.Registrar;
import google.registry.model.registrar.RegistrarAddress;
import google.registry.model.registrar.RegistrarContact;
import google.registry.model.registrar.RegistrarPoc;
import google.registry.testing.AppEngineExtension;
import google.registry.testing.FakeClock;
import google.registry.whois.WhoisResponse.WhoisResponseResults;
@@ -64,50 +64,50 @@ class RegistrarWhoisResponseTest {
.setUrl("http://my.fake.url")
.build();
// Use the registrar key for contacts' parent.
ImmutableList<RegistrarContact> contacts =
ImmutableList<RegistrarPoc> contacts =
ImmutableList.of(
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Joe Registrar")
.setEmailAddress("joeregistrar@example-registrar.tld")
.setPhoneNumber("+1.3105551213")
.setFaxNumber("+1.3105551213")
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
.setVisibleInWhoisAsAdmin(true)
.setVisibleInWhoisAsTech(false)
.build(),
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("John Doe")
.setEmailAddress("johndoe@example-registrar.tld")
.setPhoneNumber("+1.1111111111")
.setFaxNumber("+1.1111111111")
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
.build(),
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Jane Registrar")
.setEmailAddress("janeregistrar@example-registrar.tld")
.setPhoneNumber("+1.3105551214")
.setFaxNumber("+1.3105551213")
.setTypes(ImmutableSet.of(RegistrarContact.Type.ADMIN))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.ADMIN))
.setVisibleInWhoisAsAdmin(true)
.build(),
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Jane Doe")
.setEmailAddress("janedoe@example-registrar.tld")
.setPhoneNumber("+1.1111111112")
.setFaxNumber("+1.1111111112")
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
.build(),
new RegistrarContact.Builder()
.setParent(registrar)
new RegistrarPoc.Builder()
.setRegistrar(registrar)
.setName("Bonnie & Clyde")
.setEmailAddress("johngeek@example-registrar.tld")
.setPhoneNumber("+1.3105551215")
.setFaxNumber("+1.3105551216")
.setTypes(ImmutableSet.of(RegistrarContact.Type.TECH))
.setTypes(ImmutableSet.of(RegistrarPoc.Type.TECH))
.setVisibleInWhoisAsTech(true)
.build());
persistResource(registrar);
@@ -17,5 +17,4 @@ PollMessage
RdeRevision
Recurring
Registrar
RegistrarContact
Registry
@@ -1,5 +1,4 @@
Cursor
Registrar
RegistrarContact
Registry
ServerSecret
@@ -13,5 +13,4 @@ OneTime
PollMessage
Recurring
Registrar
RegistrarContact
Registry
@@ -590,31 +590,6 @@ class google.registry.model.registrar.RegistrarAddress {
java.lang.String zip;
java.util.List<java.lang.String> street;
}
class google.registry.model.registrar.RegistrarContact {
@Id java.lang.String emailAddress;
@Parent com.googlecode.objectify.Key<google.registry.model.registrar.Registrar> parent;
boolean allowedToSetRegistryLockPassword;
boolean visibleInDomainWhoisAsAbuse;
boolean visibleInWhoisAsAdmin;
boolean visibleInWhoisAsTech;
java.lang.String faxNumber;
java.lang.String gaeUserId;
java.lang.String name;
java.lang.String phoneNumber;
java.lang.String registryLockEmailAddress;
java.lang.String registryLockPasswordHash;
java.lang.String registryLockPasswordSalt;
java.util.Set<google.registry.model.registrar.RegistrarContact$Type> types;
}
enum google.registry.model.registrar.RegistrarContact$Type {
ABUSE;
ADMIN;
BILLING;
LEGAL;
MARKETING;
TECH;
WHOIS;
}
class google.registry.model.replay.LastSqlTransaction {
@Id long id;
long transactionId;
@@ -11,9 +11,9 @@ emailAddress: the.registrar@example.com -> thase@the.registrar
url: http://my.fake.url -> http://my.new.url
contacts:
ADDED:
{parent=Key<?>(EntityGroupRoot("cross-tld")/Registrar("TheRegistrar")), name=Extra Terrestrial, emailAddress=etphonehome@example.com, registrarId=TheRegistrar, registryLockEmailAddress=null, phoneNumber=+1.2345678901, faxNumber=null, types=[ADMIN, BILLING, TECH, WHOIS], gaeUserId=null, visibleInWhoisAsAdmin=true, visibleInWhoisAsTech=false, visibleInDomainWhoisAsAbuse=false, allowedToSetRegistryLockPassword=false}
{name=Extra Terrestrial, emailAddress=etphonehome@example.com, registrarId=TheRegistrar, registryLockEmailAddress=null, phoneNumber=+1.2345678901, faxNumber=null, types=[ADMIN, BILLING, TECH, WHOIS], gaeUserId=null, visibleInWhoisAsAdmin=true, visibleInWhoisAsTech=false, visibleInDomainWhoisAsAbuse=false, allowedToSetRegistryLockPassword=false}
REMOVED:
{parent=Key<?>(EntityGroupRoot("cross-tld")/Registrar("TheRegistrar")), name=John Doe, emailAddress=johndoe@theregistrar.com, registrarId=TheRegistrar, registryLockEmailAddress=null, phoneNumber=+1.1234567890, faxNumber=null, types=[ADMIN], gaeUserId=31337, visibleInWhoisAsAdmin=false, visibleInWhoisAsTech=false, visibleInDomainWhoisAsAbuse=false, allowedToSetRegistryLockPassword=false}
{name=John Doe, emailAddress=johndoe@theregistrar.com, registrarId=TheRegistrar, registryLockEmailAddress=null, phoneNumber=+1.1234567890, faxNumber=null, types=[ADMIN], gaeUserId=31337, visibleInWhoisAsAdmin=false, visibleInWhoisAsTech=false, visibleInDomainWhoisAsAbuse=false, allowedToSetRegistryLockPassword=false}
FINAL CONTENTS:
{parent=Key<?>(EntityGroupRoot("cross-tld")/Registrar("TheRegistrar")), name=Extra Terrestrial, emailAddress=etphonehome@example.com, registrarId=TheRegistrar, registryLockEmailAddress=null, phoneNumber=+1.2345678901, faxNumber=null, types=[ADMIN, BILLING, TECH, WHOIS], gaeUserId=null, visibleInWhoisAsAdmin=true, visibleInWhoisAsTech=false, visibleInDomainWhoisAsAbuse=false, allowedToSetRegistryLockPassword=false},
{parent=Key<?>(EntityGroupRoot("cross-tld")/Registrar("TheRegistrar")), name=Marla Singer, emailAddress=Marla.Singer@crr.com, registrarId=TheRegistrar, registryLockEmailAddress=Marla.Singer.RegistryLock@crr.com, phoneNumber=+1.2128675309, faxNumber=null, types=[TECH], gaeUserId=12345, visibleInWhoisAsAdmin=false, visibleInWhoisAsTech=false, visibleInDomainWhoisAsAbuse=false, allowedToSetRegistryLockPassword=false}
{name=Extra Terrestrial, emailAddress=etphonehome@example.com, registrarId=TheRegistrar, registryLockEmailAddress=null, phoneNumber=+1.2345678901, faxNumber=null, types=[ADMIN, BILLING, TECH, WHOIS], gaeUserId=null, visibleInWhoisAsAdmin=true, visibleInWhoisAsTech=false, visibleInDomainWhoisAsAbuse=false, allowedToSetRegistryLockPassword=false},
{name=Marla Singer, emailAddress=Marla.Singer@crr.com, registrarId=TheRegistrar, registryLockEmailAddress=Marla.Singer.RegistryLock@crr.com, phoneNumber=+1.2128675309, faxNumber=null, types=[TECH], gaeUserId=12345, visibleInWhoisAsAdmin=false, visibleInWhoisAsTech=false, visibleInDomainWhoisAsAbuse=false, allowedToSetRegistryLockPassword=false}