mirror of
https://github.com/google/nomulus
synced 2026-02-18 10:59:11 +00:00
Compare commits
2 Commits
nomulus-20
...
nomulus-20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ff4d7dc8a | ||
|
|
88906f1bd9 |
@@ -143,15 +143,15 @@ public final class RegistryConfig {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the roid suffix to be used for the roids of all contacts and hosts. E.g. a value of
|
||||
* "ROID" would end up creating roids that look like "ABC123-ROID".
|
||||
* Returns the roid suffix to be used for the roids of all hosts. E.g. a value of "ROID" would
|
||||
* end up creating roids that look like "ABC123-ROID".
|
||||
*
|
||||
* @see <a href="http://www.iana.org/assignments/epp-repository-ids/epp-repository-ids.xhtml">
|
||||
* Extensible Provisioning Protocol (EPP) Repository Identifiers</a>
|
||||
*/
|
||||
@Provides
|
||||
@Config("contactAndHostRoidSuffix")
|
||||
public static String provideContactAndHostRoidSuffix(RegistryConfigSettings config) {
|
||||
@Config("hostRoidSuffix")
|
||||
public static String provideHostRoidSuffix(RegistryConfigSettings config) {
|
||||
return config.registryPolicy.contactAndHostRoidSuffix;
|
||||
}
|
||||
|
||||
@@ -1024,18 +1024,6 @@ public final class RegistryConfig {
|
||||
return Duration.standardSeconds(config.monitoring.writeIntervalSeconds);
|
||||
}
|
||||
|
||||
/**
|
||||
* The global automatic transfer length for contacts. After this amount of time has elapsed, the
|
||||
* transfer is automatically approved.
|
||||
*
|
||||
* @see google.registry.flows.contact.ContactTransferRequestFlow
|
||||
*/
|
||||
@Provides
|
||||
@Config("contactAutomaticTransferLength")
|
||||
public static Duration provideContactAutomaticTransferLength(RegistryConfigSettings config) {
|
||||
return Duration.standardDays(config.registryPolicy.contactAutomaticTransferDays);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the maximum number of entities that can be checked at one time in an EPP check flow.
|
||||
*/
|
||||
@@ -1623,15 +1611,11 @@ public final class RegistryConfig {
|
||||
return CONFIG_SETTINGS.get().hibernate.jdbcFetchSize;
|
||||
}
|
||||
|
||||
/** Returns the roid suffix to be used for the roids of all contacts and hosts. */
|
||||
public static String getContactAndHostRoidSuffix() {
|
||||
/** Returns the roid suffix to be used for the roids of all hosts. */
|
||||
public static String getHostRoidSuffix() {
|
||||
return CONFIG_SETTINGS.get().registryPolicy.contactAndHostRoidSuffix;
|
||||
}
|
||||
|
||||
/** Returns the global automatic transfer length for contacts. */
|
||||
public static Duration getContactAutomaticTransferLength() {
|
||||
return Duration.standardDays(CONFIG_SETTINGS.get().registryPolicy.contactAutomaticTransferDays);
|
||||
}
|
||||
|
||||
/** A discount for all sunrise domain creates, between 0.0 (no discount) and 1.0 (free). */
|
||||
public static double getSunriseDomainCreateDiscount() {
|
||||
|
||||
@@ -86,7 +86,6 @@ public class RegistryConfigSettings {
|
||||
public String productName;
|
||||
public String customLogicFactoryClass;
|
||||
public String dnsCountQueryCoordinatorClass;
|
||||
public int contactAutomaticTransferDays;
|
||||
public String greetingServerId;
|
||||
public List<String> registrarChangesNotificationEmailAddresses;
|
||||
public String defaultRegistrarWhoisServer;
|
||||
|
||||
@@ -63,9 +63,6 @@ registryPolicy:
|
||||
# See reporting/icann/DnsCountQueryCoordinator.java
|
||||
dnsCountQueryCoordinatorClass: google.registry.reporting.icann.DummyDnsCountQueryCoordinator
|
||||
|
||||
# Length of time after which contact transfers automatically conclude.
|
||||
contactAutomaticTransferDays: 5
|
||||
|
||||
# Server ID used in the 'svID' element of an EPP 'greeting'.
|
||||
greetingServerId: Nomulus Registry
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ public final class HostCreateFlow implements MutatingFlow {
|
||||
@Inject EppResponse.Builder responseBuilder;
|
||||
|
||||
@Inject
|
||||
@Config("contactAndHostRoidSuffix")
|
||||
@Config("hostRoidSuffix")
|
||||
String roidSuffix;
|
||||
|
||||
@Inject
|
||||
|
||||
@@ -85,9 +85,6 @@ final class CreateDomainCommand extends CreateOrUpdateDomainCommand {
|
||||
"domain", domain,
|
||||
"period", period,
|
||||
"nameservers", nameservers,
|
||||
"registrant", registrant,
|
||||
"admins", admins,
|
||||
"techs", techs,
|
||||
"password", password,
|
||||
"currency", currency,
|
||||
"price", cost,
|
||||
|
||||
@@ -21,7 +21,6 @@ import com.beust.jcommander.Parameter;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import google.registry.tools.params.NameserversParameter;
|
||||
import google.registry.tools.params.StringListParameter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
@@ -47,24 +46,6 @@ abstract class CreateOrUpdateDomainCommand extends MutatingEppToolCommand {
|
||||
validateWith = NameserversParameter.class)
|
||||
Set<String> nameservers = new HashSet<>();
|
||||
|
||||
@Parameter(
|
||||
names = {"-r", "--registrant"},
|
||||
description = "Domain registrant."
|
||||
)
|
||||
String registrant;
|
||||
|
||||
@Parameter(
|
||||
names = {"-a", "--admins"},
|
||||
description = "Comma-separated list of admin contacts.",
|
||||
listConverter = StringListParameter.class)
|
||||
List<String> admins = new ArrayList<>();
|
||||
|
||||
@Parameter(
|
||||
names = {"-t", "--techs"},
|
||||
description = "Comma-separated list of technical contacts.",
|
||||
listConverter = StringListParameter.class)
|
||||
List<String> techs = new ArrayList<>();
|
||||
|
||||
@Parameter(
|
||||
names = {"-p", "--password"},
|
||||
description = "Password."
|
||||
|
||||
@@ -15,11 +15,9 @@
|
||||
package google.registry.tools;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.common.collect.ImmutableSet.toImmutableSet;
|
||||
import static google.registry.model.domain.rgp.GracePeriodStatus.AUTO_RENEW;
|
||||
import static google.registry.model.eppcommon.StatusValue.PENDING_DELETE;
|
||||
import static google.registry.model.eppcommon.StatusValue.SERVER_UPDATE_PROHIBITED;
|
||||
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
||||
import static java.util.function.Predicate.isEqual;
|
||||
|
||||
import com.beust.jcommander.Parameter;
|
||||
@@ -30,7 +28,6 @@ import com.google.common.collect.Sets;
|
||||
import com.google.common.flogger.FluentLogger;
|
||||
import com.google.template.soy.data.SoyMapData;
|
||||
import google.registry.flows.ResourceFlowUtils;
|
||||
import google.registry.model.domain.DesignatedContact;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.GracePeriodBase;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
@@ -66,15 +63,6 @@ final class UpdateDomainCommand extends CreateOrUpdateDomainCommand {
|
||||
validateWith = NameserversParameter.class)
|
||||
private Set<String> addNameservers = new HashSet<>();
|
||||
|
||||
// TODO(b/184067241): enforce only one of each type of contact
|
||||
@Parameter(
|
||||
names = "--add_admins",
|
||||
description = "Admins to add. Cannot be set if --admins is set.")
|
||||
private List<String> addAdmins = new ArrayList<>();
|
||||
|
||||
@Parameter(names = "--add_techs", description = "Techs to add. Cannot be set if --techs is set.")
|
||||
private List<String> addTechs = new ArrayList<>();
|
||||
|
||||
@Parameter(
|
||||
names = "--add_statuses",
|
||||
description = "Statuses to add. Cannot be set if --statuses is set."
|
||||
@@ -97,18 +85,6 @@ final class UpdateDomainCommand extends CreateOrUpdateDomainCommand {
|
||||
validateWith = NameserversParameter.class)
|
||||
private Set<String> removeNameservers = new HashSet<>();
|
||||
|
||||
@Parameter(
|
||||
names = "--remove_admins",
|
||||
description = "Admins to remove. Cannot be set if --admins is set."
|
||||
)
|
||||
private List<String> removeAdmins = new ArrayList<>();
|
||||
|
||||
@Parameter(
|
||||
names = "--remove_techs",
|
||||
description = "Techs to remove. Cannot be set if --techs is set."
|
||||
)
|
||||
private List<String> removeTechs = new ArrayList<>();
|
||||
|
||||
@Parameter(
|
||||
names = "--remove_statuses",
|
||||
description = "Statuses to remove. Cannot be set if --statuses is set."
|
||||
@@ -154,16 +130,6 @@ final class UpdateDomainCommand extends CreateOrUpdateDomainCommand {
|
||||
} else {
|
||||
checkArgument(addNameservers.size() <= 13, "You can add at most 13 nameservers.");
|
||||
}
|
||||
if (!admins.isEmpty()) {
|
||||
checkArgument(
|
||||
addAdmins.isEmpty() && removeAdmins.isEmpty(),
|
||||
"If you provide the admins flag, you cannot use the add_admins and remove_admins flags.");
|
||||
}
|
||||
if (!techs.isEmpty()) {
|
||||
checkArgument(
|
||||
addTechs.isEmpty() && removeTechs.isEmpty(),
|
||||
"If you provide the techs flag, you cannot use the add_techs and remove_techs flags.");
|
||||
}
|
||||
if (!statuses.isEmpty()) {
|
||||
checkArgument(
|
||||
addStatuses.isEmpty() && removeStatuses.isEmpty(),
|
||||
@@ -197,16 +163,12 @@ final class UpdateDomainCommand extends CreateOrUpdateDomainCommand {
|
||||
domainName);
|
||||
|
||||
// Use TreeSets so that the results are always in the same order (this makes testing easier).
|
||||
Set<String> addAdminsThisDomain = new TreeSet<>(addAdmins);
|
||||
Set<String> removeAdminsThisDomain = new TreeSet<>(removeAdmins);
|
||||
Set<String> addTechsThisDomain = new TreeSet<>(addTechs);
|
||||
Set<String> removeTechsThisDomain = new TreeSet<>(removeTechs);
|
||||
Set<String> addNameserversThisDomain = new TreeSet<>(addNameservers);
|
||||
Set<String> removeNameserversThisDomain = new TreeSet<>(removeNameservers);
|
||||
Set<String> addStatusesThisDomain = new TreeSet<>(addStatuses);
|
||||
Set<String> removeStatusesThisDomain = new TreeSet<>(removeStatuses);
|
||||
|
||||
if (!nameservers.isEmpty() || !admins.isEmpty() || !techs.isEmpty() || !statuses.isEmpty()) {
|
||||
if (!nameservers.isEmpty() || !statuses.isEmpty()) {
|
||||
if (!nameservers.isEmpty()) {
|
||||
ImmutableSortedSet<String> existingNameservers = domain.loadNameserverHostNames();
|
||||
populateAddRemoveLists(
|
||||
@@ -223,27 +185,7 @@ final class UpdateDomainCommand extends CreateOrUpdateDomainCommand {
|
||||
"The resulting nameservers count for domain %s would be more than 13",
|
||||
domainName);
|
||||
}
|
||||
if (!admins.isEmpty() || !techs.isEmpty()) {
|
||||
ImmutableSet<String> existingAdmins =
|
||||
getContactsOfType(domain, DesignatedContact.Type.ADMIN);
|
||||
ImmutableSet<String> existingTechs =
|
||||
getContactsOfType(domain, DesignatedContact.Type.TECH);
|
||||
|
||||
if (!admins.isEmpty()) {
|
||||
populateAddRemoveLists(
|
||||
ImmutableSet.copyOf(admins),
|
||||
existingAdmins,
|
||||
addAdminsThisDomain,
|
||||
removeAdminsThisDomain);
|
||||
}
|
||||
if (!techs.isEmpty()) {
|
||||
populateAddRemoveLists(
|
||||
ImmutableSet.copyOf(techs),
|
||||
existingTechs,
|
||||
addTechsThisDomain,
|
||||
removeTechsThisDomain);
|
||||
}
|
||||
}
|
||||
if (!statuses.isEmpty()) {
|
||||
Set<String> currentStatusValues = new HashSet<>();
|
||||
for (StatusValue statusValue : domain.getStatusValues()) {
|
||||
@@ -259,17 +201,13 @@ final class UpdateDomainCommand extends CreateOrUpdateDomainCommand {
|
||||
|
||||
boolean add =
|
||||
(!addNameserversThisDomain.isEmpty()
|
||||
|| !addAdminsThisDomain.isEmpty()
|
||||
|| !addTechsThisDomain.isEmpty()
|
||||
|| !addStatusesThisDomain.isEmpty());
|
||||
|
||||
boolean remove =
|
||||
(!removeNameserversThisDomain.isEmpty()
|
||||
|| !removeAdminsThisDomain.isEmpty()
|
||||
|| !removeTechsThisDomain.isEmpty()
|
||||
|| !removeStatusesThisDomain.isEmpty());
|
||||
|
||||
boolean change = (registrant != null || password != null);
|
||||
boolean change = password != null;
|
||||
boolean secDns =
|
||||
(!addDsRecords.isEmpty()
|
||||
|| !removeDsRecords.isEmpty()
|
||||
@@ -297,16 +235,11 @@ final class UpdateDomainCommand extends CreateOrUpdateDomainCommand {
|
||||
"domain", domainName,
|
||||
"add", add,
|
||||
"addNameservers", addNameserversThisDomain,
|
||||
"addAdmins", addAdminsThisDomain,
|
||||
"addTechs", addTechsThisDomain,
|
||||
"addStatuses", addStatusesThisDomain,
|
||||
"remove", remove,
|
||||
"removeNameservers", removeNameserversThisDomain,
|
||||
"removeAdmins", removeAdminsThisDomain,
|
||||
"removeTechs", removeTechsThisDomain,
|
||||
"removeStatuses", removeStatusesThisDomain,
|
||||
"change", change,
|
||||
"registrant", registrant,
|
||||
"password", password,
|
||||
"secdns", secDns,
|
||||
"addDsRecords", DsRecord.convertToSoy(addDsRecords),
|
||||
@@ -337,13 +270,4 @@ final class UpdateDomainCommand extends CreateOrUpdateDomainCommand {
|
||||
addSet.addAll(Sets.difference(targetSet, oldSet));
|
||||
removeSet.addAll(Sets.difference(oldSet, targetSet));
|
||||
}
|
||||
|
||||
ImmutableSet<String> getContactsOfType(Domain domain, final DesignatedContact.Type contactType) {
|
||||
return tm().transact(
|
||||
() ->
|
||||
domain.getContacts().stream()
|
||||
.filter(contact -> contact.getType().equals(contactType))
|
||||
.map(contact -> tm().loadByKey(contact.getContactKey()).getContactId())
|
||||
.collect(toImmutableSet()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,16 +20,11 @@
|
||||
{@param domain: string}
|
||||
{@param add: bool}
|
||||
{@param addNameservers: list<string>}
|
||||
{@param addAdmins: list<string>}
|
||||
{@param addTechs: list<string>}
|
||||
{@param addStatuses: list<string>}
|
||||
{@param remove: bool}
|
||||
{@param removeNameservers: list<string>}
|
||||
{@param removeAdmins: list<string>}
|
||||
{@param removeTechs: list<string>}
|
||||
{@param removeStatuses: list<string>}
|
||||
{@param change: bool}
|
||||
{@param? registrant: string|null}
|
||||
{@param? password: string|null}
|
||||
{@param secdns: bool}
|
||||
{@param addDsRecords: list<[keyTag:int, alg:int, digestType:int, digest:string]>}
|
||||
@@ -54,12 +49,6 @@
|
||||
{/for}
|
||||
</domain:ns>
|
||||
{/if}
|
||||
{for $admin in $addAdmins}
|
||||
<domain:contact type="admin">{$admin}</domain:contact>
|
||||
{/for}
|
||||
{for $tech in $addTechs}
|
||||
<domain:contact type="tech">{$tech}</domain:contact>
|
||||
{/for}
|
||||
{for $status in $addStatuses}
|
||||
<domain:status s="{$status}"/>
|
||||
{/for}
|
||||
@@ -74,12 +63,6 @@
|
||||
{/for}
|
||||
</domain:ns>
|
||||
{/if}
|
||||
{for $admin in $removeAdmins}
|
||||
<domain:contact type="admin">{$admin}</domain:contact>
|
||||
{/for}
|
||||
{for $tech in $removeTechs}
|
||||
<domain:contact type="tech">{$tech}</domain:contact>
|
||||
{/for}
|
||||
{for $status in $removeStatuses}
|
||||
<domain:status s="{$status}"/>
|
||||
{/for}
|
||||
@@ -87,9 +70,6 @@
|
||||
{/if}
|
||||
{if $change}
|
||||
<domain:chg>
|
||||
{if $registrant}
|
||||
<domain:registrant>{$registrant}</domain:registrant>
|
||||
{/if}
|
||||
{if $password}
|
||||
<domain:authInfo>
|
||||
<domain:pw>{$password}</domain:pw>
|
||||
|
||||
@@ -36,7 +36,6 @@ import com.google.common.collect.ImmutableSortedMap;
|
||||
import com.google.common.collect.Sets;
|
||||
import google.registry.model.billing.BillingBase.RenewalPriceBehavior;
|
||||
import google.registry.model.contact.Contact;
|
||||
import google.registry.model.domain.DesignatedContact.Type;
|
||||
import google.registry.model.domain.fee.FeeQueryCommandExtensionItem.CommandName;
|
||||
import google.registry.model.domain.launch.LaunchNotice;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
@@ -53,7 +52,6 @@ import google.registry.persistence.transaction.JpaTestExtensions.JpaIntegrationW
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.util.SerializeUtils;
|
||||
import java.util.Arrays;
|
||||
import java.util.Optional;
|
||||
import org.joda.money.CurrencyUnit;
|
||||
import org.joda.money.Money;
|
||||
import org.joda.time.DateTime;
|
||||
@@ -71,12 +69,8 @@ public class DomainSqlTest {
|
||||
new JpaTestExtensions.Builder().withClock(fakeClock).buildIntegrationWithCoverageExtension();
|
||||
|
||||
private Domain domain;
|
||||
private Optional<VKey<Contact>> contactKey;
|
||||
private VKey<Contact> contact2Key;
|
||||
private VKey<Host> host1VKey;
|
||||
private Host host;
|
||||
private Contact contact;
|
||||
private Contact contact2;
|
||||
private AllocationToken allocationToken;
|
||||
|
||||
@BeforeEach
|
||||
@@ -84,9 +78,6 @@ public class DomainSqlTest {
|
||||
saveRegistrar("registrar1");
|
||||
saveRegistrar("registrar2");
|
||||
saveRegistrar("registrar3");
|
||||
contactKey = Optional.of(createKey(Contact.class, "contact_id1"));
|
||||
contact2Key = createKey(Contact.class, "contact_id2");
|
||||
|
||||
host1VKey = createKey(Host.class, "host1");
|
||||
|
||||
domain =
|
||||
@@ -106,8 +97,6 @@ public class DomainSqlTest {
|
||||
StatusValue.SERVER_UPDATE_PROHIBITED,
|
||||
StatusValue.SERVER_RENEW_PROHIBITED,
|
||||
StatusValue.SERVER_HOLD))
|
||||
.setRegistrant(contactKey)
|
||||
.setContacts(ImmutableSet.of(DesignatedContact.create(Type.ADMIN, contact2Key)))
|
||||
.setSubordinateHosts(ImmutableSet.of("ns1.example.com"))
|
||||
.setPersistedCurrentSponsorRegistrarId("registrar3")
|
||||
.setRegistrationExpirationTime(fakeClock.nowUtc().plusYears(1))
|
||||
@@ -128,8 +117,6 @@ public class DomainSqlTest {
|
||||
.setCreationRegistrarId("registrar1")
|
||||
.setPersistedCurrentSponsorRegistrarId("registrar2")
|
||||
.build();
|
||||
contact = makeContact("contact_id1");
|
||||
contact2 = makeContact("contact_id2");
|
||||
|
||||
allocationToken =
|
||||
new AllocationToken.Builder()
|
||||
@@ -168,7 +155,7 @@ public class DomainSqlTest {
|
||||
@Test
|
||||
void testHostForeignKeyConstraints() {
|
||||
// Persist the domain without the associated host object.
|
||||
assertThrowForeignKeyViolation(() -> persistResources(contact, contact2, domain));
|
||||
assertThrowForeignKeyViolation(() -> persistResources(domain));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -357,7 +344,7 @@ public class DomainSqlTest {
|
||||
@Test
|
||||
void testSerializable() {
|
||||
createTld("com");
|
||||
persistResources(contact, contact2, domain, host);
|
||||
persistResources(domain, host);
|
||||
Domain persisted = tm().transact(() -> tm().loadByEntity(domain));
|
||||
assertThat(SerializeUtils.serializeDeserialize(persisted)).isEqualTo(persisted);
|
||||
}
|
||||
@@ -365,7 +352,7 @@ public class DomainSqlTest {
|
||||
@Test
|
||||
void testUpdates() {
|
||||
createTld("com");
|
||||
persistResources(contact, contact2, domain, host);
|
||||
persistResources(domain, host);
|
||||
domain = domain.asBuilder().setNameservers(ImmutableSet.of()).build();
|
||||
persistResource(domain);
|
||||
assertAboutImmutableObjects()
|
||||
@@ -384,7 +371,7 @@ public class DomainSqlTest {
|
||||
|
||||
private void persistDomain() {
|
||||
createTld("com");
|
||||
persistResources(contact, contact2, domain, host);
|
||||
persistResources(domain, host);
|
||||
}
|
||||
|
||||
private <T> VKey<T> createKey(Class<T> clazz, String key) {
|
||||
|
||||
@@ -23,7 +23,6 @@ import static google.registry.model.domain.token.AllocationToken.TokenType.SINGL
|
||||
import static google.registry.testing.DatabaseHelper.cloneAndSetAutoTimestamps;
|
||||
import static google.registry.testing.DatabaseHelper.createTld;
|
||||
import static google.registry.testing.DatabaseHelper.newHost;
|
||||
import static google.registry.testing.DatabaseHelper.persistActiveContact;
|
||||
import static google.registry.testing.DatabaseHelper.persistActiveDomain;
|
||||
import static google.registry.testing.DatabaseHelper.persistActiveHost;
|
||||
import static google.registry.testing.DatabaseHelper.persistResource;
|
||||
@@ -49,8 +48,6 @@ import google.registry.model.billing.BillingBase.Flag;
|
||||
import google.registry.model.billing.BillingBase.Reason;
|
||||
import google.registry.model.billing.BillingEvent;
|
||||
import google.registry.model.billing.BillingRecurrence;
|
||||
import google.registry.model.contact.Contact;
|
||||
import google.registry.model.domain.DesignatedContact.Type;
|
||||
import google.registry.model.domain.fee.FeeQueryCommandExtensionItem.CommandName;
|
||||
import google.registry.model.domain.launch.LaunchNotice;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
@@ -91,7 +88,6 @@ public class DomainTest {
|
||||
private VKey<BillingEvent> oneTimeBillKey;
|
||||
private VKey<BillingRecurrence> recurrenceBillKey;
|
||||
private DomainHistory domainHistory;
|
||||
private VKey<Contact> contact1Key, contact2Key;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
@@ -102,8 +98,6 @@ public class DomainTest {
|
||||
createTld("com");
|
||||
domain = persistActiveDomain("example.com");
|
||||
VKey<Host> hostKey = persistActiveHost("ns1.example.com").createVKey();
|
||||
contact1Key = persistActiveContact("contact_id1").createVKey();
|
||||
contact2Key = persistActiveContact("contact_id1").createVKey();
|
||||
domainHistory =
|
||||
persistResource(
|
||||
new DomainHistory.Builder()
|
||||
@@ -185,7 +179,6 @@ public class DomainTest {
|
||||
StatusValue.SERVER_UPDATE_PROHIBITED,
|
||||
StatusValue.SERVER_RENEW_PROHIBITED,
|
||||
StatusValue.SERVER_HOLD))
|
||||
.setRegistrant(Optional.of(contact1Key))
|
||||
.setNameservers(ImmutableSet.of(hostKey))
|
||||
.setSubordinateHosts(ImmutableSet.of("ns1.example.com"))
|
||||
.setPersistedCurrentSponsorRegistrarId("NewRegistrar")
|
||||
@@ -1015,51 +1008,6 @@ public class DomainTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void testContactFields() {
|
||||
VKey<Contact> contact3Key = persistActiveContact("contact_id3").createVKey();
|
||||
VKey<Contact> contact4Key = persistActiveContact("contact_id4").createVKey();
|
||||
|
||||
// Set all of the contacts.
|
||||
domain.setContactFields(
|
||||
ImmutableSet.of(
|
||||
DesignatedContact.create(Type.REGISTRANT, contact1Key),
|
||||
DesignatedContact.create(Type.ADMIN, contact2Key),
|
||||
DesignatedContact.create(Type.BILLING, contact3Key),
|
||||
DesignatedContact.create(Type.TECH, contact4Key)),
|
||||
true);
|
||||
assertThat(domain.getRegistrant()).hasValue(contact1Key);
|
||||
assertThat(domain.getAdminContact()).hasValue(contact2Key);
|
||||
assertThat(domain.getBillingContact()).hasValue(contact3Key);
|
||||
assertThat(domain.getTechContact()).hasValue(contact4Key);
|
||||
|
||||
// Make sure everything gets nulled out.
|
||||
domain.setContactFields(ImmutableSet.of(), true);
|
||||
assertThat(domain.getRegistrant()).isEmpty();
|
||||
assertThat(domain.getAdminContact()).isEmpty();
|
||||
assertThat(domain.getBillingContact()).isEmpty();
|
||||
assertThat(domain.getTechContact()).isEmpty();
|
||||
|
||||
// Make sure that changes don't affect the registrant unless requested.
|
||||
domain.setContactFields(
|
||||
ImmutableSet.of(
|
||||
DesignatedContact.create(Type.REGISTRANT, contact1Key),
|
||||
DesignatedContact.create(Type.ADMIN, contact2Key),
|
||||
DesignatedContact.create(Type.BILLING, contact3Key),
|
||||
DesignatedContact.create(Type.TECH, contact4Key)),
|
||||
false);
|
||||
assertThat(domain.getRegistrant()).isEmpty();
|
||||
assertThat(domain.getAdminContact()).hasValue(contact2Key);
|
||||
assertThat(domain.getBillingContact()).hasValue(contact3Key);
|
||||
assertThat(domain.getTechContact()).hasValue(contact4Key);
|
||||
domain = domain.asBuilder().setRegistrant(Optional.of(contact1Key)).build();
|
||||
domain.setContactFields(ImmutableSet.of(), false);
|
||||
assertThat(domain.getRegistrant()).hasValue(contact1Key);
|
||||
assertThat(domain.getAdminContact()).isEmpty();
|
||||
assertThat(domain.getBillingContact()).isEmpty();
|
||||
assertThat(domain.getTechContact()).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFail_currentBulkTokenWrongTokenType() {
|
||||
AllocationToken allocationToken =
|
||||
|
||||
@@ -76,7 +76,7 @@ class RdapDomainActionTest extends RdapActionBaseTestCase<RdapDomainAction> {
|
||||
makeAndPersistHost(
|
||||
"ns2.cat.lol", "bad:f00d:cafe:0:0:0:15:beef", clock.nowUtc().minusYears(2));
|
||||
persistResource(
|
||||
makeDomain("cat.lol", null, null, null, host1, host2, registrarLol)
|
||||
makeDomain("cat.lol", host1, host2, registrarLol)
|
||||
.asBuilder()
|
||||
.setCreationTimeForTest(clock.nowUtc().minusYears(3))
|
||||
.setCreationRegistrarId("TheRegistrar")
|
||||
@@ -88,7 +88,7 @@ class RdapDomainActionTest extends RdapActionBaseTestCase<RdapDomainAction> {
|
||||
"ns2.dodo.lol", "bad:f00d:cafe:0:0:0:15:beef", clock.nowUtc().minusYears(2));
|
||||
Domain domainDeleted =
|
||||
persistResource(
|
||||
makeDomain("dodo.lol", null, null, null, host1, hostDodo2, registrarLol)
|
||||
makeDomain("dodo.lol", host1, hostDodo2, registrarLol)
|
||||
.asBuilder()
|
||||
.setCreationTimeForTest(clock.nowUtc().minusYears(3))
|
||||
.setCreationRegistrarId("TheRegistrar")
|
||||
@@ -100,7 +100,7 @@ class RdapDomainActionTest extends RdapActionBaseTestCase<RdapDomainAction> {
|
||||
persistResource(makeRegistrar("idnregistrar", "IDN Registrar", Registrar.State.ACTIVE));
|
||||
persistResources(makeRegistrarPocs(registrarIdn));
|
||||
persistResource(
|
||||
makeDomain("cat.みんな", null, null, null, host1, host2, registrarIdn)
|
||||
makeDomain("cat.みんな", host1, host2, registrarIdn)
|
||||
.asBuilder()
|
||||
.setCreationTimeForTest(clock.nowUtc().minusYears(3))
|
||||
.setCreationRegistrarId("TheRegistrar")
|
||||
@@ -113,7 +113,7 @@ class RdapDomainActionTest extends RdapActionBaseTestCase<RdapDomainAction> {
|
||||
makeRegistrar("1tldregistrar", "Multilevel Registrar", Registrar.State.ACTIVE));
|
||||
persistResources(makeRegistrarPocs(registrar1Tld));
|
||||
persistResource(
|
||||
makeDomain("cat.1.tld", null, null, null, host1, host2, registrar1Tld)
|
||||
makeDomain("cat.1.tld", host1, host2, registrar1Tld)
|
||||
.asBuilder()
|
||||
.setCreationTimeForTest(clock.nowUtc().minusYears(3))
|
||||
.setCreationRegistrarId("TheRegistrar")
|
||||
|
||||
@@ -137,7 +137,7 @@ class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDomainSear
|
||||
"ns2.cat.lol", "bad:f00d:cafe:0:0:0:15:beef", clock.nowUtc().minusYears(2)));
|
||||
domainCatLol =
|
||||
persistResource(
|
||||
makeDomain("cat.lol", null, null, null, hostNs1CatLol, hostNs2CatLol, registrar)
|
||||
makeDomain("cat.lol", hostNs1CatLol, hostNs2CatLol, registrar)
|
||||
.asBuilder()
|
||||
.setSubordinateHosts(ImmutableSet.of("ns1.cat.lol", "ns2.cat.lol"))
|
||||
.setCreationTimeForTest(clock.nowUtc().minusYears(3))
|
||||
@@ -152,9 +152,6 @@ class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDomainSear
|
||||
persistResource(
|
||||
makeDomain(
|
||||
"cat2.lol",
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
addHostToMap(
|
||||
FullFieldsTestEntityHelper.makeAndPersistHost(
|
||||
"ns1.cat.example", "10.20.30.40", clock.nowUtc().minusYears(1))),
|
||||
@@ -178,9 +175,6 @@ class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDomainSear
|
||||
persistResource(
|
||||
makeDomain(
|
||||
"cat.example",
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
hostNs1CatLol,
|
||||
addHostToMap(
|
||||
FullFieldsTestEntityHelper.makeAndPersistHost(
|
||||
@@ -200,9 +194,6 @@ class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDomainSear
|
||||
persistResource(
|
||||
makeDomain(
|
||||
"cat.みんな",
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
addHostToMap(
|
||||
FullFieldsTestEntityHelper.makeAndPersistHost(
|
||||
"ns1.cat.みんな", "1.2.3.5", clock.nowUtc().minusYears(1))),
|
||||
@@ -224,9 +215,6 @@ class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDomainSear
|
||||
persistResource(
|
||||
makeDomain(
|
||||
"cat.1.test",
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
addHostToMap(
|
||||
FullFieldsTestEntityHelper.makeAndPersistHost(
|
||||
"ns1.cat.1.test", "1.2.3.5", clock.nowUtc().minusYears(1))),
|
||||
@@ -336,7 +324,7 @@ class RdapDomainSearchActionTest extends RdapSearchActionTestCase<RdapDomainSear
|
||||
for (int i = numActiveDomains * numTotalDomainsPerActiveDomain; i >= 1; i--) {
|
||||
String domainName = String.format("domain%d.lol", i);
|
||||
Domain.Builder builder =
|
||||
makeDomain(domainName, null, null, null, null, null, registrar)
|
||||
makeDomain(domainName, null, null, registrar)
|
||||
.asBuilder()
|
||||
.setNameservers(hostKeys)
|
||||
.setCreationTimeForTest(clock.nowUtc().minusYears(3))
|
||||
|
||||
@@ -54,7 +54,7 @@ class RdapEntityActionTest extends RdapActionBaseTestCase<RdapEntityAction> {
|
||||
persistResources(makeRegistrarPocs(registrarLol));
|
||||
Host host1 = persistResource(makeHost("ns1.cat.lol", "1.2.3.4"));
|
||||
Host host2 = persistResource(makeHost("ns2.cat.lol", "bad:f00d:cafe:0:0:0:15:beef"));
|
||||
persistResource(makeDomain("cat.lol", null, null, null, host1, host2, registrarLol));
|
||||
persistResource(makeDomain("cat.lol", host1, host2, registrarLol));
|
||||
// xn--q9jyb4c
|
||||
createTld("xn--q9jyb4c");
|
||||
Registrar registrarIdn = persistResource(
|
||||
|
||||
@@ -114,9 +114,7 @@ class RdapJsonFormatterTest {
|
||||
"ns5.cat.みんな", null, null, clock.nowUtc().minusYears(5), "unicoderegistrar");
|
||||
// Create an unused domain that references hostBoth and hostNoAddresses so that
|
||||
// they will have "associated" (ie, StatusValue.LINKED) status.
|
||||
Domain dog =
|
||||
persistResource(
|
||||
makeDomain("dog.みんな", null, null, null, hostBoth, hostNoAddresses, registrar));
|
||||
Domain dog = persistResource(makeDomain("dog.みんな", hostBoth, hostNoAddresses, registrar));
|
||||
hostSuperordinatePendingTransfer =
|
||||
persistResource(
|
||||
makeAndPersistHost(
|
||||
@@ -142,14 +140,14 @@ class RdapJsonFormatterTest {
|
||||
.build());
|
||||
domainFull =
|
||||
persistResource(
|
||||
makeDomain("cat.みんな", null, null, null, hostIpv4, hostIpv6, registrar)
|
||||
makeDomain("cat.みんな", hostIpv4, hostIpv6, registrar)
|
||||
.asBuilder()
|
||||
.setCreationTimeForTest(clock.nowUtc().minusMonths(4))
|
||||
.setLastEppUpdateTime(clock.nowUtc().minusMonths(3))
|
||||
.build());
|
||||
domainNoNameserversNoTransfers =
|
||||
persistResource(
|
||||
makeDomain("fish.みんな", null, null, null, null, null, registrar)
|
||||
makeDomain("fish.みんな", null, null, registrar)
|
||||
.asBuilder()
|
||||
.setCreationTimeForTest(clock.nowUtc())
|
||||
.setLastEppUpdateTime(null)
|
||||
|
||||
@@ -131,7 +131,7 @@ class RdapNameserverSearchActionTest extends RdapSearchActionTestCase<RdapNamese
|
||||
// create a domain so that we can use it as a test nameserver search string suffix
|
||||
domainCatLol =
|
||||
persistResource(
|
||||
makeDomain("cat.lol", null, null, null, hostNs1CatLol, hostNs2CatLol, registrar)
|
||||
makeDomain("cat.lol", hostNs1CatLol, hostNs2CatLol, registrar)
|
||||
.asBuilder()
|
||||
.setSubordinateHosts(ImmutableSet.of("ns1.cat.lol", "ns2.cat.lol"))
|
||||
.build());
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
package google.registry.rde;
|
||||
|
||||
import static com.google.common.io.BaseEncoding.base16;
|
||||
import static google.registry.testing.DatabaseHelper.generateNewContactHostRoid;
|
||||
import static google.registry.testing.DatabaseHelper.generateNewDomainRoid;
|
||||
import static google.registry.testing.DatabaseHelper.generateNewHostRoid;
|
||||
import static google.registry.testing.DatabaseHelper.persistResource;
|
||||
import static google.registry.util.DateTimeUtils.END_OF_TIME;
|
||||
import static org.joda.money.CurrencyUnit.USD;
|
||||
@@ -226,7 +226,7 @@ final class RdeFixtures {
|
||||
return persistResource(
|
||||
new Contact.Builder()
|
||||
.setContactId(id)
|
||||
.setRepoId(generateNewContactHostRoid())
|
||||
.setRepoId(generateNewHostRoid())
|
||||
.setEmailAddress(email)
|
||||
.setStatusValues(ImmutableSet.of(StatusValue.OK))
|
||||
.setPersistedCurrentSponsorRegistrarId("GetTheeBack")
|
||||
@@ -256,7 +256,7 @@ final class RdeFixtures {
|
||||
clock.advanceOneMilli();
|
||||
return persistResource(
|
||||
new Host.Builder()
|
||||
.setRepoId(generateNewContactHostRoid())
|
||||
.setRepoId(generateNewHostRoid())
|
||||
.setCreationRegistrarId("LawyerCat")
|
||||
.setCreationTimeForTest(clock.nowUtc())
|
||||
.setPersistedCurrentSponsorRegistrarId("BusinessCat")
|
||||
|
||||
@@ -14,28 +14,19 @@
|
||||
|
||||
package google.registry.server;
|
||||
|
||||
import static google.registry.model.domain.DesignatedContact.Type.ADMIN;
|
||||
import static google.registry.model.domain.DesignatedContact.Type.BILLING;
|
||||
import static google.registry.model.domain.DesignatedContact.Type.TECH;
|
||||
import static google.registry.testing.DatabaseHelper.createTlds;
|
||||
import static google.registry.testing.DatabaseHelper.loadRegistrar;
|
||||
import static google.registry.testing.DatabaseHelper.newContact;
|
||||
import static google.registry.testing.DatabaseHelper.persistActiveHost;
|
||||
import static google.registry.testing.DatabaseHelper.persistPremiumList;
|
||||
import static google.registry.testing.DatabaseHelper.persistResource;
|
||||
import static org.joda.money.CurrencyUnit.USD;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import google.registry.model.OteStatsTestHelper;
|
||||
import google.registry.model.console.RegistrarRole;
|
||||
import google.registry.model.console.User;
|
||||
import google.registry.model.console.UserRoles;
|
||||
import google.registry.model.contact.Contact;
|
||||
import google.registry.model.contact.ContactAddress;
|
||||
import google.registry.model.contact.PostalInfo;
|
||||
import google.registry.model.domain.DesignatedContact;
|
||||
import google.registry.testing.DatabaseHelper;
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -63,78 +54,9 @@ public enum Fixture {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
Contact google =
|
||||
persistResource(
|
||||
newContact("google")
|
||||
.asBuilder()
|
||||
.setLocalizedPostalInfo(
|
||||
new PostalInfo.Builder()
|
||||
.setType(PostalInfo.Type.LOCALIZED)
|
||||
.setName("Mr. Google")
|
||||
.setOrg("Google Inc.")
|
||||
.setAddress(
|
||||
new ContactAddress.Builder()
|
||||
.setStreet(ImmutableList.of("111 8th Ave", "4th Floor"))
|
||||
.setCity("New York")
|
||||
.setState("NY")
|
||||
.setZip("10011")
|
||||
.setCountryCode("US")
|
||||
.build())
|
||||
.build())
|
||||
.build());
|
||||
|
||||
Contact justine =
|
||||
persistResource(
|
||||
newContact("justine")
|
||||
.asBuilder()
|
||||
.setLocalizedPostalInfo(
|
||||
new PostalInfo.Builder()
|
||||
.setType(PostalInfo.Type.LOCALIZED)
|
||||
.setName("Justine Bean")
|
||||
.setOrg("(✿◕ ‿◕ )ノ Incorporated")
|
||||
.setAddress(
|
||||
new ContactAddress.Builder()
|
||||
.setStreet(ImmutableList.of("123 Fake St."))
|
||||
.setCity("Stratford")
|
||||
.setState("CT")
|
||||
.setZip("06615")
|
||||
.setCountryCode("US")
|
||||
.build())
|
||||
.build())
|
||||
.build());
|
||||
|
||||
Contact robert =
|
||||
persistResource(
|
||||
newContact("robert")
|
||||
.asBuilder()
|
||||
.setLocalizedPostalInfo(
|
||||
new PostalInfo.Builder()
|
||||
.setType(PostalInfo.Type.LOCALIZED)
|
||||
.setName("Captain Robert")
|
||||
.setOrg("Ancient World")
|
||||
.setAddress(
|
||||
new ContactAddress.Builder()
|
||||
.setStreet(
|
||||
ImmutableList.of(
|
||||
"A skeleton crew is what came back",
|
||||
"And once in port he filled his sack",
|
||||
"With bribes and cash and fame and coin"))
|
||||
.setCity("Things to make a new crew join")
|
||||
.setState("NY")
|
||||
.setZip("10011")
|
||||
.setCountryCode("US")
|
||||
.build())
|
||||
.build())
|
||||
.build());
|
||||
|
||||
persistResource(
|
||||
DatabaseHelper.newDomain("love.xn--q9jyb4c", justine)
|
||||
DatabaseHelper.newDomain("love.xn--q9jyb4c")
|
||||
.asBuilder()
|
||||
.setContacts(
|
||||
ImmutableSet.of(
|
||||
DesignatedContact.create(ADMIN, robert.createVKey()),
|
||||
DesignatedContact.create(BILLING, google.createVKey()),
|
||||
DesignatedContact.create(TECH, justine.createVKey())))
|
||||
.setNameservers(
|
||||
ImmutableSet.of(
|
||||
persistActiveHost("ns1.love.xn--q9jyb4c").createVKey(),
|
||||
@@ -142,13 +64,8 @@ public enum Fixture {
|
||||
.build());
|
||||
|
||||
persistResource(
|
||||
DatabaseHelper.newDomain("moogle.example", justine)
|
||||
DatabaseHelper.newDomain("moogle.example")
|
||||
.asBuilder()
|
||||
.setContacts(
|
||||
ImmutableSet.of(
|
||||
DesignatedContact.create(ADMIN, robert.createVKey()),
|
||||
DesignatedContact.create(BILLING, google.createVKey()),
|
||||
DesignatedContact.create(TECH, justine.createVKey())))
|
||||
.setNameservers(
|
||||
ImmutableSet.of(
|
||||
persistActiveHost("ns1.linode.com").createVKey(),
|
||||
|
||||
@@ -24,7 +24,7 @@ import static com.google.common.collect.Iterables.toArray;
|
||||
import static com.google.common.collect.MoreCollectors.onlyElement;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth.assertWithMessage;
|
||||
import static google.registry.config.RegistryConfig.getContactAndHostRoidSuffix;
|
||||
import static google.registry.config.RegistryConfig.getHostRoidSuffix;
|
||||
import static google.registry.model.EppResourceUtils.createDomainRepoId;
|
||||
import static google.registry.model.EppResourceUtils.createRepoId;
|
||||
import static google.registry.model.ImmutableObjectSubject.assertAboutImmutableObjects;
|
||||
@@ -150,7 +150,7 @@ public final class DatabaseHelper {
|
||||
}
|
||||
|
||||
public static Host newHost(String hostName) {
|
||||
return newHostWithRoid(hostName, generateNewContactHostRoid());
|
||||
return newHostWithRoid(hostName, generateNewHostRoid());
|
||||
}
|
||||
|
||||
public static Host newHostWithRoid(String hostName, String repoId) {
|
||||
@@ -201,7 +201,7 @@ public final class DatabaseHelper {
|
||||
* an auto-generated repoId.
|
||||
*/
|
||||
public static Contact newContact(String contactId) {
|
||||
return newContactWithRoid(contactId, generateNewContactHostRoid());
|
||||
return newContactWithRoid(contactId, generateNewHostRoid());
|
||||
}
|
||||
|
||||
public static Contact newContactWithRoid(String contactId, String repoId) {
|
||||
@@ -924,8 +924,8 @@ public final class DatabaseHelper {
|
||||
}
|
||||
|
||||
/** Returns a newly allocated, globally unique contact/host repoId of the format HEX_TLD-ROID. */
|
||||
public static String generateNewContactHostRoid() {
|
||||
return createRepoId(tm().reTransact(tm()::allocateId), getContactAndHostRoidSuffix());
|
||||
public static String generateNewHostRoid() {
|
||||
return createRepoId(tm().reTransact(tm()::allocateId), getHostRoidSuffix());
|
||||
}
|
||||
|
||||
/** Persists an object in the DB for tests. */
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
|
||||
package google.registry.testing;
|
||||
|
||||
import static google.registry.testing.DatabaseHelper.generateNewContactHostRoid;
|
||||
import static google.registry.testing.DatabaseHelper.generateNewDomainRoid;
|
||||
import static google.registry.testing.DatabaseHelper.generateNewHostRoid;
|
||||
import static google.registry.testing.DatabaseHelper.persistResource;
|
||||
import static google.registry.util.DomainNameUtils.getTldFromDomainName;
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
@@ -24,11 +24,6 @@ import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.net.InetAddresses;
|
||||
import google.registry.model.EppResource;
|
||||
import google.registry.model.contact.Contact;
|
||||
import google.registry.model.contact.ContactAddress;
|
||||
import google.registry.model.contact.ContactPhoneNumber;
|
||||
import google.registry.model.contact.PostalInfo;
|
||||
import google.registry.model.domain.DesignatedContact;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.Period;
|
||||
@@ -43,8 +38,6 @@ import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.persistence.VKey;
|
||||
import google.registry.util.Idn;
|
||||
import java.net.InetAddress;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import javax.annotation.Nullable;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
@@ -142,7 +135,7 @@ public final class FullFieldsTestEntityHelper {
|
||||
String fqhn, @Nullable String ip1, @Nullable String ip2, String registrarClientId) {
|
||||
Host.Builder builder =
|
||||
new Host.Builder()
|
||||
.setRepoId(generateNewContactHostRoid())
|
||||
.setRepoId(generateNewHostRoid())
|
||||
.setHostName(fqhn)
|
||||
.setCreationTimeForTest(DateTime.parse("2000-10-08T00:45:00Z"))
|
||||
.setPersistedCurrentSponsorRegistrarId(registrarClientId);
|
||||
@@ -183,156 +176,8 @@ public final class FullFieldsTestEntityHelper {
|
||||
return host;
|
||||
}
|
||||
|
||||
public static Contact makeContact(String id, String name, @Nullable String email) {
|
||||
return makeContact(id, name, email, ImmutableList.of("123 Example Boulevard <script>"), null);
|
||||
}
|
||||
|
||||
public static Contact makeContact(
|
||||
String id, String name, @Nullable String email, @Nullable Registrar registrar) {
|
||||
return makeContact(
|
||||
id, name, email, ImmutableList.of("123 Example Boulevard <script>"), registrar);
|
||||
}
|
||||
|
||||
public static Contact makeContact(
|
||||
String id,
|
||||
String name,
|
||||
@Nullable String email,
|
||||
@Nullable List<String> street,
|
||||
@Nullable Registrar registrar) {
|
||||
return makeContact(id, name, email, street, registrar, null);
|
||||
}
|
||||
|
||||
public static Contact makeContact(
|
||||
String id,
|
||||
String name,
|
||||
@Nullable String email,
|
||||
@Nullable List<String> street,
|
||||
@Nullable Registrar registrar,
|
||||
@Nullable DateTime deletionTime) {
|
||||
PostalInfo.Builder postalBuilder = new PostalInfo.Builder()
|
||||
.setType(PostalInfo.Type.INTERNATIONALIZED)
|
||||
.setName(name)
|
||||
.setOrg("GOOGLE INCORPORATED <script>");
|
||||
if (street != null) {
|
||||
postalBuilder.setAddress(new ContactAddress.Builder()
|
||||
.setStreet(ImmutableList.copyOf(street))
|
||||
.setCity("KOKOMO")
|
||||
.setState("BM")
|
||||
.setZip("31337")
|
||||
.setCountryCode("US")
|
||||
.build());
|
||||
}
|
||||
Contact.Builder builder =
|
||||
new Contact.Builder()
|
||||
.setContactId(id)
|
||||
.setRepoId(generateNewContactHostRoid())
|
||||
.setCreationTimeForTest(DateTime.parse("2000-10-08T00:45:00Z"))
|
||||
.setInternationalizedPostalInfo(postalBuilder.build())
|
||||
.setVoiceNumber(
|
||||
new ContactPhoneNumber.Builder().setPhoneNumber("+1.2126660420").build())
|
||||
.setFaxNumber(new ContactPhoneNumber.Builder().setPhoneNumber("+1.2126660420").build());
|
||||
if (email != null) {
|
||||
builder.setEmailAddress(email);
|
||||
}
|
||||
String registrarId = registrar == null ? "TheRegistrar" : registrar.getRegistrarId();
|
||||
builder.setCreationRegistrarId(registrarId).setPersistedCurrentSponsorRegistrarId(registrarId);
|
||||
if (deletionTime != null) {
|
||||
builder.setDeletionTime(deletionTime);
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
public static Contact makeWipedOutContact(
|
||||
String id, @Nullable Registrar registrar, @Nullable DateTime deletionTime) {
|
||||
Contact.Builder builder =
|
||||
new Contact.Builder()
|
||||
.setContactId(id)
|
||||
.setRepoId(generateNewContactHostRoid())
|
||||
.setCreationTimeForTest(DateTime.parse("2000-10-08T00:45:00Z"));
|
||||
if (registrar != null) {
|
||||
builder
|
||||
.setCreationRegistrarId(registrar.getRegistrarId())
|
||||
.setPersistedCurrentSponsorRegistrarId(registrar.getRegistrarId());
|
||||
}
|
||||
if (deletionTime != null) {
|
||||
builder.setDeletionTime(deletionTime);
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
public static Contact makeAndPersistContact(
|
||||
String id,
|
||||
String name,
|
||||
@Nullable String email,
|
||||
@Nullable DateTime creationTime,
|
||||
@Nullable Registrar registrar) {
|
||||
return makeAndPersistContact(
|
||||
id,
|
||||
name,
|
||||
email,
|
||||
ImmutableList.of("123 Example Boulevard <script>"),
|
||||
creationTime,
|
||||
registrar,
|
||||
null);
|
||||
}
|
||||
|
||||
public static Contact makeAndPersistContact(
|
||||
String id,
|
||||
String name,
|
||||
@Nullable String email,
|
||||
@Nullable List<String> street,
|
||||
@Nullable DateTime creationTime) {
|
||||
return makeAndPersistContact(id, name, email, street, creationTime, null, null);
|
||||
}
|
||||
|
||||
public static Contact makeAndPersistContact(
|
||||
String id,
|
||||
String name,
|
||||
@Nullable String email,
|
||||
@Nullable List<String> street,
|
||||
@Nullable DateTime creationTime,
|
||||
@Nullable Registrar registrar) {
|
||||
return makeAndPersistContact(id, name, email, street, creationTime, registrar, null);
|
||||
}
|
||||
|
||||
public static Contact makeAndPersistContact(
|
||||
String id,
|
||||
String name,
|
||||
@Nullable String email,
|
||||
@Nullable List<String> street,
|
||||
@Nullable DateTime creationTime,
|
||||
@Nullable Registrar registrar,
|
||||
@Nullable DateTime deletionTime) {
|
||||
Contact contact =
|
||||
persistResource(makeContact(id, name, email, street, registrar, deletionTime));
|
||||
if (creationTime != null) {
|
||||
persistResource(
|
||||
makeHistoryEntry(
|
||||
contact, HistoryEntry.Type.CONTACT_CREATE, null, "created", creationTime));
|
||||
}
|
||||
if (deletionTime != null) {
|
||||
persistResource(
|
||||
makeHistoryEntry(
|
||||
contact, HistoryEntry.Type.CONTACT_DELETE, null, "deleted", deletionTime));
|
||||
}
|
||||
return contact;
|
||||
}
|
||||
|
||||
public static Contact makeAndPersistDeletedContact(
|
||||
String id, DateTime creationTime, Registrar registrar, DateTime deletionTime) {
|
||||
Contact contact = persistResource(makeWipedOutContact(id, registrar, deletionTime));
|
||||
persistResource(
|
||||
makeHistoryEntry(contact, HistoryEntry.Type.CONTACT_CREATE, null, "created", creationTime));
|
||||
persistResource(
|
||||
makeHistoryEntry(contact, HistoryEntry.Type.CONTACT_DELETE, null, "deleted", deletionTime));
|
||||
return contact;
|
||||
}
|
||||
|
||||
public static Domain makeDomain(
|
||||
String domain,
|
||||
@Nullable Contact registrant,
|
||||
@Nullable Contact admin,
|
||||
@Nullable Contact tech,
|
||||
@Nullable Host ns1,
|
||||
@Nullable Host ns2,
|
||||
Registrar registrar) {
|
||||
@@ -352,21 +197,6 @@ public final class FullFieldsTestEntityHelper {
|
||||
StatusValue.CLIENT_TRANSFER_PROHIBITED,
|
||||
StatusValue.SERVER_UPDATE_PROHIBITED))
|
||||
.setDsData(ImmutableSet.of(DomainDsData.create(1, 2, 3, "deadface")));
|
||||
if (registrant != null) {
|
||||
builder.setRegistrant(Optional.of(registrant.createVKey()));
|
||||
}
|
||||
if ((admin != null) || (tech != null)) {
|
||||
ImmutableSet.Builder<DesignatedContact> contactsBuilder = new ImmutableSet.Builder<>();
|
||||
if (admin != null) {
|
||||
contactsBuilder.add(
|
||||
DesignatedContact.create(DesignatedContact.Type.ADMIN, admin.createVKey()));
|
||||
}
|
||||
if (tech != null) {
|
||||
contactsBuilder.add(
|
||||
DesignatedContact.create(DesignatedContact.Type.TECH, tech.createVKey()));
|
||||
}
|
||||
builder.setContacts(contactsBuilder.build());
|
||||
}
|
||||
if ((ns1 != null) || (ns2 != null)) {
|
||||
ImmutableSet.Builder<VKey<Host>> nsBuilder = new ImmutableSet.Builder<>();
|
||||
if (ns1 != null) {
|
||||
|
||||
@@ -47,9 +47,6 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
"--client=NewRegistrar",
|
||||
"--period=1",
|
||||
"--nameservers=ns1.zdns.google,ns2.zdns.google,ns3.zdns.google,ns4.zdns.google",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"--password=2fooBAR",
|
||||
"--ds_records=1 2 2 9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08,4 5 1"
|
||||
+ " A94A8FE5CCB19BA61C4C0873D391E987982FBBD3",
|
||||
@@ -64,9 +61,6 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
"--client=NewRegistrar",
|
||||
"--period=1",
|
||||
"--nameservers=NS1.zdns.google,ns2.ZDNS.google,ns3.zdns.gOOglE,ns4.zdns.google",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"--password=2fooBAR",
|
||||
"--ds_records=1 2 2 9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08,4 5 1"
|
||||
+ " A94A8FE5CCB19BA61C4C0873D391E987982FBBD3",
|
||||
@@ -81,9 +75,6 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
"--client=NewRegistrar",
|
||||
"--period=1",
|
||||
"--nameservers=ns[1-4].zdns.google",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"--password=2fooBAR",
|
||||
"--ds_records=1 2 2 9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08,4 5 1"
|
||||
+ " A94A8FE5CCB19BA61C4C0873D391E987982FBBD3",
|
||||
@@ -98,9 +89,6 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
"--client=NewRegistrar",
|
||||
"--period=1",
|
||||
"--nameservers=NS[1-4].zdns.google",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"--password=2fooBAR",
|
||||
"--ds_records=1 2 2 9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08,4 5 1"
|
||||
+ " A94A8FE5CCB19BA61C4C0873D391E987982FBBD3",
|
||||
@@ -123,14 +111,9 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
createTld("abc");
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"example.tld",
|
||||
"example.abc");
|
||||
eppVerifier
|
||||
.verifySent("domain_create_contacts.xml")
|
||||
.verifySent("domain_create_contacts_abc.xml");
|
||||
eppVerifier.verifySent("domain_create_minimal.xml").verifySent("domain_create_minimal_abc.xml");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -145,14 +128,9 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
tm().transact(() -> tm().put(registry));
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"example.tld",
|
||||
"example.abc");
|
||||
eppVerifier
|
||||
.verifySent("domain_create_contacts.xml")
|
||||
.verifySent("domain_create_contacts_abc.xml");
|
||||
eppVerifier.verifySent("domain_create_minimal.xml").verifySent("domain_create_minimal_abc.xml");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -166,9 +144,6 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
.build());
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"--period=3",
|
||||
"--force_premiums",
|
||||
"parajiumu.baar");
|
||||
@@ -183,17 +158,14 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
createTld("abc");
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"--force_premiums",
|
||||
"example.tld",
|
||||
"palladium.tld",
|
||||
"example.abc");
|
||||
eppVerifier
|
||||
.verifySent("domain_create_contacts.xml")
|
||||
.verifySent("domain_create_minimal.xml")
|
||||
.verifySent("domain_create_palladium.xml")
|
||||
.verifySent("domain_create_contacts_abc.xml");
|
||||
.verifySent("domain_create_minimal_abc.xml");
|
||||
assertInStdout(
|
||||
"palladium.tld is premium at USD 877.00 per year; "
|
||||
+ "sending total cost for 1 year(s) of USD 877.00.");
|
||||
@@ -204,9 +176,6 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
createTld("tld");
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"--reason=Creating test domain",
|
||||
"--registrar_request=false",
|
||||
"example.tld");
|
||||
@@ -218,27 +187,11 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
createTld("tld");
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"--allocation_token=abc123",
|
||||
"example.tld");
|
||||
eppVerifier.verifySent("domain_create_token.xml");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSuccess_contactsStillRequired() throws Exception {
|
||||
// Verify that if contacts are still required, the minimum+contacts request is sent
|
||||
createTld("tld");
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"example.tld");
|
||||
eppVerifier.verifySent("domain_create_contacts.xml");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFailure_duplicateDomains() {
|
||||
IllegalArgumentException thrown =
|
||||
@@ -247,9 +200,6 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"example.tld",
|
||||
"example.tld"));
|
||||
assertThat(thrown).hasMessageThat().contains("Duplicate arguments found: 'example.tld'");
|
||||
@@ -258,14 +208,7 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
@Test
|
||||
void testFailure_missingDomain() {
|
||||
ParameterException thrown =
|
||||
assertThrows(
|
||||
ParameterException.class,
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech"));
|
||||
assertThrows(ParameterException.class, () -> runCommandForced("--client=NewRegistrar"));
|
||||
assertThat(thrown).hasMessageThat().contains("Main parameters are required");
|
||||
}
|
||||
|
||||
@@ -276,9 +219,6 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
ParameterException.class,
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"--registrant=crr-admin",
|
||||
"example.tld"));
|
||||
assertThat(thrown).hasMessageThat().contains("--client");
|
||||
}
|
||||
@@ -291,9 +231,6 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"--nameservers=ns1.zdns.google,ns2.zdns.google,ns3.zdns.google,ns4.zdns.google,"
|
||||
+ "ns5.zdns.google,ns6.zdns.google,ns7.zdns.google,ns8.zdns.google,"
|
||||
+ "ns9.zdns.google,ns10.zdns.google,ns11.zdns.google,ns12.zdns.google,"
|
||||
@@ -310,9 +247,6 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"--nameservers=ns[1-14].zdns.google",
|
||||
"example.tld"));
|
||||
assertThat(thrown).hasMessageThat().contains("There can be at most 13 nameservers");
|
||||
@@ -326,9 +260,6 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"--period=x",
|
||||
"--domain=example.tld"));
|
||||
assertThat(thrown).hasMessageThat().contains("--period");
|
||||
@@ -342,9 +273,6 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"--ds_records=1 2 3 abcd",
|
||||
"example.tld"));
|
||||
assertThat(thrown).hasMessageThat().isEqualTo("DS record uses an unrecognized digest type: 3");
|
||||
@@ -358,9 +286,6 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"--ds_records=1 2 1 abcd",
|
||||
"example.tld"));
|
||||
assertThat(thrown).hasMessageThat().isEqualTo("DS record has an invalid digest length: ABCD");
|
||||
@@ -374,9 +299,6 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"--ds_records=1 999 4"
|
||||
+ " 768412320F7B0AA5812FCE428DC4706B3CAE50E02A64CAA16A782249BFE8EFC4B7EF1C"
|
||||
+ "CB126255D196047DFEDF17A0A9",
|
||||
@@ -392,9 +314,6 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"--ds_records=1 2 3 ab cd",
|
||||
"example.tld"));
|
||||
assertThat(thrown).hasMessageThat().contains("should have 4 parts, but has 5");
|
||||
@@ -408,9 +327,6 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"--ds_records=x 2 3 abcd",
|
||||
"example.tld"));
|
||||
assertThat(thrown).hasMessageThat().contains("\"x\"");
|
||||
@@ -424,9 +340,6 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"--ds_records=1 x 3 abcd",
|
||||
"example.tld"));
|
||||
assertThat(thrown).hasMessageThat().contains("\"x\"");
|
||||
@@ -440,9 +353,6 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"--ds_records=1 2 x abcd",
|
||||
"example.tld"));
|
||||
assertThat(thrown).hasMessageThat().contains("\"x\"");
|
||||
@@ -456,9 +366,6 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"--ds_records=1 2 3 xbcd",
|
||||
"example.tld"));
|
||||
assertThat(thrown).hasMessageThat().contains("XBCD");
|
||||
@@ -472,9 +379,6 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"--ds_records=1 2 3 abcde",
|
||||
"example.tld"));
|
||||
assertThat(thrown).hasMessageThat().contains("length 5");
|
||||
@@ -488,9 +392,6 @@ class CreateDomainCommandTest extends EppToolCommandTestCase<CreateDomainCommand
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"gold.tld"));
|
||||
assertThat(thrown)
|
||||
.hasMessageThat()
|
||||
|
||||
@@ -20,7 +20,6 @@ import static google.registry.model.eppcommon.StatusValue.PENDING_DELETE;
|
||||
import static google.registry.model.eppcommon.StatusValue.SERVER_UPDATE_PROHIBITED;
|
||||
import static google.registry.model.reporting.HistoryEntry.Type.DOMAIN_CREATE;
|
||||
import static google.registry.testing.DatabaseHelper.createTld;
|
||||
import static google.registry.testing.DatabaseHelper.newContact;
|
||||
import static google.registry.testing.DatabaseHelper.persistActiveDomain;
|
||||
import static google.registry.testing.DatabaseHelper.persistActiveHost;
|
||||
import static google.registry.testing.DatabaseHelper.persistResource;
|
||||
@@ -35,8 +34,6 @@ import com.google.common.collect.ImmutableSet;
|
||||
import google.registry.model.billing.BillingBase.Flag;
|
||||
import google.registry.model.billing.BillingBase.Reason;
|
||||
import google.registry.model.billing.BillingRecurrence;
|
||||
import google.registry.model.contact.Contact;
|
||||
import google.registry.model.domain.DesignatedContact;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
@@ -75,18 +72,13 @@ class UpdateDomainCommandTest extends EppToolCommandTestCase<UpdateDomainCommand
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--add_nameservers=ns1.zdns.google,ns2.zdns.google",
|
||||
"--add_admins=crr-admin2",
|
||||
"--add_techs=crr-tech2",
|
||||
"--add_statuses=serverDeleteProhibited",
|
||||
"--add_ds_records=1 2 2 9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08,4"
|
||||
+ " 5 1 A94A8FE5CCB19BA61C4C0873D391E987982FBBD3",
|
||||
"--remove_nameservers=ns3.zdns.google,ns4.zdns.google",
|
||||
"--remove_admins=crr-admin1",
|
||||
"--remove_techs=crr-tech1",
|
||||
"--remove_statuses=serverHold",
|
||||
"--remove_ds_records=7 8 1 A94A8FE5CCB19BA61C4C0873D391E987982FBBD3,6 5 4"
|
||||
+ " 768412320F7B0AA5812FCE428DC4706B3CAE50E02A64CAA16A782249BFE8EFC4B7EF1CCB126255D196047DFEDF17A0A9",
|
||||
"--registrant=crr-admin",
|
||||
"--password=2fooBAR",
|
||||
"example.tld");
|
||||
eppVerifier.verifySent("domain_update_complete.xml");
|
||||
@@ -97,18 +89,13 @@ class UpdateDomainCommandTest extends EppToolCommandTestCase<UpdateDomainCommand
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--add_nameservers=NS[1-2].zdns.google",
|
||||
"--add_admins=crr-admin2",
|
||||
"--add_techs=crr-tech2",
|
||||
"--add_statuses=serverDeleteProhibited",
|
||||
"--add_ds_records=1 2 2 9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08,4"
|
||||
+ " 5 1 A94A8FE5CCB19BA61C4C0873D391E987982FBBD3",
|
||||
"--remove_nameservers=ns[3-4].zdns.google",
|
||||
"--remove_admins=crr-admin1",
|
||||
"--remove_techs=crr-tech1",
|
||||
"--remove_statuses=serverHold",
|
||||
"--remove_ds_records=7 8 1 A94A8FE5CCB19BA61C4C0873D391E987982FBBD3,6 5 4"
|
||||
+ " 768412320F7B0AA5812FCE428DC4706B3CAE50E02A64CAA16A782249BFE8EFC4B7EF1CCB126255D196047DFEDF17A0A9",
|
||||
"--registrant=crr-admin",
|
||||
"--password=2fooBAR",
|
||||
"example.tld");
|
||||
eppVerifier.verifySent("domain_update_complete.xml");
|
||||
@@ -121,18 +108,13 @@ class UpdateDomainCommandTest extends EppToolCommandTestCase<UpdateDomainCommand
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--add_nameservers=ns1.zdns.google,ns2.zdns.google",
|
||||
"--add_admins=crr-admin2",
|
||||
"--add_techs=crr-tech2",
|
||||
"--add_statuses=serverDeleteProhibited",
|
||||
"--add_ds_records=1 2 2 9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08,4"
|
||||
+ " 5 1 A94A8FE5CCB19BA61C4C0873D391E987982FBBD3",
|
||||
"--remove_nameservers=ns[3-4].zdns.google",
|
||||
"--remove_admins=crr-admin1",
|
||||
"--remove_techs=crr-tech1",
|
||||
"--remove_statuses=serverHold",
|
||||
"--remove_ds_records=7 8 1 A94A8FE5CCB19BA61C4C0873D391E987982FBBD3,6 5 4"
|
||||
+ " 768412320F7B0AA5812FCE428DC4706B3CAE50E02A64CAA16A782249BFE8EFC4B7EF1CCB126255D196047DFEDF17A0A9",
|
||||
"--registrant=crr-admin",
|
||||
"--password=2fooBAR",
|
||||
"example.tld",
|
||||
"example.abc");
|
||||
@@ -177,8 +159,6 @@ class UpdateDomainCommandTest extends EppToolCommandTestCase<UpdateDomainCommand
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--add_nameservers=ns2.zdns.google,ns3.zdns.google",
|
||||
"--add_admins=crr-admin2",
|
||||
"--add_techs=crr-tech2",
|
||||
"--add_statuses=serverDeleteProhibited",
|
||||
"--add_ds_records=1 2 2 D4B7D520E7BB5F0F67674A0CCEB1E3E0614B93C4F9E99B8383F6A1E4469DA50A,4"
|
||||
+ " 5 1 A94A8FE5CCB19BA61C4C0873D391E987982FBBD3",
|
||||
@@ -191,8 +171,6 @@ class UpdateDomainCommandTest extends EppToolCommandTestCase<UpdateDomainCommand
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--remove_nameservers=ns4.zdns.google",
|
||||
"--remove_admins=crr-admin1",
|
||||
"--remove_techs=crr-tech1",
|
||||
"--remove_statuses=serverHold",
|
||||
"--remove_ds_records=7 8 1 A94A8FE5CCB19BA61C4C0873D391E987982FBBD3,6 5 4"
|
||||
+ " 768412320F7B0AA5812FCE428DC4706B3CAE50E02A64CAA16A782249BFE8EFC4B7EF1CCB126255D196047DFEDF17A0A9",
|
||||
@@ -202,8 +180,7 @@ class UpdateDomainCommandTest extends EppToolCommandTestCase<UpdateDomainCommand
|
||||
|
||||
@Test
|
||||
void testSuccess_change() throws Exception {
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar", "--registrant=crr-admin", "--password=2fooBAR", "example.tld");
|
||||
runCommandForced("--client=NewRegistrar", "--password=2fooBAR", "example.tld");
|
||||
eppVerifier.verifySent("domain_update_change.xml");
|
||||
}
|
||||
|
||||
@@ -211,7 +188,6 @@ class UpdateDomainCommandTest extends EppToolCommandTestCase<UpdateDomainCommand
|
||||
void testSuccess_change_reasonAndRegistrarRequest() throws Exception {
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
"--password=2fooBAR",
|
||||
"--reason=Testing domain update",
|
||||
"--registrar_request=false",
|
||||
@@ -230,27 +206,6 @@ class UpdateDomainCommandTest extends EppToolCommandTestCase<UpdateDomainCommand
|
||||
eppVerifier.verifySent("domain_update_set_nameservers.xml");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSuccess_setContacts() throws Exception {
|
||||
Contact adminContact = persistResource(newContact("crr-admin1"));
|
||||
Contact techContact = persistResource(newContact("crr-tech1"));
|
||||
VKey<Contact> adminContactKey = adminContact.createVKey();
|
||||
VKey<Contact> techContactKey = techContact.createVKey();
|
||||
|
||||
persistResource(
|
||||
domain
|
||||
.asBuilder()
|
||||
.setContacts(
|
||||
ImmutableSet.of(
|
||||
DesignatedContact.create(DesignatedContact.Type.ADMIN, adminContactKey),
|
||||
DesignatedContact.create(DesignatedContact.Type.TECH, techContactKey)))
|
||||
.build());
|
||||
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar", "--admins=crr-admin3", "--techs=crr-tech3", "example.tld");
|
||||
eppVerifier.verifySent("domain_update_set_contacts.xml");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSuccess_setStatuses() throws Exception {
|
||||
Host host = persistActiveHost("ns1.zdns.google");
|
||||
@@ -359,29 +314,23 @@ class UpdateDomainCommandTest extends EppToolCommandTestCase<UpdateDomainCommand
|
||||
|
||||
@Test
|
||||
void testSuccess_canUpdatePendingDeleteDomain_whenSuperuserPassesOverrideFlag() throws Exception {
|
||||
Contact adminContact = persistResource(newContact("crr-admin1"));
|
||||
Contact techContact = persistResource(newContact("crr-tech1"));
|
||||
VKey<Contact> adminContactKey = adminContact.createVKey();
|
||||
VKey<Contact> techContactKey = techContact.createVKey();
|
||||
Host host1 = persistActiveHost("ns1.zdns.google");
|
||||
persistActiveHost("ns2.zdns.google");
|
||||
|
||||
persistResource(
|
||||
domain
|
||||
.asBuilder()
|
||||
.setContacts(
|
||||
ImmutableSet.of(
|
||||
DesignatedContact.create(DesignatedContact.Type.ADMIN, adminContactKey),
|
||||
DesignatedContact.create(DesignatedContact.Type.TECH, techContactKey)))
|
||||
.setNameservers(host1.createVKey())
|
||||
.setStatusValues(ImmutableSet.of(PENDING_DELETE))
|
||||
.build());
|
||||
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--admins=crr-admin3",
|
||||
"--techs=crr-tech3",
|
||||
"--add_nameservers=ns2.zdns.google",
|
||||
"--superuser",
|
||||
"--force_in_pending_delete",
|
||||
"example.tld");
|
||||
eppVerifier.expectSuperuser().verifySent("domain_update_set_contacts.xml");
|
||||
eppVerifier.expectSuperuser().verifySent("domain_update_add_nameserver.xml");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -440,7 +389,6 @@ class UpdateDomainCommandTest extends EppToolCommandTestCase<UpdateDomainCommand
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
"--password=2fooBAR",
|
||||
"example.tld",
|
||||
"example.tld"));
|
||||
@@ -452,9 +400,7 @@ class UpdateDomainCommandTest extends EppToolCommandTestCase<UpdateDomainCommand
|
||||
ParameterException thrown =
|
||||
assertThrows(
|
||||
ParameterException.class,
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar", "--registrant=crr-admin", "--password=2fooBAR"));
|
||||
() -> runCommandForced("--client=NewRegistrar", "--password=2fooBAR"));
|
||||
assertThat(thrown).hasMessageThat().contains("Main parameters are required");
|
||||
}
|
||||
|
||||
@@ -462,8 +408,7 @@ class UpdateDomainCommandTest extends EppToolCommandTestCase<UpdateDomainCommand
|
||||
void testFailure_missingClientId() {
|
||||
ParameterException thrown =
|
||||
assertThrows(
|
||||
ParameterException.class,
|
||||
() -> runCommandForced("--registrant=crr-admin", "--password=2fooBAR", "example.tld"));
|
||||
ParameterException.class, () -> runCommandForced("--password=2fooBAR", "example.tld"));
|
||||
assertThat(thrown).hasMessageThat().contains("--client");
|
||||
}
|
||||
|
||||
@@ -479,8 +424,6 @@ class UpdateDomainCommandTest extends EppToolCommandTestCase<UpdateDomainCommand
|
||||
+ "ns5.zdns.google,ns6.zdns.google,ns7.zdns.google,ns8.zdns.google,"
|
||||
+ "ns9.zdns.google,ns10.zdns.google,ns11.zdns.google,ns12.zdns.google,"
|
||||
+ "ns13.zdns.google,ns14.zdns.google",
|
||||
"--add_admins=crr-admin2",
|
||||
"--add_techs=crr-tech2",
|
||||
"--add_statuses=serverDeleteProhibited",
|
||||
"example.tld"));
|
||||
assertThat(thrown).hasMessageThat().contains("You can add at most 13 nameservers");
|
||||
@@ -522,76 +465,6 @@ class UpdateDomainCommandTest extends EppToolCommandTestCase<UpdateDomainCommand
|
||||
+ "you cannot use the add_nameservers and remove_nameservers flags.");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFailure_providedAdminsAndAddAdmins() {
|
||||
IllegalArgumentException thrown =
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--add_admins=crr-admin2",
|
||||
"--admins=crr-admin2",
|
||||
"example.tld"));
|
||||
assertThat(thrown)
|
||||
.hasMessageThat()
|
||||
.isEqualTo(
|
||||
"If you provide the admins flag, "
|
||||
+ "you cannot use the add_admins and remove_admins flags.");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFailure_providedAdminsAndRemoveAdmins() {
|
||||
IllegalArgumentException thrown =
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--remove_admins=crr-admin2",
|
||||
"--admins=crr-admin2",
|
||||
"example.tld"));
|
||||
assertThat(thrown)
|
||||
.hasMessageThat()
|
||||
.isEqualTo(
|
||||
"If you provide the admins flag, "
|
||||
+ "you cannot use the add_admins and remove_admins flags.");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFailure_providedTechsAndAddTechs() {
|
||||
IllegalArgumentException thrown =
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--add_techs=crr-tech2",
|
||||
"--techs=crr-tech2",
|
||||
"example.tld"));
|
||||
assertThat(thrown)
|
||||
.hasMessageThat()
|
||||
.contains(
|
||||
"If you provide the techs flag, you cannot use the add_techs and remove_techs flags.");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFailure_providedTechsAndRemoveTechs() {
|
||||
IllegalArgumentException thrown =
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--remove_techs=crr-tech2",
|
||||
"--techs=crr-tech2",
|
||||
"example.tld"));
|
||||
assertThat(thrown)
|
||||
.hasMessageThat()
|
||||
.contains(
|
||||
"If you provide the techs flag, you cannot use the add_techs and remove_techs flags.");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testFailure_providedStatusesAndAddStatuses() {
|
||||
IllegalArgumentException thrown =
|
||||
@@ -664,9 +537,6 @@ class UpdateDomainCommandTest extends EppToolCommandTestCase<UpdateDomainCommand
|
||||
() ->
|
||||
runCommandForced(
|
||||
"--client=NewRegistrar",
|
||||
"--registrant=crr-admin",
|
||||
"--admins=crr-admin",
|
||||
"--techs=crr-tech",
|
||||
"--ds_records=1 2 1 abcd",
|
||||
"example.tld"));
|
||||
assertThat(thrown).hasMessageThat().isEqualTo("DS record has an invalid digest length: ABCD");
|
||||
|
||||
@@ -12,9 +12,6 @@
|
||||
<domain:hostObj>ns3.zdns.google</domain:hostObj>
|
||||
<domain:hostObj>ns4.zdns.google</domain:hostObj>
|
||||
</domain:ns>
|
||||
<domain:registrant>crr-admin</domain:registrant>
|
||||
<domain:contact type="admin">crr-admin</domain:contact>
|
||||
<domain:contact type="tech">crr-tech</domain:contact>
|
||||
<domain:authInfo>
|
||||
<domain:pw>2fooBAR</domain:pw>
|
||||
</domain:authInfo>
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
||||
<command>
|
||||
<create>
|
||||
<domain:create
|
||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||
<domain:name>example.tld</domain:name>
|
||||
<domain:period unit="y">1</domain:period>
|
||||
<domain:registrant>crr-admin</domain:registrant>
|
||||
<domain:contact type="admin">crr-admin</domain:contact>
|
||||
<domain:contact type="tech">crr-tech</domain:contact>
|
||||
<domain:authInfo>
|
||||
<domain:pw>abcdefghijklmnop</domain:pw>
|
||||
</domain:authInfo>
|
||||
</domain:create>
|
||||
</create>
|
||||
<clTRID>RegistryTool</clTRID>
|
||||
</command>
|
||||
</epp>
|
||||
@@ -6,9 +6,6 @@
|
||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||
<domain:name>example.tld</domain:name>
|
||||
<domain:period unit="y">1</domain:period>
|
||||
<domain:registrant>crr-admin</domain:registrant>
|
||||
<domain:contact type="admin">crr-admin</domain:contact>
|
||||
<domain:contact type="tech">crr-tech</domain:contact>
|
||||
<domain:authInfo>
|
||||
<domain:pw>abcdefghijklmnop</domain:pw>
|
||||
</domain:authInfo>
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||
<domain:name>example.abc</domain:name>
|
||||
<domain:period unit="y">1</domain:period>
|
||||
<domain:registrant>crr-admin</domain:registrant>
|
||||
<domain:contact type="admin">crr-admin</domain:contact>
|
||||
<domain:contact type="tech">crr-tech</domain:contact>
|
||||
<domain:authInfo>
|
||||
<domain:pw>abcdefghijklmnop</domain:pw>
|
||||
</domain:authInfo>
|
||||
@@ -6,9 +6,6 @@
|
||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||
<domain:name>palladium.tld</domain:name>
|
||||
<domain:period unit="y">1</domain:period>
|
||||
<domain:registrant>crr-admin</domain:registrant>
|
||||
<domain:contact type="admin">crr-admin</domain:contact>
|
||||
<domain:contact type="tech">crr-tech</domain:contact>
|
||||
<domain:authInfo>
|
||||
<domain:pw>abcdefghijklmnop</domain:pw>
|
||||
</domain:authInfo>
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||
<domain:name>parajiumu.baar</domain:name>
|
||||
<domain:period unit="y">3</domain:period>
|
||||
<domain:registrant>crr-admin</domain:registrant>
|
||||
<domain:contact type="admin">crr-admin</domain:contact>
|
||||
<domain:contact type="tech">crr-tech</domain:contact>
|
||||
<domain:authInfo>
|
||||
<domain:pw>abcdefghijklmnop</domain:pw>
|
||||
</domain:authInfo>
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||
<domain:name>example.tld</domain:name>
|
||||
<domain:period unit="y">1</domain:period>
|
||||
<domain:registrant>crr-admin</domain:registrant>
|
||||
<domain:contact type="admin">crr-admin</domain:contact>
|
||||
<domain:contact type="tech">crr-tech</domain:contact>
|
||||
<domain:authInfo>
|
||||
<domain:pw>abcdefghijklmnop</domain:pw>
|
||||
</domain:authInfo>
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
<domain:hostObj>ns2.zdns.google</domain:hostObj>
|
||||
<domain:hostObj>ns3.zdns.google</domain:hostObj>
|
||||
</domain:ns>
|
||||
<domain:contact type="admin">crr-admin2</domain:contact>
|
||||
<domain:contact type="tech">crr-tech2</domain:contact>
|
||||
<domain:status s="serverDeleteProhibited"/>
|
||||
</domain:add>
|
||||
</domain:update>
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||
<domain:name>example.tld</domain:name>
|
||||
<domain:add>
|
||||
<domain:contact type="admin">crr-admin3</domain:contact>
|
||||
<domain:contact type="tech">crr-tech3</domain:contact>
|
||||
<domain:ns>
|
||||
<domain:hostObj>ns2.zdns.google</domain:hostObj>
|
||||
</domain:ns>
|
||||
</domain:add>
|
||||
<domain:rem>
|
||||
<domain:contact type="admin">crr-admin1</domain:contact>
|
||||
<domain:contact type="tech">crr-tech1</domain:contact>
|
||||
</domain:rem>
|
||||
</domain:update>
|
||||
</update>
|
||||
<clTRID>RegistryTool</clTRID>
|
||||
@@ -6,7 +6,6 @@
|
||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||
<domain:name>example.tld</domain:name>
|
||||
<domain:chg>
|
||||
<domain:registrant>crr-admin</domain:registrant>
|
||||
<domain:authInfo>
|
||||
<domain:pw>2fooBAR</domain:pw>
|
||||
</domain:authInfo>
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||
<domain:name>example.tld</domain:name>
|
||||
<domain:chg>
|
||||
<domain:registrant>crr-admin</domain:registrant>
|
||||
<domain:authInfo>
|
||||
<domain:pw>2fooBAR</domain:pw>
|
||||
</domain:authInfo>
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
<domain:hostObj>ns1.zdns.google</domain:hostObj>
|
||||
<domain:hostObj>ns2.zdns.google</domain:hostObj>
|
||||
</domain:ns>
|
||||
<domain:contact type="admin">crr-admin2</domain:contact>
|
||||
<domain:contact type="tech">crr-tech2</domain:contact>
|
||||
<domain:status s="serverDeleteProhibited"/>
|
||||
</domain:add>
|
||||
<domain:rem>
|
||||
@@ -19,12 +17,9 @@
|
||||
<domain:hostObj>ns3.zdns.google</domain:hostObj>
|
||||
<domain:hostObj>ns4.zdns.google</domain:hostObj>
|
||||
</domain:ns>
|
||||
<domain:contact type="admin">crr-admin1</domain:contact>
|
||||
<domain:contact type="tech">crr-tech1</domain:contact>
|
||||
<domain:status s="serverHold"/>
|
||||
</domain:rem>
|
||||
<domain:chg>
|
||||
<domain:registrant>crr-admin</domain:registrant>
|
||||
<domain:authInfo>
|
||||
<domain:pw>2fooBAR</domain:pw>
|
||||
</domain:authInfo>
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
<domain:hostObj>ns1.zdns.google</domain:hostObj>
|
||||
<domain:hostObj>ns2.zdns.google</domain:hostObj>
|
||||
</domain:ns>
|
||||
<domain:contact type="admin">crr-admin2</domain:contact>
|
||||
<domain:contact type="tech">crr-tech2</domain:contact>
|
||||
<domain:status s="serverDeleteProhibited"/>
|
||||
</domain:add>
|
||||
<domain:rem>
|
||||
@@ -19,12 +17,9 @@
|
||||
<domain:hostObj>ns3.zdns.google</domain:hostObj>
|
||||
<domain:hostObj>ns4.zdns.google</domain:hostObj>
|
||||
</domain:ns>
|
||||
<domain:contact type="admin">crr-admin1</domain:contact>
|
||||
<domain:contact type="tech">crr-tech1</domain:contact>
|
||||
<domain:status s="serverHold"/>
|
||||
</domain:rem>
|
||||
<domain:chg>
|
||||
<domain:registrant>crr-admin</domain:registrant>
|
||||
<domain:authInfo>
|
||||
<domain:pw>2fooBAR</domain:pw>
|
||||
</domain:authInfo>
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
<domain:ns>
|
||||
<domain:hostObj>ns4.zdns.google</domain:hostObj>
|
||||
</domain:ns>
|
||||
<domain:contact type="admin">crr-admin1</domain:contact>
|
||||
<domain:contact type="tech">crr-tech1</domain:contact>
|
||||
<domain:status s="serverHold"/>
|
||||
</domain:rem>
|
||||
</domain:update>
|
||||
|
||||
@@ -27,10 +27,13 @@ case "${CONTAINER_NAME}" in
|
||||
"frontend"|"console")
|
||||
PROFILER_ARGS="-agentpath:/opt/cprof/profiler_java_agent.so=-cprof_service=${CONTAINER_NAME},-cprof_enable_heap_sampling=true"
|
||||
esac
|
||||
java $PROFILER_ARGS \
|
||||
# Allocate bigger than default fraction of available memory to the application, as it's running in a (single-purposed) container.
|
||||
-XX:InitialRAMPercentage=50.0 \
|
||||
-XX:MaxRAMPercentage=50.0 \
|
||||
-Dgoogle.registry.environment=${env} \
|
||||
-Djava.util.logging.config.file=/logging.properties \
|
||||
JVM_OPTS=(
|
||||
# Allocate bigger than default fraction of available memory to the
|
||||
# application, as it's running in a (single-purposed) container.
|
||||
-XX:InitialRAMPercentage=50.0
|
||||
-XX:MaxRAMPercentage=50.0
|
||||
-Dgoogle.registry.environment="${env}"
|
||||
-Djava.util.logging.config.file=/logging.properties
|
||||
-jar /usr/local/jetty/start.jar
|
||||
)
|
||||
java $PROFILER_ARGS "${JVM_OPTS[@]}"
|
||||
|
||||
Reference in New Issue
Block a user