mirror of
https://github.com/google/nomulus
synced 2026-09-08 17:17:02 +00:00
Remove ofy support from HistoryEntry (#1823)
This PR removes all Ofy related cruft around `HistoryEntry` and its three subclasses in order to support dual-write to datastore and SQL. The class structure was refactored to take advantage of inheritance to reduce code duplication and improve clarity.
Note that for the embedded EPP resources, either their columns are all empty (for pre-3.0 entities imported into SQL), including their unique foreign key (domain name, host name, contact id) and the update timestamp; or they are filled as expected (for entities that were written since dual writing was implemented).
Therefore the check for foreign key column nullness in the various `@PostLoad` methods in the original code is an no-op as the EPP resource would have been loaded as null. In another word, there is no case where the update timestamp is null but other columns are not.
See the following query for the most recent entries in each table where the foreign key column or the update timestamp are null -- they are the same.
```
[I]postgres=> select MAX(history_modification_time) from "DomainHistory" where update_timestamp is null;
max
----------------------------
2021-09-27 15:56:52.502+00
(1 row)
[I]postgres=> select MAX(history_modification_time) from "DomainHistory" where domain_name is null;
max
----------------------------
2021-09-27 15:56:52.502+00
(1 row)
[I]postgres=> select MAX(history_modification_time) from "ContactHistory" where update_timestamp is null;
max
----------------------------
2021-09-27 15:56:04.311+00
(1 row)
[I]postgres=> select MAX(history_modification_time) from "ContactHistory" where contact_id is null;
max
----------------------------
2021-09-27 15:56:04.311+00
(1 row)
[I]postgres=> select MAX(history_modification_time) from "HostHistory" where update_timestamp is null;
max
----------------------------
2021-09-27 15:52:16.517+00
(1 row)
[I]postgres=> select MAX(history_modification_time) from "HostHistory" where host_name is null;
max
----------------------------
2021-09-27 15:52:16.517+00
(1 row)
```
This commit is contained in:
+4
-5
@@ -37,7 +37,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.ImmutableSortedMap;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.flows.custom.DomainPricingCustomLogic;
|
||||
import google.registry.flows.domain.DomainPricingLogic;
|
||||
import google.registry.model.billing.BillingEvent;
|
||||
@@ -126,7 +125,7 @@ public class ExpandRecurringBillingEventsActionTest {
|
||||
action.response = new FakeResponse();
|
||||
action.run();
|
||||
// Need to save the current test time before running the action, which increments the clock.
|
||||
// The execution time (e. g. transaction time) is captured when the action starts running so
|
||||
// The execution time (e.g. transaction time) is captured when the action starts running so
|
||||
// the passage of time afterward does not affect the timestamp stored in the billing events.
|
||||
currentTestTime = clock.nowUtc();
|
||||
}
|
||||
@@ -139,13 +138,13 @@ public class ExpandRecurringBillingEventsActionTest {
|
||||
|
||||
private void assertHistoryEntryMatches(
|
||||
Domain domain,
|
||||
HistoryEntry actual,
|
||||
DomainHistory actual,
|
||||
String registrarId,
|
||||
DateTime billingTime,
|
||||
boolean shouldHaveTxRecord) {
|
||||
assertThat(actual.getBySuperuser()).isFalse();
|
||||
assertThat(actual.getRegistrarId()).isEqualTo(registrarId);
|
||||
assertThat(actual.getParent()).isEqualTo(Key.create(domain));
|
||||
assertThat(actual.getRepoId()).isEqualTo(domain.getRepoId());
|
||||
assertThat(actual.getPeriod()).isEqualTo(Period.create(1, YEARS));
|
||||
assertThat(actual.getReason())
|
||||
.isEqualTo("Domain autorenewal by ExpandRecurringBillingEventsAction");
|
||||
@@ -298,7 +297,7 @@ public class ExpandRecurringBillingEventsActionTest {
|
||||
runAction();
|
||||
List<DomainHistory> persistedEntries =
|
||||
getHistoryEntriesOfType(domain, DOMAIN_AUTORENEW, DomainHistory.class);
|
||||
for (HistoryEntry persistedEntry : persistedEntries) {
|
||||
for (DomainHistory persistedEntry : persistedEntries) {
|
||||
assertHistoryEntryMatches(
|
||||
domain, persistedEntry, "TheRegistrar", DateTime.parse("2000-02-19T00:00:00Z"), true);
|
||||
}
|
||||
|
||||
@@ -286,13 +286,12 @@ class WipeOutContactHistoryPiiActionTest {
|
||||
void wipeOutContactHistoryData_wipesOutNoEntity() {
|
||||
jpaTm()
|
||||
.transact(
|
||||
() -> {
|
||||
assertThat(
|
||||
action.wipeOutContactHistoryData(
|
||||
action.getNextContactHistoryEntitiesWithPiiBatch(
|
||||
clock.nowUtc().minusMonths(MIN_MONTHS_BEFORE_WIPE_OUT))))
|
||||
.isEqualTo(0);
|
||||
});
|
||||
() ->
|
||||
assertThat(
|
||||
action.wipeOutContactHistoryData(
|
||||
action.getNextContactHistoryEntitiesWithPiiBatch(
|
||||
clock.nowUtc().minusMonths(MIN_MONTHS_BEFORE_WIPE_OUT))))
|
||||
.isEqualTo(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -317,9 +316,9 @@ class WipeOutContactHistoryPiiActionTest {
|
||||
/** persists a number of ContactHistory entities for load and query testing. */
|
||||
ImmutableList<ContactHistory> persistLotsOfContactHistoryEntities(
|
||||
int numOfEntities, int minusMonths, int minusDays, Contact contact) {
|
||||
ImmutableList.Builder<ContactHistory> expectedEntitesBuilder = new ImmutableList.Builder<>();
|
||||
ImmutableList.Builder<ContactHistory> expectedEntitiesBuilder = new ImmutableList.Builder<>();
|
||||
for (int i = 0; i < numOfEntities; i++) {
|
||||
expectedEntitesBuilder.add(
|
||||
expectedEntitiesBuilder.add(
|
||||
persistResource(
|
||||
new ContactHistory()
|
||||
.asBuilder()
|
||||
@@ -329,7 +328,7 @@ class WipeOutContactHistoryPiiActionTest {
|
||||
.setContact(persistResource(contact))
|
||||
.build()));
|
||||
}
|
||||
return expectedEntitesBuilder.build();
|
||||
return expectedEntitiesBuilder.build();
|
||||
}
|
||||
|
||||
boolean areAllPiiFieldsWiped(ContactBase contactBase) {
|
||||
|
||||
@@ -133,13 +133,13 @@ public class RdePipelineTest {
|
||||
|
||||
private final ImmutableList<DepositFragment> brdaFragments =
|
||||
ImmutableList.of(
|
||||
DepositFragment.create(RdeResourceType.DOMAIN, "<rdeDomain:domain/>\n", ""),
|
||||
DepositFragment.create(RdeResourceType.REGISTRAR, "<rdeRegistrar:registrar/>\n", ""));
|
||||
DepositFragment.create(DOMAIN, "<rdeDomain:domain/>\n", ""),
|
||||
DepositFragment.create(REGISTRAR, "<rdeRegistrar:registrar/>\n", ""));
|
||||
|
||||
private final ImmutableList<DepositFragment> rdeFragments =
|
||||
ImmutableList.of(
|
||||
DepositFragment.create(RdeResourceType.DOMAIN, "<rdeDomain:domain/>\n", ""),
|
||||
DepositFragment.create(RdeResourceType.REGISTRAR, "<rdeRegistrar:registrar/>\n", ""),
|
||||
DepositFragment.create(DOMAIN, "<rdeDomain:domain/>\n", ""),
|
||||
DepositFragment.create(REGISTRAR, "<rdeRegistrar:registrar/>\n", ""),
|
||||
DepositFragment.create(CONTACT, "<rdeContact:contact/>\n", ""),
|
||||
DepositFragment.create(HOST, "<rdeHost:host/>\n", ""));
|
||||
|
||||
@@ -183,7 +183,6 @@ public class RdePipelineTest {
|
||||
.setReason("reason")
|
||||
.setRequestedByRegistrar(true)
|
||||
.setContact(contact)
|
||||
.setContactRepoId(contact.getRepoId())
|
||||
.build());
|
||||
}
|
||||
|
||||
@@ -207,7 +206,6 @@ public class RdePipelineTest {
|
||||
.setReason("reason")
|
||||
.setRequestedByRegistrar(true)
|
||||
.setDomain(domain)
|
||||
.setDomainRepoId(domain.getRepoId())
|
||||
.setDomainTransactionRecords(ImmutableSet.of(transactionRecord))
|
||||
.setOtherRegistrarId("otherClient")
|
||||
.setPeriod(Period.create(1, Period.Unit.YEARS))
|
||||
@@ -226,7 +224,6 @@ public class RdePipelineTest {
|
||||
.setReason("reason")
|
||||
.setRequestedByRegistrar(true)
|
||||
.setHost(hostBase)
|
||||
.setHostRepoId(hostBase.getRepoId())
|
||||
.build());
|
||||
}
|
||||
|
||||
@@ -389,7 +386,7 @@ public class RdePipelineTest {
|
||||
// The same registrars are attached to all the pending deposits.
|
||||
.containsExactly("New Registrar", "The Registrar", "external_monitoring");
|
||||
// Domain fragments.
|
||||
if (kv.getKey().tld().equals("soy")) {
|
||||
if ("soy".equals(kv.getKey().tld())) {
|
||||
assertThat(
|
||||
getFragmentForType(kv, DOMAIN)
|
||||
.map(getXmlElement(DOMAIN_NAME_PATTERN))
|
||||
@@ -404,7 +401,7 @@ public class RdePipelineTest {
|
||||
}
|
||||
if (kv.getKey().mode().equals(FULL)) {
|
||||
// Contact fragments for hello.soy.
|
||||
if (kv.getKey().tld().equals("soy")) {
|
||||
if ("soy".equals(kv.getKey().tld())) {
|
||||
assertThat(
|
||||
getFragmentForType(kv, CONTACT)
|
||||
.map(getXmlElement(CONTACT_ID_PATTERN))
|
||||
@@ -528,7 +525,7 @@ public class RdePipelineTest {
|
||||
decryptGhostrydeGcsFile(prefix + "soy_2000-01-01_thin_S1_" + revision + ".xml.ghostryde");
|
||||
assertThat(brdaOutputFile)
|
||||
.isEqualTo(
|
||||
readResourceUtf8(this.getClass(), "reducer_brda.xml")
|
||||
readResourceUtf8(getClass(), "reducer_brda.xml")
|
||||
.replace("%RESEND%", manual ? "" : " resend=\"1\""));
|
||||
compareLength(brdaOutputFile, prefix + "soy_2000-01-01_thin_S1_" + revision + ".xml.length");
|
||||
|
||||
@@ -577,7 +574,7 @@ public class RdePipelineTest {
|
||||
}
|
||||
|
||||
private static Function<DepositFragment, String> getXmlElement(String pattern) {
|
||||
return (fragment) -> {
|
||||
return fragment -> {
|
||||
Matcher matcher = Pattern.compile(pattern).matcher(fragment.xml());
|
||||
checkState(matcher.find(), "Missing %s in xml.", pattern);
|
||||
return matcher.group(1);
|
||||
|
||||
@@ -42,7 +42,6 @@ import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.ImmutableSortedMap;
|
||||
import com.google.common.collect.Ordering;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.flows.EppException;
|
||||
import google.registry.flows.FlowUtils.NotLoggedInException;
|
||||
import google.registry.flows.FlowUtils.UnknownCurrencyEppException;
|
||||
@@ -78,6 +77,7 @@ import google.registry.model.domain.token.AllocationToken;
|
||||
import google.registry.model.domain.token.AllocationToken.TokenStatus;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.model.reporting.HistoryEntry.HistoryEntryId;
|
||||
import google.registry.model.tld.Registry;
|
||||
import google.registry.model.tld.Registry.TldState;
|
||||
import google.registry.model.tld.label.ReservedList;
|
||||
@@ -192,12 +192,12 @@ class DomainCheckFlowTest extends ResourceCheckFlowTestCase<DomainCheckFlow, Dom
|
||||
void testSuccess_oneExists_allocationTokenIsRedeemed() throws Exception {
|
||||
setEppInput("domain_check_allocationtoken.xml");
|
||||
Domain domain = persistActiveDomain("example1.tld");
|
||||
Key<HistoryEntry> historyEntryKey = Key.create(Key.create(domain), HistoryEntry.class, 1L);
|
||||
HistoryEntryId historyEntryId = new HistoryEntryId(domain.getRepoId(), 1L);
|
||||
persistResource(
|
||||
new AllocationToken.Builder()
|
||||
.setToken("abc123")
|
||||
.setTokenType(SINGLE_USE)
|
||||
.setRedemptionHistoryEntry(HistoryEntry.createVKey(historyEntryKey))
|
||||
.setRedemptionHistoryId(historyEntryId)
|
||||
.build());
|
||||
doCheckTest(
|
||||
create(false, "example1.tld", "In use"),
|
||||
|
||||
@@ -72,7 +72,6 @@ import com.google.common.collect.ImmutableSortedMap;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Ordering;
|
||||
import com.google.common.truth.Truth8;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.config.RegistryConfig;
|
||||
import google.registry.flows.EppException;
|
||||
import google.registry.flows.EppException.UnimplementedExtensionException;
|
||||
@@ -172,6 +171,7 @@ import google.registry.model.registrar.Registrar.State;
|
||||
import google.registry.model.reporting.DomainTransactionRecord;
|
||||
import google.registry.model.reporting.DomainTransactionRecord.TransactionReportField;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.model.reporting.HistoryEntry.HistoryEntryId;
|
||||
import google.registry.model.tld.Registry;
|
||||
import google.registry.model.tld.Registry.TldState;
|
||||
import google.registry.model.tld.Registry.TldType;
|
||||
@@ -530,12 +530,12 @@ class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow, Domain
|
||||
ImmutableMap.of("DOMAIN", "example.tld", "YEARS", "2"));
|
||||
persistContactsAndHosts();
|
||||
Domain domain = persistActiveDomain("foo.tld");
|
||||
Key<HistoryEntry> historyEntryKey = Key.create(Key.create(domain), HistoryEntry.class, 505L);
|
||||
HistoryEntryId historyEntryId = new HistoryEntryId(domain.getRepoId(), 505L);
|
||||
persistResource(
|
||||
new AllocationToken.Builder()
|
||||
.setToken("abc123")
|
||||
.setTokenType(SINGLE_USE)
|
||||
.setRedemptionHistoryEntry(HistoryEntry.createVKey(historyEntryKey))
|
||||
.setRedemptionHistoryId(historyEntryId)
|
||||
.build());
|
||||
clock.advanceOneMilli();
|
||||
EppException thrown =
|
||||
@@ -556,8 +556,8 @@ class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow, Domain
|
||||
runFlow();
|
||||
assertSuccessfulCreate("tld", ImmutableSet.of(), token);
|
||||
HistoryEntry historyEntry = getHistoryEntries(reloadResourceByForeignKey()).get(0);
|
||||
assertThat(tm().transact(() -> tm().loadByEntity(token)).getRedemptionHistoryEntry())
|
||||
.hasValue(HistoryEntry.createVKey(Key.create(historyEntry)));
|
||||
assertThat(tm().transact(() -> tm().loadByEntity(token)).getRedemptionHistoryId())
|
||||
.hasValue(historyEntry.getHistoryEntryId());
|
||||
}
|
||||
|
||||
// DomainTransactionRecord is not propagated.
|
||||
@@ -1355,10 +1355,8 @@ class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow, Domain
|
||||
AllocationToken reloadedToken =
|
||||
tm().transact(() -> tm().loadByKey(VKey.createSql(AllocationToken.class, token)));
|
||||
assertThat(reloadedToken.isRedeemed()).isTrue();
|
||||
assertThat(reloadedToken.getRedemptionHistoryEntry())
|
||||
.hasValue(
|
||||
HistoryEntry.createVKey(
|
||||
Key.create(getHistoryEntries(reloadResourceByForeignKey()).get(0))));
|
||||
assertThat(reloadedToken.getRedemptionHistoryId())
|
||||
.hasValue(getHistoryEntries(reloadResourceByForeignKey()).get(0).getHistoryEntryId());
|
||||
}
|
||||
|
||||
private void assertAllocationTokenWasNotRedeemed(String token) {
|
||||
@@ -2570,7 +2568,7 @@ class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow, Domain
|
||||
runFlow();
|
||||
assertIcannReportingActivityFieldLogged("srs-dom-create");
|
||||
assertTldsFieldLogged("tld");
|
||||
// Ensure we log the client ID for srs-dom-create so we can also use it for attempted-adds.
|
||||
// Ensure we log the client ID for srs-dom-create, so we can also use it for attempted-adds.
|
||||
assertClientIdFieldLogged("TheRegistrar");
|
||||
}
|
||||
|
||||
@@ -2584,7 +2582,7 @@ class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow, Domain
|
||||
.build());
|
||||
runFlow();
|
||||
Domain domain = reloadResourceByForeignKey();
|
||||
HistoryEntry historyEntry = getHistoryEntries(domain).get(0);
|
||||
DomainHistory historyEntry = (DomainHistory) getHistoryEntries(domain).get(0);
|
||||
assertThat(historyEntry.getDomainTransactionRecords())
|
||||
.containsExactly(
|
||||
DomainTransactionRecord.create(
|
||||
@@ -2600,7 +2598,7 @@ class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow, Domain
|
||||
persistResource(Registry.get("tld").asBuilder().setTldType(TldType.TEST).build());
|
||||
runFlow();
|
||||
Domain domain = reloadResourceByForeignKey();
|
||||
HistoryEntry historyEntry = getHistoryEntries(domain).get(0);
|
||||
DomainHistory historyEntry = (DomainHistory) getHistoryEntries(domain).get(0);
|
||||
// No transaction records should be stored for test TLDs
|
||||
assertThat(historyEntry.getDomainTransactionRecords()).isEmpty();
|
||||
}
|
||||
|
||||
@@ -975,7 +975,7 @@ class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow, Domain
|
||||
"tld", TIME_BEFORE_FLOW.plusDays(1), NET_ADDS_1_YR, 1)))
|
||||
.build());
|
||||
runFlow();
|
||||
HistoryEntry persistedEntry = getOnlyHistoryEntryOfType(domain, DOMAIN_DELETE);
|
||||
DomainHistory persistedEntry = (DomainHistory) getOnlyHistoryEntryOfType(domain, DOMAIN_DELETE);
|
||||
// No transaction records should be recorded for test TLDs
|
||||
assertThat(persistedEntry.getDomainTransactionRecords()).isEmpty();
|
||||
}
|
||||
@@ -997,7 +997,7 @@ class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow, Domain
|
||||
"tld", TIME_BEFORE_FLOW.plusDays(1), NET_ADDS_1_YR, 1)))
|
||||
.build());
|
||||
runFlow();
|
||||
HistoryEntry persistedEntry = getOnlyHistoryEntryOfType(domain, DOMAIN_DELETE);
|
||||
DomainHistory persistedEntry = (DomainHistory) getOnlyHistoryEntryOfType(domain, DOMAIN_DELETE);
|
||||
// Transaction record should just be the non-grace period delete
|
||||
assertThat(persistedEntry.getDomainTransactionRecords())
|
||||
.containsExactly(
|
||||
@@ -1023,7 +1023,7 @@ class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow, Domain
|
||||
"tld", TIME_BEFORE_FLOW.plusDays(1), RESTORED_DOMAINS, 1)))
|
||||
.build());
|
||||
runFlow();
|
||||
HistoryEntry persistedEntry = getOnlyHistoryEntryOfType(domain, DOMAIN_DELETE);
|
||||
DomainHistory persistedEntry = (DomainHistory) getOnlyHistoryEntryOfType(domain, DOMAIN_DELETE);
|
||||
// Transaction record should just be the non-grace period delete
|
||||
assertThat(persistedEntry.getDomainTransactionRecords())
|
||||
.containsExactly(
|
||||
@@ -1051,7 +1051,7 @@ class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow, Domain
|
||||
.setDomainTransactionRecords(ImmutableSet.of(renewRecord, notCancellableRecord))
|
||||
.build());
|
||||
runFlow();
|
||||
HistoryEntry persistedEntry = getOnlyHistoryEntryOfType(domain, DOMAIN_DELETE);
|
||||
DomainHistory persistedEntry = (DomainHistory) getOnlyHistoryEntryOfType(domain, DOMAIN_DELETE);
|
||||
// We should only see the non-grace period delete record and the renew cancellation record
|
||||
assertThat(persistedEntry.getDomainTransactionRecords())
|
||||
.containsExactly(
|
||||
@@ -1073,7 +1073,7 @@ class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow, Domain
|
||||
setUpGracePeriodDurations();
|
||||
clock.advanceOneMilli();
|
||||
runFlow();
|
||||
HistoryEntry persistedEntry = getOnlyHistoryEntryOfType(domain, DOMAIN_DELETE);
|
||||
DomainHistory persistedEntry = (DomainHistory) getOnlyHistoryEntryOfType(domain, DOMAIN_DELETE);
|
||||
// Transaction record should just be the grace period delete
|
||||
assertThat(persistedEntry.getDomainTransactionRecords())
|
||||
.containsExactly(
|
||||
@@ -1115,7 +1115,7 @@ class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow, Domain
|
||||
.setDomainTransactionRecords(ImmutableSet.of(existingRecord))
|
||||
.build());
|
||||
runFlow();
|
||||
HistoryEntry persistedEntry = getOnlyHistoryEntryOfType(domain, DOMAIN_DELETE);
|
||||
DomainHistory persistedEntry = (DomainHistory) getOnlyHistoryEntryOfType(domain, DOMAIN_DELETE);
|
||||
// Transaction record should be the grace period delete, and the more recent cancellation record
|
||||
assertThat(persistedEntry.getDomainTransactionRecords())
|
||||
.containsExactly(
|
||||
|
||||
@@ -119,7 +119,7 @@ public class DomainPricingLogicTest {
|
||||
.setId(2L)
|
||||
.setReason(Reason.RENEW)
|
||||
.setRenewalPriceBehavior(renewalPriceBehavior)
|
||||
.setRenewalPrice(renewalPrice.isPresent() ? renewalPrice.get() : null)
|
||||
.setRenewalPrice(renewalPrice.orElse(null))
|
||||
.setRecurrenceEndTime(END_OF_TIME)
|
||||
.setTargetId(domain.getDomainName())
|
||||
.build());
|
||||
|
||||
@@ -50,7 +50,6 @@ import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.ImmutableSortedMap;
|
||||
import com.google.common.truth.Truth8;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.flows.EppException;
|
||||
import google.registry.flows.EppRequestSource;
|
||||
import google.registry.flows.FlowUtils.NotLoggedInException;
|
||||
@@ -95,6 +94,7 @@ import google.registry.model.registrar.Registrar.State;
|
||||
import google.registry.model.reporting.DomainTransactionRecord;
|
||||
import google.registry.model.reporting.DomainTransactionRecord.TransactionReportField;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.model.reporting.HistoryEntry.HistoryEntryId;
|
||||
import google.registry.model.tld.Registry;
|
||||
import google.registry.persistence.VKey;
|
||||
import google.registry.testing.DatabaseHelper;
|
||||
@@ -609,8 +609,7 @@ class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, Domain>
|
||||
loadFile(
|
||||
"domain_renew_response.xml",
|
||||
ImmutableMap.of("DOMAIN", "example.tld", "EXDATE", "2002-04-03T22:00:00.0Z")));
|
||||
assertThat(DatabaseHelper.loadByEntity(allocationToken).getRedemptionHistoryEntry())
|
||||
.isPresent();
|
||||
assertThat(DatabaseHelper.loadByEntity(allocationToken).getRedemptionHistoryId()).isPresent();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -745,12 +744,12 @@ class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, Domain>
|
||||
ImmutableMap.of("DOMAIN", "example.tld", "YEARS", "2", "TOKEN", "abc123"));
|
||||
persistDomain();
|
||||
Domain domain = persistActiveDomain("foo.tld");
|
||||
Key<HistoryEntry> historyEntryKey = Key.create(Key.create(domain), HistoryEntry.class, 505L);
|
||||
HistoryEntryId historyEntryId = new HistoryEntryId(domain.getRepoId(), 505L);
|
||||
persistResource(
|
||||
new AllocationToken.Builder()
|
||||
.setToken("abc123")
|
||||
.setTokenType(SINGLE_USE)
|
||||
.setRedemptionHistoryEntry(HistoryEntry.createVKey(historyEntryKey))
|
||||
.setRedemptionHistoryId(historyEntryId)
|
||||
.build());
|
||||
clock.advanceOneMilli();
|
||||
EppException thrown =
|
||||
@@ -1188,7 +1187,8 @@ class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, Domain>
|
||||
.build());
|
||||
runFlow();
|
||||
Domain domain = reloadResourceByForeignKey();
|
||||
HistoryEntry historyEntry = getOnlyHistoryEntryOfType(domain, HistoryEntry.Type.DOMAIN_RENEW);
|
||||
DomainHistory historyEntry =
|
||||
(DomainHistory) getOnlyHistoryEntryOfType(domain, HistoryEntry.Type.DOMAIN_RENEW);
|
||||
assertThat(historyEntry.getDomainTransactionRecords())
|
||||
.containsExactly(
|
||||
DomainTransactionRecord.create(
|
||||
|
||||
@@ -773,8 +773,8 @@ class DomainRestoreRequestFlowTest extends ResourceFlowTestCase<DomainRestoreReq
|
||||
persistPendingDeleteDomain();
|
||||
runFlow();
|
||||
Domain domain = reloadResourceByForeignKey();
|
||||
HistoryEntry historyEntryDomainRestore =
|
||||
getOnlyHistoryEntryOfType(domain, HistoryEntry.Type.DOMAIN_RESTORE);
|
||||
DomainHistory historyEntryDomainRestore =
|
||||
(DomainHistory) getOnlyHistoryEntryOfType(domain, HistoryEntry.Type.DOMAIN_RESTORE);
|
||||
assertThat(historyEntryDomainRestore.getDomainTransactionRecords())
|
||||
.containsExactly(
|
||||
DomainTransactionRecord.create(
|
||||
|
||||
@@ -45,7 +45,6 @@ import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.ImmutableSortedMap;
|
||||
import com.google.common.collect.Ordering;
|
||||
import com.google.common.collect.Streams;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.flows.EppException;
|
||||
import google.registry.flows.FlowUtils.NotLoggedInException;
|
||||
import google.registry.flows.ResourceFlowUtils.BadAuthInfoForResourceException;
|
||||
@@ -81,6 +80,7 @@ import google.registry.model.poll.PendingActionNotificationResponse;
|
||||
import google.registry.model.poll.PollMessage;
|
||||
import google.registry.model.reporting.DomainTransactionRecord;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.model.reporting.HistoryEntry.HistoryEntryId;
|
||||
import google.registry.model.tld.Registry;
|
||||
import google.registry.model.tld.label.PremiumList;
|
||||
import google.registry.model.tld.label.PremiumListDao;
|
||||
@@ -207,7 +207,9 @@ class DomainTransferApproveFlowTest
|
||||
DOMAIN_CREATE, DOMAIN_TRANSFER_REQUEST, DOMAIN_TRANSFER_APPROVE);
|
||||
final HistoryEntry historyEntryTransferApproved =
|
||||
getOnlyHistoryEntryOfType(domain, DOMAIN_TRANSFER_APPROVE);
|
||||
assertAboutHistoryEntries().that(historyEntryTransferApproved).hasOtherClientId("NewRegistrar");
|
||||
assertAboutHistoryEntries()
|
||||
.that(historyEntryTransferApproved)
|
||||
.hasOtherRegistrarId("NewRegistrar");
|
||||
assertTransferApproved(domain, originalTransferData);
|
||||
assertAboutDomains().that(domain).hasRegistrationExpirationTime(expectedExpirationTime);
|
||||
assertThat(loadByKey(domain.getAutorenewBillingEvent()).getEventTime())
|
||||
@@ -697,7 +699,8 @@ class DomainTransferApproveFlowTest
|
||||
setUpGracePeriodDurations();
|
||||
clock.advanceOneMilli();
|
||||
runFlow();
|
||||
HistoryEntry persistedEntry = getOnlyHistoryEntryOfType(domain, DOMAIN_TRANSFER_APPROVE);
|
||||
DomainHistory persistedEntry =
|
||||
(DomainHistory) getOnlyHistoryEntryOfType(domain, DOMAIN_TRANSFER_APPROVE);
|
||||
// We should only produce a transfer success record for (now + transfer grace period)
|
||||
assertThat(persistedEntry.getDomainTransactionRecords())
|
||||
.containsExactly(
|
||||
@@ -724,7 +727,8 @@ class DomainTransferApproveFlowTest
|
||||
ImmutableSet.of(previousSuccessRecord, notCancellableRecord))
|
||||
.build());
|
||||
runFlow();
|
||||
HistoryEntry persistedEntry = getOnlyHistoryEntryOfType(domain, DOMAIN_TRANSFER_APPROVE);
|
||||
DomainHistory persistedEntry =
|
||||
(DomainHistory) getOnlyHistoryEntryOfType(domain, DOMAIN_TRANSFER_APPROVE);
|
||||
// We should only produce cancellation records for the original reporting date (now + 1 day) and
|
||||
// success records for the new reporting date (now + transferGracePeriod=3 days)
|
||||
assertThat(persistedEntry.getDomainTransactionRecords())
|
||||
@@ -884,12 +888,12 @@ class DomainTransferApproveFlowTest
|
||||
@Test
|
||||
void testFailure_allocationTokenAlreadyRedeemed() throws Exception {
|
||||
Domain domain = DatabaseHelper.newDomain("foo.tld");
|
||||
Key<HistoryEntry> historyEntryKey = Key.create(Key.create(domain), HistoryEntry.class, 505L);
|
||||
HistoryEntryId historyEntryId = new HistoryEntryId(domain.getRepoId(), 505L);
|
||||
persistResource(
|
||||
new AllocationToken.Builder()
|
||||
.setToken("abc123")
|
||||
.setTokenType(SINGLE_USE)
|
||||
.setRedemptionHistoryEntry(HistoryEntry.createVKey(historyEntryKey))
|
||||
.setRedemptionHistoryId(historyEntryId)
|
||||
.build());
|
||||
setEppInput("domain_transfer_approve_allocation_token.xml");
|
||||
EppException thrown =
|
||||
|
||||
@@ -145,7 +145,7 @@ class DomainTransferCancelFlowTest
|
||||
.that(historyEntryTransferCancel)
|
||||
.hasRegistrarId("NewRegistrar")
|
||||
.and()
|
||||
.hasOtherClientId("TheRegistrar");
|
||||
.hasOtherRegistrarId("TheRegistrar");
|
||||
// The only billing event left should be the original autorenew event, now reopened.
|
||||
assertBillingEvents(
|
||||
getLosingClientAutorenewEvent().asBuilder().setRecurrenceEndTime(END_OF_TIME).build());
|
||||
@@ -381,7 +381,8 @@ class DomainTransferCancelFlowTest
|
||||
void testIcannTransactionRecord_noRecordsToCancel() throws Exception {
|
||||
clock.advanceOneMilli();
|
||||
runFlow();
|
||||
HistoryEntry persistedEntry = getOnlyHistoryEntryOfType(domain, DOMAIN_TRANSFER_CANCEL);
|
||||
DomainHistory persistedEntry =
|
||||
(DomainHistory) getOnlyHistoryEntryOfType(domain, DOMAIN_TRANSFER_CANCEL);
|
||||
// No cancellation records should be produced
|
||||
assertThat(persistedEntry.getDomainTransactionRecords()).isEmpty();
|
||||
}
|
||||
@@ -410,7 +411,8 @@ class DomainTransferCancelFlowTest
|
||||
ImmutableSet.of(previousSuccessRecord, notCancellableRecord))
|
||||
.build());
|
||||
runFlow();
|
||||
HistoryEntry persistedEntry = getOnlyHistoryEntryOfType(domain, DOMAIN_TRANSFER_CANCEL);
|
||||
DomainHistory persistedEntry =
|
||||
(DomainHistory) getOnlyHistoryEntryOfType(domain, DOMAIN_TRANSFER_CANCEL);
|
||||
// We should only produce a cancellation record for the original transfer success
|
||||
assertThat(persistedEntry.getDomainTransactionRecords())
|
||||
.containsExactly(previousSuccessRecord.asBuilder().setReportAmount(-1).build());
|
||||
|
||||
@@ -111,7 +111,9 @@ class DomainTransferRejectFlowTest
|
||||
.hasLastEppUpdateClientId("TheRegistrar");
|
||||
final HistoryEntry historyEntryTransferRejected =
|
||||
getOnlyHistoryEntryOfType(domain, DOMAIN_TRANSFER_REJECT);
|
||||
assertAboutHistoryEntries().that(historyEntryTransferRejected).hasOtherClientId("NewRegistrar");
|
||||
assertAboutHistoryEntries()
|
||||
.that(historyEntryTransferRejected)
|
||||
.hasOtherRegistrarId("NewRegistrar");
|
||||
assertLastHistoryContainsResource(domain);
|
||||
// The only billing event left should be the original autorenew event, now reopened.
|
||||
assertBillingEvents(
|
||||
@@ -352,7 +354,8 @@ class DomainTransferRejectFlowTest
|
||||
void testIcannTransactionRecord_noRecordsToCancel() throws Exception {
|
||||
setUpGracePeriodDurations();
|
||||
runFlow();
|
||||
HistoryEntry persistedEntry = getOnlyHistoryEntryOfType(domain, DOMAIN_TRANSFER_REJECT);
|
||||
DomainHistory persistedEntry =
|
||||
(DomainHistory) getOnlyHistoryEntryOfType(domain, DOMAIN_TRANSFER_REJECT);
|
||||
// We should only produce transfer nacked records, reported now
|
||||
assertThat(persistedEntry.getDomainTransactionRecords())
|
||||
.containsExactly(DomainTransactionRecord.create("tld", clock.nowUtc(), TRANSFER_NACKED, 1));
|
||||
@@ -376,7 +379,8 @@ class DomainTransferRejectFlowTest
|
||||
ImmutableSet.of(previousSuccessRecord, notCancellableRecord))
|
||||
.build());
|
||||
runFlow();
|
||||
HistoryEntry persistedEntry = getOnlyHistoryEntryOfType(domain, DOMAIN_TRANSFER_REJECT);
|
||||
DomainHistory persistedEntry =
|
||||
(DomainHistory) getOnlyHistoryEntryOfType(domain, DOMAIN_TRANSFER_REJECT);
|
||||
// We should only produce cancellation records for the original success records and nack records
|
||||
assertThat(persistedEntry.getDomainTransactionRecords())
|
||||
.containsExactly(
|
||||
|
||||
@@ -61,7 +61,6 @@ import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.google.common.collect.Streams;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.batch.ResaveEntityAction;
|
||||
import google.registry.flows.EppException;
|
||||
import google.registry.flows.EppRequestSource;
|
||||
@@ -114,6 +113,7 @@ import google.registry.model.registrar.Registrar;
|
||||
import google.registry.model.registrar.Registrar.State;
|
||||
import google.registry.model.reporting.DomainTransactionRecord;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.model.reporting.HistoryEntry.HistoryEntryId;
|
||||
import google.registry.model.tld.Registry;
|
||||
import google.registry.model.tld.label.PremiumList;
|
||||
import google.registry.model.tld.label.PremiumListDao;
|
||||
@@ -500,7 +500,7 @@ class DomainTransferRequestFlowTest
|
||||
.that(historyEntryTransferRequest)
|
||||
.hasPeriodYears(1)
|
||||
.and()
|
||||
.hasOtherClientId("TheRegistrar");
|
||||
.hasOtherRegistrarId("TheRegistrar");
|
||||
// Verify correct fields were set.
|
||||
assertTransferRequested(
|
||||
domain, implicitTransferTime, Period.create(1, Unit.YEARS), expectedExpirationTime);
|
||||
@@ -608,7 +608,7 @@ class DomainTransferRequestFlowTest
|
||||
.that(historyEntryTransferRequest)
|
||||
.hasPeriodYears(expectedPeriod.getValue())
|
||||
.and()
|
||||
.hasOtherClientId("TheRegistrar");
|
||||
.hasOtherRegistrarId("TheRegistrar");
|
||||
// Verify correct fields were set.
|
||||
assertTransferRequested(domain, implicitTransferTime, expectedPeriod, expectedExpirationTime);
|
||||
|
||||
@@ -1682,7 +1682,8 @@ class DomainTransferRequestFlowTest
|
||||
.build());
|
||||
clock.advanceOneMilli();
|
||||
runTest("domain_transfer_request.xml", UserPrivileges.NORMAL);
|
||||
HistoryEntry persistedEntry = getOnlyHistoryEntryOfType(domain, DOMAIN_TRANSFER_REQUEST);
|
||||
DomainHistory persistedEntry =
|
||||
(DomainHistory) getOnlyHistoryEntryOfType(domain, DOMAIN_TRANSFER_REQUEST);
|
||||
// We should produce a transfer success record
|
||||
assertThat(persistedEntry.getDomainTransactionRecords())
|
||||
.containsExactly(
|
||||
@@ -1795,12 +1796,12 @@ class DomainTransferRequestFlowTest
|
||||
void testFailure_allocationTokenAlreadyRedeemed() throws Exception {
|
||||
setupDomain("example", "tld");
|
||||
Domain domain = DatabaseHelper.newDomain("foo.tld");
|
||||
Key<HistoryEntry> historyEntryKey = Key.create(Key.create(domain), HistoryEntry.class, 505L);
|
||||
HistoryEntryId historyEntryId = new HistoryEntryId(domain.getRepoId(), 505L);
|
||||
persistResource(
|
||||
new AllocationToken.Builder()
|
||||
.setToken("abc123")
|
||||
.setTokenType(SINGLE_USE)
|
||||
.setRedemptionHistoryEntry(HistoryEntry.createVKey(historyEntryKey))
|
||||
.setRedemptionHistoryId(historyEntryId)
|
||||
.build());
|
||||
setEppInput("domain_transfer_request_allocation_token.xml", ImmutableMap.of("TOKEN", "abc123"));
|
||||
EppException thrown =
|
||||
|
||||
+5
-6
@@ -37,7 +37,6 @@ import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.ImmutableSortedMap;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.net.InternetDomainName;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.flows.EppException;
|
||||
import google.registry.flows.domain.token.AllocationTokenFlowUtils.AllocationTokenNotInPromotionException;
|
||||
import google.registry.flows.domain.token.AllocationTokenFlowUtils.AllocationTokenNotValidForRegistrarException;
|
||||
@@ -48,7 +47,7 @@ import google.registry.model.domain.DomainCommand;
|
||||
import google.registry.model.domain.token.AllocationToken;
|
||||
import google.registry.model.domain.token.AllocationToken.TokenStatus;
|
||||
import google.registry.model.domain.token.AllocationTokenExtension;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.model.reporting.HistoryEntry.HistoryEntryId;
|
||||
import google.registry.model.tld.Registry;
|
||||
import google.registry.testing.AppEngineExtension;
|
||||
import google.registry.testing.DatabaseHelper;
|
||||
@@ -256,7 +255,7 @@ class AllocationTokenFlowUtilsTest {
|
||||
|
||||
@Test
|
||||
void test_validateTokenCreate_promoCancelled() {
|
||||
// the promo would be valid but it was cancelled 12 hours ago
|
||||
// the promo would be valid, but it was cancelled 12 hours ago
|
||||
persistResource(
|
||||
createOneMonthPromoTokenBuilder(DateTime.now(UTC).minusDays(1))
|
||||
.setTokenStatusTransitions(
|
||||
@@ -271,7 +270,7 @@ class AllocationTokenFlowUtilsTest {
|
||||
|
||||
@Test
|
||||
void test_validateTokenExistingDomain_promoCancelled() {
|
||||
// the promo would be valid but it was cancelled 12 hours ago
|
||||
// the promo would be valid, but it was cancelled 12 hours ago
|
||||
persistResource(
|
||||
createOneMonthPromoTokenBuilder(DateTime.now(UTC).minusDays(1))
|
||||
.setTokenStatusTransitions(
|
||||
@@ -306,12 +305,12 @@ class AllocationTokenFlowUtilsTest {
|
||||
@Test
|
||||
void test_checkDomainsWithToken_showsFailureMessageForRedeemedToken() {
|
||||
Domain domain = persistActiveDomain("example.tld");
|
||||
Key<HistoryEntry> historyEntryKey = Key.create(Key.create(domain), HistoryEntry.class, 1051L);
|
||||
HistoryEntryId historyEntryId = new HistoryEntryId(domain.getRepoId(), 1051L);
|
||||
persistResource(
|
||||
new AllocationToken.Builder()
|
||||
.setToken("tokeN")
|
||||
.setTokenType(SINGLE_USE)
|
||||
.setRedemptionHistoryEntry(HistoryEntry.createVKey(historyEntryKey))
|
||||
.setRedemptionHistoryId(historyEntryId)
|
||||
.build());
|
||||
assertThat(
|
||||
flowUtils
|
||||
|
||||
@@ -41,7 +41,7 @@ public final class OteStatsTestHelper {
|
||||
DateTime now = DateTime.now(DateTimeZone.UTC);
|
||||
persistResource(
|
||||
new DomainHistory.Builder()
|
||||
.setDomainRepoId(persistActiveDomain("xn--abc-873b2e7eb1k8a4lpjvv.tld").getRepoId())
|
||||
.setDomain(persistActiveDomain("xn--abc-873b2e7eb1k8a4lpjvv.tld"))
|
||||
.setRegistrarId(oteAccount1)
|
||||
.setType(Type.DOMAIN_CREATE)
|
||||
.setXmlBytes(getBytes("domain_create_idn.xml"))
|
||||
@@ -49,7 +49,7 @@ public final class OteStatsTestHelper {
|
||||
.build());
|
||||
persistResource(
|
||||
new DomainHistory.Builder()
|
||||
.setDomainRepoId(persistActiveDomain("example.tld").getRepoId())
|
||||
.setDomain(persistActiveDomain("example.tld"))
|
||||
.setRegistrarId(oteAccount1)
|
||||
.setType(Type.DOMAIN_RESTORE)
|
||||
.setXmlBytes(getBytes("domain_restore.xml"))
|
||||
@@ -57,7 +57,7 @@ public final class OteStatsTestHelper {
|
||||
.build());
|
||||
persistResource(
|
||||
new HostHistory.Builder()
|
||||
.setHostRepoId(persistDeletedHost("ns1.example.tld", now).getRepoId())
|
||||
.setHost(persistDeletedHost("ns1.example.tld", now))
|
||||
.setRegistrarId(oteAccount1)
|
||||
.setType(Type.HOST_DELETE)
|
||||
.setXmlBytes(getBytes("host_delete.xml"))
|
||||
@@ -86,7 +86,7 @@ public final class OteStatsTestHelper {
|
||||
DateTime now = DateTime.now(DateTimeZone.UTC);
|
||||
persistResource(
|
||||
new DomainHistory.Builder()
|
||||
.setDomainRepoId(persistActiveDomain("exampleone.tld").getRepoId())
|
||||
.setDomain(persistActiveDomain("exampleone.tld"))
|
||||
.setRegistrarId(oteAccount1)
|
||||
.setType(Type.DOMAIN_CREATE)
|
||||
.setXmlBytes(getBytes("domain_create_sunrise.xml"))
|
||||
@@ -94,7 +94,7 @@ public final class OteStatsTestHelper {
|
||||
.build());
|
||||
persistResource(
|
||||
new DomainHistory.Builder()
|
||||
.setDomainRepoId(persistActiveDomain("example-one.tld").getRepoId())
|
||||
.setDomain(persistActiveDomain("example-one.tld"))
|
||||
.setRegistrarId(oteAccount1)
|
||||
.setType(Type.DOMAIN_CREATE)
|
||||
.setXmlBytes(getBytes("domain_create_claim_notice.xml"))
|
||||
@@ -102,7 +102,7 @@ public final class OteStatsTestHelper {
|
||||
.build());
|
||||
persistResource(
|
||||
new DomainHistory.Builder()
|
||||
.setDomainRepoId(persistActiveDomain("example.tld").getRepoId())
|
||||
.setDomain(persistActiveDomain("example.tld"))
|
||||
.setRegistrarId(oteAccount1)
|
||||
.setType(Type.DOMAIN_CREATE)
|
||||
.setXmlBytes(getBytes("domain_create_anchor_tenant_fee_standard.xml"))
|
||||
@@ -110,7 +110,7 @@ public final class OteStatsTestHelper {
|
||||
.build());
|
||||
persistResource(
|
||||
new DomainHistory.Builder()
|
||||
.setDomainRepoId(persistActiveDomain("example.tld").getRepoId())
|
||||
.setDomain(persistActiveDomain("example.tld"))
|
||||
.setRegistrarId(oteAccount1)
|
||||
.setType(Type.DOMAIN_CREATE)
|
||||
.setXmlBytes(getBytes("domain_create_dsdata.xml"))
|
||||
@@ -118,7 +118,7 @@ public final class OteStatsTestHelper {
|
||||
.build());
|
||||
persistResource(
|
||||
new DomainHistory.Builder()
|
||||
.setDomainRepoId(persistDeletedDomain("example.tld", now).getRepoId())
|
||||
.setDomain(persistDeletedDomain("example.tld", now))
|
||||
.setRegistrarId(oteAccount1)
|
||||
.setType(Type.DOMAIN_DELETE)
|
||||
.setXmlBytes(getBytes("domain_delete.xml"))
|
||||
@@ -126,7 +126,7 @@ public final class OteStatsTestHelper {
|
||||
.build());
|
||||
persistResource(
|
||||
new DomainHistory.Builder()
|
||||
.setDomainRepoId(persistActiveDomain("example.tld").getRepoId())
|
||||
.setDomain(persistActiveDomain("example.tld"))
|
||||
.setRegistrarId(oteAccount1)
|
||||
.setType(Type.DOMAIN_TRANSFER_APPROVE)
|
||||
.setXmlBytes(getBytes("domain_transfer_approve.xml"))
|
||||
@@ -134,7 +134,7 @@ public final class OteStatsTestHelper {
|
||||
.build());
|
||||
persistResource(
|
||||
new DomainHistory.Builder()
|
||||
.setDomainRepoId(persistActiveDomain("example.tld").getRepoId())
|
||||
.setDomain(persistActiveDomain("example.tld"))
|
||||
.setRegistrarId(oteAccount1)
|
||||
.setType(Type.DOMAIN_TRANSFER_CANCEL)
|
||||
.setXmlBytes(getBytes("domain_transfer_cancel.xml"))
|
||||
@@ -142,7 +142,7 @@ public final class OteStatsTestHelper {
|
||||
.build());
|
||||
persistResource(
|
||||
new DomainHistory.Builder()
|
||||
.setDomainRepoId(persistActiveDomain("example.tld").getRepoId())
|
||||
.setDomain(persistActiveDomain("example.tld"))
|
||||
.setRegistrarId(oteAccount1)
|
||||
.setType(Type.DOMAIN_TRANSFER_REJECT)
|
||||
.setXmlBytes(getBytes("domain_transfer_reject.xml"))
|
||||
@@ -150,7 +150,7 @@ public final class OteStatsTestHelper {
|
||||
.build());
|
||||
persistResource(
|
||||
new DomainHistory.Builder()
|
||||
.setDomainRepoId(persistActiveDomain("example.tld").getRepoId())
|
||||
.setDomain(persistActiveDomain("example.tld"))
|
||||
.setRegistrarId(oteAccount1)
|
||||
.setType(Type.DOMAIN_TRANSFER_REQUEST)
|
||||
.setXmlBytes(getBytes("domain_transfer_request.xml"))
|
||||
@@ -158,7 +158,7 @@ public final class OteStatsTestHelper {
|
||||
.build());
|
||||
persistResource(
|
||||
new DomainHistory.Builder()
|
||||
.setDomainRepoId(persistActiveDomain("example.tld").getRepoId())
|
||||
.setDomain(persistActiveDomain("example.tld"))
|
||||
.setRegistrarId(oteAccount1)
|
||||
.setType(Type.DOMAIN_UPDATE)
|
||||
.setXmlBytes(getBytes("domain_update_with_secdns.xml"))
|
||||
@@ -166,7 +166,7 @@ public final class OteStatsTestHelper {
|
||||
.build());
|
||||
persistResource(
|
||||
new HostHistory.Builder()
|
||||
.setHostRepoId(persistActiveHost("example.tld").getRepoId())
|
||||
.setHost(persistActiveHost("example.tld"))
|
||||
.setRegistrarId(oteAccount1)
|
||||
.setType(Type.HOST_CREATE)
|
||||
.setXmlBytes(getBytes("host_create_complete.xml"))
|
||||
@@ -178,7 +178,7 @@ public final class OteStatsTestHelper {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
persistResource(
|
||||
new HostHistory.Builder()
|
||||
.setHostRepoId(persistActiveHost("example.tld").getRepoId())
|
||||
.setHost(persistActiveHost("example.tld"))
|
||||
.setRegistrarId(oteAccount1)
|
||||
.setType(Type.HOST_UPDATE)
|
||||
.setXmlBytes(getBytes("host_update.xml"))
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
package google.registry.model;
|
||||
|
||||
import google.registry.model.annotations.DeleteAfterMigration;
|
||||
import google.registry.testing.AppEngineExtension;
|
||||
import google.registry.testing.GoldenFileTestHelper;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -24,6 +25,7 @@ import org.junit.jupiter.api.extension.RegisterExtension;
|
||||
*
|
||||
* <p>If the test breaks, the instructions below will be printed.
|
||||
*/
|
||||
@DeleteAfterMigration
|
||||
public class SchemaVersionTest {
|
||||
|
||||
@RegisterExtension
|
||||
|
||||
@@ -262,7 +262,7 @@ public class BillingEventTest extends EntityTestCase {
|
||||
BillingEvent.Cancellation.forGracePeriod(
|
||||
GracePeriod.forBillingEvent(GracePeriodStatus.ADD, domain.getRepoId(), oneTime),
|
||||
domainHistory2.getModificationTime(),
|
||||
domainHistory2.getDomainHistoryId(),
|
||||
domainHistory2.getHistoryEntryId(),
|
||||
"foo.tld");
|
||||
// Set ID to be the same to ignore for the purposes of comparison.
|
||||
assertThat(newCancellation.asBuilder().setId(cancellationOneTime.getId()).build())
|
||||
@@ -280,7 +280,7 @@ public class BillingEventTest extends EntityTestCase {
|
||||
"TheRegistrar",
|
||||
recurring.createVKey()),
|
||||
domainHistory2.getModificationTime(),
|
||||
domainHistory2.getDomainHistoryId(),
|
||||
domainHistory2.getHistoryEntryId(),
|
||||
"foo.tld");
|
||||
// Set ID to be the same to ignore for the purposes of comparison.
|
||||
assertThat(newCancellation.asBuilder().setId(cancellationRecurring.getId()).build())
|
||||
@@ -300,7 +300,7 @@ public class BillingEventTest extends EntityTestCase {
|
||||
now.plusDays(1),
|
||||
"a registrar"),
|
||||
domainHistory.getModificationTime(),
|
||||
domainHistory.getDomainHistoryId(),
|
||||
domainHistory.getHistoryEntryId(),
|
||||
"foo.tld"));
|
||||
assertThat(thrown).hasMessageThat().contains("grace period without billing event");
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ import google.registry.model.contact.Contact;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.host.Host;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.testing.TestObject;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -42,7 +41,6 @@ public class ClassPathManagerTest {
|
||||
assertThat(ClassPathManager.getClass("Contact")).isEqualTo(Contact.class);
|
||||
assertThat(ClassPathManager.getClass("GaeUserIdConverter")).isEqualTo(GaeUserIdConverter.class);
|
||||
assertThat(ClassPathManager.getClass("Domain")).isEqualTo(Domain.class);
|
||||
assertThat(ClassPathManager.getClass("HistoryEntry")).isEqualTo(HistoryEntry.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -80,7 +78,6 @@ public class ClassPathManagerTest {
|
||||
assertThat(ClassPathManager.getClassName(GaeUserIdConverter.class))
|
||||
.isEqualTo("GaeUserIdConverter");
|
||||
assertThat(ClassPathManager.getClassName(Domain.class)).isEqualTo("Domain");
|
||||
assertThat(ClassPathManager.getClassName(HistoryEntry.class)).isEqualTo("HistoryEntry");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -29,16 +29,11 @@ import static google.registry.testing.SqlHelper.assertThrowForeignKeyViolation;
|
||||
import static google.registry.testing.SqlHelper.saveRegistrar;
|
||||
import static google.registry.util.DateTimeUtils.END_OF_TIME;
|
||||
import static google.registry.util.DateTimeUtils.START_OF_TIME;
|
||||
import static org.joda.money.CurrencyUnit.USD;
|
||||
import static org.joda.time.DateTimeZone.UTC;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.ImmutableSortedMap;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.billing.BillingEvent;
|
||||
import google.registry.model.billing.BillingEvent.Flag;
|
||||
import google.registry.model.billing.BillingEvent.Reason;
|
||||
import google.registry.model.billing.BillingEvent.RenewalPriceBehavior;
|
||||
import google.registry.model.contact.Contact;
|
||||
import google.registry.model.domain.DesignatedContact.Type;
|
||||
@@ -50,16 +45,12 @@ import google.registry.model.domain.token.AllocationToken.TokenStatus;
|
||||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
import google.registry.model.host.Host;
|
||||
import google.registry.model.poll.PollMessage;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.model.transfer.ContactTransferData;
|
||||
import google.registry.model.transfer.DomainTransferData;
|
||||
import google.registry.persistence.VKey;
|
||||
import google.registry.testing.AppEngineExtension;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.util.SerializeUtils;
|
||||
import java.util.Arrays;
|
||||
import org.joda.money.Money;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -80,14 +71,12 @@ public class DomainSqlTest {
|
||||
.build();
|
||||
|
||||
private Domain domain;
|
||||
private DomainHistory historyEntry;
|
||||
private VKey<Contact> contactKey;
|
||||
private VKey<Contact> contact2Key;
|
||||
private VKey<Host> host1VKey;
|
||||
private Host host;
|
||||
private Contact contact;
|
||||
private Contact contact2;
|
||||
private ImmutableSet<GracePeriod> gracePeriods;
|
||||
private AllocationToken allocationToken;
|
||||
|
||||
@BeforeEach
|
||||
@@ -411,131 +400,8 @@ public class DomainSqlTest {
|
||||
insertInDb(contact, contact2, domain, host);
|
||||
}
|
||||
|
||||
@Test
|
||||
void persistDomainWithCompositeVKeys() {
|
||||
createTld("com");
|
||||
historyEntry =
|
||||
new DomainHistory.Builder()
|
||||
.setId(100L)
|
||||
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
||||
.setPeriod(Period.create(1, Period.Unit.YEARS))
|
||||
.setModificationTime(DateTime.now(UTC))
|
||||
.setDomainRepoId("4-COM")
|
||||
.setRegistrarId("registrar1")
|
||||
// These are non-null, but I don't think some tests set them.
|
||||
.setReason("felt like it")
|
||||
.setRequestedByRegistrar(false)
|
||||
.setXmlBytes(new byte[0])
|
||||
.build();
|
||||
BillingEvent.Recurring billEvent =
|
||||
new BillingEvent.Recurring.Builder()
|
||||
.setId(200L)
|
||||
.setReason(Reason.RENEW)
|
||||
.setFlags(ImmutableSet.of(Flag.AUTO_RENEW))
|
||||
.setTargetId("example.com")
|
||||
.setRegistrarId("registrar1")
|
||||
.setEventTime(DateTime.now(UTC).plusYears(1))
|
||||
.setRecurrenceEndTime(END_OF_TIME)
|
||||
.setDomainHistory(historyEntry)
|
||||
.build();
|
||||
PollMessage.Autorenew autorenewPollMessage =
|
||||
new PollMessage.Autorenew.Builder()
|
||||
.setId(300L)
|
||||
.setRegistrarId("registrar1")
|
||||
.setEventTime(DateTime.now(UTC).plusYears(1))
|
||||
.setHistoryEntry(historyEntry)
|
||||
.build();
|
||||
PollMessage.OneTime deletePollMessage =
|
||||
new PollMessage.OneTime.Builder()
|
||||
.setId(400L)
|
||||
.setRegistrarId("registrar1")
|
||||
.setEventTime(DateTime.now(UTC).plusYears(1))
|
||||
.setHistoryEntry(historyEntry)
|
||||
.build();
|
||||
BillingEvent.OneTime oneTimeBillingEvent =
|
||||
new BillingEvent.OneTime.Builder()
|
||||
.setId(500L)
|
||||
// Use SERVER_STATUS so we don't have to add a period.
|
||||
.setReason(Reason.SERVER_STATUS)
|
||||
.setTargetId("example.com")
|
||||
.setRegistrarId("registrar1")
|
||||
.setBillingTime(DateTime.now(UTC))
|
||||
.setCost(Money.of(USD, 100))
|
||||
.setEventTime(DateTime.now(UTC).plusYears(1))
|
||||
.setDomainHistory(historyEntry)
|
||||
.build();
|
||||
DomainTransferData transferData =
|
||||
new DomainTransferData.Builder()
|
||||
.setServerApproveBillingEvent(oneTimeBillingEvent.createVKey())
|
||||
.setServerApproveAutorenewEvent(billEvent.createVKey())
|
||||
.setServerApproveAutorenewPollMessage(autorenewPollMessage.createVKey())
|
||||
.build();
|
||||
gracePeriods =
|
||||
ImmutableSet.of(
|
||||
GracePeriod.create(
|
||||
GracePeriodStatus.ADD,
|
||||
"4-COM",
|
||||
END_OF_TIME,
|
||||
"registrar1",
|
||||
oneTimeBillingEvent.createVKey()),
|
||||
GracePeriod.createForRecurring(
|
||||
GracePeriodStatus.AUTO_RENEW,
|
||||
"4-COM",
|
||||
END_OF_TIME,
|
||||
"registrar1",
|
||||
billEvent.createVKey()));
|
||||
|
||||
domain =
|
||||
domain
|
||||
.asBuilder()
|
||||
.setAutorenewBillingEvent(billEvent.createVKey())
|
||||
.setAutorenewPollMessage(autorenewPollMessage.createVKey())
|
||||
.setDeletePollMessage(deletePollMessage.createVKey())
|
||||
.setTransferData(transferData)
|
||||
.setGracePeriods(gracePeriods)
|
||||
.build();
|
||||
historyEntry = historyEntry.asBuilder().setDomain(domain).build();
|
||||
insertInDb(
|
||||
contact,
|
||||
contact2,
|
||||
host,
|
||||
historyEntry,
|
||||
autorenewPollMessage,
|
||||
billEvent,
|
||||
deletePollMessage,
|
||||
oneTimeBillingEvent,
|
||||
domain);
|
||||
|
||||
// Store the existing BillingRecurrence VKey. This happens after the event has been persisted.
|
||||
Domain persisted = loadByKey(domain.createVKey());
|
||||
|
||||
// Verify that the domain data has been persisted.
|
||||
// dsData still isn't persisted. gracePeriods appears to have the same values but for some
|
||||
// reason is showing up as different.
|
||||
assertEqualDomainExcept(persisted, "creationTime", "dsData", "gracePeriods");
|
||||
|
||||
// Verify that the DomainBase object from the history record sets the fields correctly.
|
||||
DomainHistory persistedHistoryEntry = loadByKey(historyEntry.createVKey());
|
||||
assertThat(persistedHistoryEntry.getDomainBase().get().getAutorenewPollMessage())
|
||||
.isEqualTo(domain.getAutorenewPollMessage());
|
||||
assertThat(persistedHistoryEntry.getDomainBase().get().getAutorenewBillingEvent())
|
||||
.isEqualTo(domain.getAutorenewBillingEvent());
|
||||
assertThat(persistedHistoryEntry.getDomainBase().get().getDeletePollMessage())
|
||||
.isEqualTo(domain.getDeletePollMessage());
|
||||
DomainTransferData persistedTransferData =
|
||||
persistedHistoryEntry.getDomainBase().get().getTransferData();
|
||||
DomainTransferData originalTransferData = domain.getTransferData();
|
||||
assertThat(persistedTransferData.getServerApproveBillingEvent())
|
||||
.isEqualTo(originalTransferData.getServerApproveBillingEvent());
|
||||
assertThat(persistedTransferData.getServerApproveAutorenewEvent())
|
||||
.isEqualTo(originalTransferData.getServerApproveAutorenewEvent());
|
||||
assertThat(persistedTransferData.getServerApproveAutorenewPollMessage())
|
||||
.isEqualTo(originalTransferData.getServerApproveAutorenewPollMessage());
|
||||
assertThat(persisted.getGracePeriods()).isEqualTo(gracePeriods);
|
||||
}
|
||||
|
||||
private <T> VKey<T> createKey(Class<T> clazz, String name) {
|
||||
return VKey.create(clazz, name, Key.create(clazz, name));
|
||||
private <T> VKey<T> createKey(Class<T> clazz, String key) {
|
||||
return VKey.createSql(clazz, key);
|
||||
}
|
||||
|
||||
private void assertEqualDomainExcept(Domain thatDomain, String... excepts) {
|
||||
@@ -548,7 +414,7 @@ public class DomainSqlTest {
|
||||
.build();
|
||||
// Note that the equality comparison forces a lazy load of all fields.
|
||||
assertAboutImmutableObjects().that(thatDomain).isEqualExceptFields(domain, moreExcepts);
|
||||
// Transfer data cannot be directly compared due to serverApproveEtities inequalities
|
||||
// Transfer data cannot be directly compared due to serverApproveEntities inequalities
|
||||
assertAboutImmutableObjects()
|
||||
.that(domain.getTransferData())
|
||||
.isEqualExceptFields(thatDomain.getTransferData(), "serverApproveEntities");
|
||||
|
||||
@@ -109,7 +109,7 @@ public class DomainTest {
|
||||
domainHistory =
|
||||
persistResource(
|
||||
new DomainHistory.Builder()
|
||||
.setDomainRepoId(domain.getRepoId())
|
||||
.setDomain(domain)
|
||||
.setModificationTime(fakeClock.nowUtc())
|
||||
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
||||
.setRegistrarId("TheRegistrar")
|
||||
@@ -129,11 +129,11 @@ public class DomainTest {
|
||||
.createVKey();
|
||||
DomainHistory historyEntry =
|
||||
new DomainHistory.Builder()
|
||||
.setId(100L)
|
||||
.setRevisionId(100L)
|
||||
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
||||
.setPeriod(Period.create(1, Period.Unit.YEARS))
|
||||
.setModificationTime(DateTime.now(UTC))
|
||||
.setDomainRepoId(domain.getRepoId())
|
||||
.setDomain(domain)
|
||||
.setRegistrarId(domain.getCurrentSponsorRegistrarId())
|
||||
// These are non-null, but I don't think some tests set them.
|
||||
.setReason("felt like it")
|
||||
@@ -202,8 +202,8 @@ public class DomainTest {
|
||||
.setLosingRegistrarId("NewRegistrar")
|
||||
.setPendingTransferExpirationTime(fakeClock.nowUtc())
|
||||
.setServerApproveEntities(
|
||||
historyEntry.getDomainRepoId(),
|
||||
historyEntry.getId(),
|
||||
historyEntry.getRepoId(),
|
||||
historyEntry.getRevisionId(),
|
||||
ImmutableSet.of(oneTimeBillKey, recurringBillKey, autorenewPollKey))
|
||||
.setServerApproveBillingEvent(oneTimeBillKey)
|
||||
.setServerApproveAutorenewEvent(recurringBillKey)
|
||||
@@ -438,7 +438,7 @@ public class DomainTest {
|
||||
.setServerApproveBillingEvent(transferBillingEvent.createVKey())
|
||||
.setServerApproveEntities(
|
||||
domain.getRepoId(),
|
||||
historyEntry.getId(),
|
||||
historyEntry.getRevisionId(),
|
||||
ImmutableSet.of(transferBillingEvent.createVKey()))
|
||||
.build())
|
||||
.addGracePeriod(
|
||||
|
||||
@@ -21,8 +21,8 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import google.registry.model.billing.BillingEvent;
|
||||
import google.registry.model.billing.BillingEvent.Reason;
|
||||
import google.registry.model.billing.BillingEvent.Recurring;
|
||||
import google.registry.model.domain.DomainHistory.DomainHistoryId;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
import google.registry.model.reporting.HistoryEntry.HistoryEntryId;
|
||||
import google.registry.persistence.VKey;
|
||||
import google.registry.testing.AppEngineExtension;
|
||||
import org.joda.money.CurrencyUnit;
|
||||
@@ -53,7 +53,7 @@ public class GracePeriodTest {
|
||||
.setBillingTime(now.plusDays(1))
|
||||
.setRegistrarId("TheRegistrar")
|
||||
.setCost(Money.of(CurrencyUnit.USD, 42))
|
||||
.setDomainHistoryId(new DomainHistoryId("domain", 12345))
|
||||
.setDomainHistoryId(new HistoryEntryId("domain", 12345))
|
||||
.setReason(Reason.CREATE)
|
||||
.setPeriodYears(1)
|
||||
.setTargetId("foo.google")
|
||||
|
||||
@@ -33,7 +33,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.ImmutableSortedMap;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.Buildable;
|
||||
import google.registry.model.EntityTestCase;
|
||||
import google.registry.model.billing.BillingEvent.RenewalPriceBehavior;
|
||||
@@ -41,7 +40,7 @@ import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.token.AllocationToken.RegistrationBehavior;
|
||||
import google.registry.model.domain.token.AllocationToken.TokenStatus;
|
||||
import google.registry.model.domain.token.AllocationToken.TokenType;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.model.reporting.HistoryEntry.HistoryEntryId;
|
||||
import google.registry.util.SerializeUtils;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
@@ -82,12 +81,12 @@ public class AllocationTokenTest extends EntityTestCase {
|
||||
assertThat(loadByEntity(unlimitedUseToken)).isEqualTo(unlimitedUseToken);
|
||||
|
||||
Domain domain = persistActiveDomain("example.foo");
|
||||
Key<HistoryEntry> historyEntryKey = Key.create(Key.create(domain), HistoryEntry.class, 1);
|
||||
HistoryEntryId historyEntryId = new HistoryEntryId(domain.getRepoId(), 1);
|
||||
AllocationToken singleUseToken =
|
||||
persistResource(
|
||||
new AllocationToken.Builder()
|
||||
.setToken("abc123Single")
|
||||
.setRedemptionHistoryEntry(HistoryEntry.createVKey(historyEntryKey))
|
||||
.setRedemptionHistoryId(historyEntryId)
|
||||
.setDomainName("example.foo")
|
||||
.setCreationTimeForTest(DateTime.parse("2010-11-12T05:00:00Z"))
|
||||
.setTokenType(SINGLE_USE)
|
||||
@@ -119,12 +118,12 @@ public class AllocationTokenTest extends EntityTestCase {
|
||||
assertThat(SerializeUtils.serializeDeserialize(persisted)).isEqualTo(persisted);
|
||||
|
||||
Domain domain = persistActiveDomain("example.foo");
|
||||
Key<HistoryEntry> historyEntryKey = Key.create(Key.create(domain), HistoryEntry.class, 1);
|
||||
HistoryEntryId historyEntryId = new HistoryEntryId(domain.getRepoId(), 1);
|
||||
AllocationToken singleUseToken =
|
||||
persistResource(
|
||||
new AllocationToken.Builder()
|
||||
.setToken("abc123Single")
|
||||
.setRedemptionHistoryEntry(HistoryEntry.createVKey(historyEntryKey))
|
||||
.setRedemptionHistoryId(historyEntryId)
|
||||
.setDomainName("example.foo")
|
||||
.setCreationTimeForTest(DateTime.parse("2010-11-12T05:00:00Z"))
|
||||
.setTokenType(SINGLE_USE)
|
||||
@@ -306,12 +305,12 @@ public class AllocationTokenTest extends EntityTestCase {
|
||||
@Test
|
||||
void testBuild_redemptionHistoryEntryOnlyInSingleUse() {
|
||||
Domain domain = persistActiveDomain("blahdomain.foo");
|
||||
Key<HistoryEntry> historyEntryKey = Key.create(Key.create(domain), HistoryEntry.class, 1);
|
||||
HistoryEntryId historyEntryId = new HistoryEntryId(domain.getRepoId(), 1);
|
||||
AllocationToken.Builder builder =
|
||||
new AllocationToken.Builder()
|
||||
.setToken("foobar")
|
||||
.setTokenType(TokenType.UNLIMITED_USE)
|
||||
.setRedemptionHistoryEntry(HistoryEntry.createVKey(historyEntryKey));
|
||||
.setRedemptionHistoryId(historyEntryId);
|
||||
IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, builder::build);
|
||||
assertThat(thrown)
|
||||
.hasMessageThat()
|
||||
|
||||
@@ -54,7 +54,7 @@ public class ContactHistoryTest extends EntityTestCase {
|
||||
() -> {
|
||||
ContactHistory fromDatabase = jpaTm().loadByKey(contactHistory.createVKey());
|
||||
assertContactHistoriesEqual(fromDatabase, contactHistory);
|
||||
assertThat(fromDatabase.getParentVKey()).isEqualTo(contactHistory.getParentVKey());
|
||||
assertThat(fromDatabase.getRepoId()).isEqualTo(contactHistory.getRepoId());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -70,24 +70,6 @@ public class ContactHistoryTest extends EntityTestCase {
|
||||
assertThat(SerializeUtils.serializeDeserialize(fromDatabase)).isEqualTo(fromDatabase);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testLegacyPersistence_nullContactBase() {
|
||||
Contact contact = newContactWithRoid("contactId", "contact1");
|
||||
insertInDb(contact);
|
||||
Contact contactFromDb = loadByEntity(contact);
|
||||
ContactHistory contactHistory =
|
||||
createContactHistory(contactFromDb).asBuilder().setContact(null).build();
|
||||
insertInDb(contactHistory);
|
||||
|
||||
jpaTm()
|
||||
.transact(
|
||||
() -> {
|
||||
ContactHistory fromDatabase = jpaTm().loadByKey(contactHistory.createVKey());
|
||||
assertContactHistoriesEqual(fromDatabase, contactHistory);
|
||||
assertThat(fromDatabase.getParentVKey()).isEqualTo(contactHistory.getParentVKey());
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
void testWipeOutPii_assertsAllPiiFieldsAreNull() {
|
||||
ContactHistory originalEntity =
|
||||
@@ -153,16 +135,13 @@ public class ContactHistoryTest extends EntityTestCase {
|
||||
.setReason("reason")
|
||||
.setRequestedByRegistrar(true)
|
||||
.setContact(contact)
|
||||
.setContactRepoId(contact.getRepoId())
|
||||
.build();
|
||||
}
|
||||
|
||||
static void assertContactHistoriesEqual(ContactHistory one, ContactHistory two) {
|
||||
assertAboutImmutableObjects().that(one).isEqualExceptFields(two, "resource");
|
||||
assertAboutImmutableObjects()
|
||||
.that(one)
|
||||
.isEqualExceptFields(two, "contactBase", "contactRepoId");
|
||||
assertAboutImmutableObjects()
|
||||
.that(one.getContactBase().orElse(null))
|
||||
.isEqualExceptFields(two.getContactBase().orElse(null), "repoId");
|
||||
.that(one.getContactBase().get())
|
||||
.isEqualExceptFields(two.getContactBase().get());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public class DomainHistoryTest extends EntityTestCase {
|
||||
() -> {
|
||||
DomainHistory fromDatabase = jpaTm().loadByKey(domainHistory.createVKey());
|
||||
assertDomainHistoriesEqual(fromDatabase, domainHistory);
|
||||
assertThat(fromDatabase.getParentVKey()).isEqualTo(domainHistory.getParentVKey());
|
||||
assertThat(fromDatabase.getRepoId()).isEqualTo(domainHistory.getRepoId());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -83,23 +83,6 @@ public class DomainHistoryTest extends EntityTestCase {
|
||||
assertThat(SerializeUtils.serializeDeserialize(fromDatabase)).isEqualTo(fromDatabase);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testLegacyPersistence_nullResource() {
|
||||
Domain domain = addGracePeriodForSql(createDomainWithContactsAndHosts());
|
||||
DomainHistory domainHistory = createDomainHistory(domain).asBuilder().setDomain(null).build();
|
||||
insertInDb(domainHistory);
|
||||
|
||||
jpaTm()
|
||||
.transact(
|
||||
() -> {
|
||||
DomainHistory fromDatabase = jpaTm().loadByKey(domainHistory.createVKey());
|
||||
assertDomainHistoriesEqual(fromDatabase, domainHistory);
|
||||
assertThat(fromDatabase.getParentVKey()).isEqualTo(domainHistory.getParentVKey());
|
||||
assertThat(fromDatabase.getNsHosts())
|
||||
.containsExactlyElementsIn(domainHistory.getNsHosts());
|
||||
});
|
||||
}
|
||||
|
||||
static Domain createDomainWithContactsAndHosts() {
|
||||
createTld("tld");
|
||||
Host host = newHostWithRoid("ns1.example.com", "host1");
|
||||
@@ -134,7 +117,7 @@ public class DomainHistoryTest extends EntityTestCase {
|
||||
}
|
||||
|
||||
static void assertDomainHistoriesEqual(DomainHistory one, DomainHistory two) {
|
||||
assertAboutImmutableObjects().that(one).isEqualExceptFields(two, "domainBase");
|
||||
assertAboutImmutableObjects().that(one).isEqualExceptFields(two, "resource");
|
||||
assertAboutImmutableObjects()
|
||||
.that(one.getDomainBase().get())
|
||||
.isEqualExceptFields(two.getDomainBase().get(), "updateTimestamp");
|
||||
@@ -159,7 +142,6 @@ public class DomainHistoryTest extends EntityTestCase {
|
||||
.setReason("reason")
|
||||
.setRequestedByRegistrar(true)
|
||||
.setDomain(domain)
|
||||
.setDomainRepoId(domain.getRepoId())
|
||||
.setDomainTransactionRecords(ImmutableSet.of(transactionRecord))
|
||||
.setOtherRegistrarId("otherClient")
|
||||
.setPeriod(Period.create(1, Period.Unit.YEARS))
|
||||
|
||||
@@ -50,7 +50,7 @@ public class HostHistoryTest extends EntityTestCase {
|
||||
() -> {
|
||||
HostHistory fromDatabase = jpaTm().loadByKey(hostHistory.createVKey());
|
||||
assertHostHistoriesEqual(fromDatabase, hostHistory);
|
||||
assertThat(fromDatabase.getParentVKey()).isEqualTo(hostHistory.getParentVKey());
|
||||
assertThat(fromDatabase.getRepoId()).isEqualTo(hostHistory.getRepoId());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -65,29 +65,11 @@ public class HostHistoryTest extends EntityTestCase {
|
||||
assertThat(SerializeUtils.serializeDeserialize(fromDatabase)).isEqualTo(fromDatabase);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testLegacyPersistence_nullHostBase() {
|
||||
Host host = newHostWithRoid("ns1.example.com", "host1");
|
||||
insertInDb(host);
|
||||
|
||||
Host hostFromDb = loadByEntity(host);
|
||||
HostHistory hostHistory = createHostHistory(hostFromDb).asBuilder().setHost(null).build();
|
||||
insertInDb(hostHistory);
|
||||
|
||||
jpaTm()
|
||||
.transact(
|
||||
() -> {
|
||||
HostHistory fromDatabase = jpaTm().loadByKey(hostHistory.createVKey());
|
||||
assertHostHistoriesEqual(fromDatabase, hostHistory);
|
||||
assertThat(fromDatabase.getParentVKey()).isEqualTo(hostHistory.getParentVKey());
|
||||
});
|
||||
}
|
||||
|
||||
private void assertHostHistoriesEqual(HostHistory one, HostHistory two) {
|
||||
assertAboutImmutableObjects().that(one).isEqualExceptFields(two, "hostBase");
|
||||
private static void assertHostHistoriesEqual(HostHistory one, HostHistory two) {
|
||||
assertAboutImmutableObjects().that(one).isEqualExceptFields(two, "resource");
|
||||
assertAboutImmutableObjects()
|
||||
.that(one.getHostBase().orElse(null))
|
||||
.isEqualExceptFields(two.getHostBase().orElse(null), "repoId");
|
||||
.that(one.getHostBase().get())
|
||||
.isEqualExceptFields(two.getHostBase().get(), "repoId");
|
||||
}
|
||||
|
||||
private HostHistory createHostHistory(HostBase hostBase) {
|
||||
@@ -101,7 +83,6 @@ public class HostHistoryTest extends EntityTestCase {
|
||||
.setReason("reason")
|
||||
.setRequestedByRegistrar(true)
|
||||
.setHost(hostBase)
|
||||
.setHostRepoId(hostBase.getRepoId())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,6 @@ import org.junit.jupiter.api.Test;
|
||||
/** Unit tests for {@link PollMessage}. */
|
||||
public class PollMessageTest extends EntityTestCase {
|
||||
|
||||
private Domain domain;
|
||||
private HistoryEntry historyEntry;
|
||||
private PollMessage.OneTime oneTime;
|
||||
private PollMessage.Autorenew autoRenew;
|
||||
@@ -54,7 +53,7 @@ public class PollMessageTest extends EntityTestCase {
|
||||
void setUp() {
|
||||
createTld("foobar");
|
||||
Contact contact = persistActiveContact("contact1234");
|
||||
domain = persistResource(DatabaseHelper.newDomain("foo.foobar", contact));
|
||||
Domain domain = persistResource(DatabaseHelper.newDomain("foo.foobar", contact));
|
||||
historyEntry =
|
||||
persistResource(
|
||||
new DomainHistory.Builder()
|
||||
@@ -68,8 +67,7 @@ public class PollMessageTest extends EntityTestCase {
|
||||
.setBySuperuser(false)
|
||||
.setReason("reason")
|
||||
.setRequestedByRegistrar(false)
|
||||
.build()
|
||||
.toChildHistoryEntity());
|
||||
.build());
|
||||
oneTime =
|
||||
new PollMessage.OneTime.Builder()
|
||||
.setId(100L)
|
||||
|
||||
@@ -18,7 +18,6 @@ import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.model.ImmutableObjectSubject.immutableObjectCorrespondence;
|
||||
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
||||
import static google.registry.testing.DatabaseHelper.createTld;
|
||||
import static google.registry.testing.DatabaseHelper.newDomain;
|
||||
import static google.registry.testing.DatabaseHelper.persistActiveDomain;
|
||||
import static google.registry.testing.DatabaseHelper.persistResource;
|
||||
import static google.registry.util.DateTimeUtils.END_OF_TIME;
|
||||
@@ -76,7 +75,7 @@ class HistoryEntryDaoTest extends EntityTestCase {
|
||||
@Test
|
||||
void testSimpleLoadAll() {
|
||||
assertThat(HistoryEntryDao.loadAllHistoryObjects(START_OF_TIME, END_OF_TIME))
|
||||
.comparingElementsUsing(immutableObjectCorrespondence("nsHosts", "domainBase"))
|
||||
.comparingElementsUsing(immutableObjectCorrespondence("nsHosts", "resource"))
|
||||
.containsExactly(domainHistory);
|
||||
}
|
||||
|
||||
@@ -98,7 +97,7 @@ class HistoryEntryDaoTest extends EntityTestCase {
|
||||
tm().transact(
|
||||
() ->
|
||||
assertThat(HistoryEntryDao.loadHistoryObjectsForResource(domain.createVKey()))
|
||||
.comparingElementsUsing(immutableObjectCorrespondence("nsHosts", "domainBase"))
|
||||
.comparingElementsUsing(immutableObjectCorrespondence("nsHosts", "resource"))
|
||||
.containsExactly(domainHistory));
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.model.ImmutableObjectSubject.assertAboutImmutableObjects;
|
||||
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
||||
import static google.registry.testing.DatabaseHelper.createTld;
|
||||
import static google.registry.testing.DatabaseHelper.persistActiveContact;
|
||||
import static google.registry.testing.DatabaseHelper.persistActiveDomain;
|
||||
import static google.registry.testing.DatabaseHelper.persistResource;
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
@@ -25,6 +26,7 @@ import static org.junit.Assert.assertThrows;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import google.registry.model.EntityTestCase;
|
||||
import google.registry.model.contact.Contact;
|
||||
import google.registry.model.contact.ContactHistory;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
@@ -36,15 +38,16 @@ import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/** Unit tests for {@link HistoryEntry}. */
|
||||
|
||||
class HistoryEntryTest extends EntityTestCase {
|
||||
|
||||
private DomainHistory domainHistory;
|
||||
private Contact contact;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
createTld("foobar");
|
||||
Domain domain = persistActiveDomain("foo.foobar");
|
||||
contact = persistActiveContact("someone");
|
||||
DomainTransactionRecord transactionRecord =
|
||||
new DomainTransactionRecord.Builder()
|
||||
.setTld("foobar")
|
||||
@@ -78,10 +81,26 @@ class HistoryEntryTest extends EntityTestCase {
|
||||
DomainHistory fromDatabase = tm().loadByEntity(domainHistory);
|
||||
assertAboutImmutableObjects()
|
||||
.that(fromDatabase)
|
||||
.isEqualExceptFields(domainHistory, "domainBase");
|
||||
.isEqualExceptFields(domainHistory, "resource");
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
void testBuilder_resourceMustBeSpecified() {
|
||||
IllegalArgumentException thrown =
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() ->
|
||||
new ContactHistory.Builder()
|
||||
.setRevisionId(5L)
|
||||
.setModificationTime(DateTime.parse("1985-07-12T22:30:00Z"))
|
||||
.setRegistrarId("TheRegistrar")
|
||||
.setReason("Reason")
|
||||
.setType(HistoryEntry.Type.CONTACT_CREATE)
|
||||
.build());
|
||||
assertThat(thrown).hasMessageThat().isEqualTo("EPP resource must be specified");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testBuilder_typeMustBeSpecified() {
|
||||
IllegalArgumentException thrown =
|
||||
@@ -89,7 +108,8 @@ class HistoryEntryTest extends EntityTestCase {
|
||||
IllegalArgumentException.class,
|
||||
() ->
|
||||
new ContactHistory.Builder()
|
||||
.setId(5L)
|
||||
.setContact(contact)
|
||||
.setRevisionId(5L)
|
||||
.setModificationTime(DateTime.parse("1985-07-12T22:30:00Z"))
|
||||
.setRegistrarId("TheRegistrar")
|
||||
.setReason("Reason")
|
||||
@@ -104,7 +124,8 @@ class HistoryEntryTest extends EntityTestCase {
|
||||
IllegalArgumentException.class,
|
||||
() ->
|
||||
new ContactHistory.Builder()
|
||||
.setId(5L)
|
||||
.setContact(contact)
|
||||
.setRevisionId(5L)
|
||||
.setType(HistoryEntry.Type.CONTACT_CREATE)
|
||||
.setRegistrarId("TheRegistrar")
|
||||
.setReason("Reason")
|
||||
@@ -119,7 +140,8 @@ class HistoryEntryTest extends EntityTestCase {
|
||||
IllegalArgumentException.class,
|
||||
() ->
|
||||
new ContactHistory.Builder()
|
||||
.setId(5L)
|
||||
.setRevisionId(5L)
|
||||
.setContact(contact)
|
||||
.setType(HistoryEntry.Type.CONTACT_CREATE)
|
||||
.setModificationTime(DateTime.parse("1985-07-12T22:30:00Z"))
|
||||
.setReason("Reason")
|
||||
@@ -134,7 +156,8 @@ class HistoryEntryTest extends EntityTestCase {
|
||||
IllegalArgumentException.class,
|
||||
() ->
|
||||
new ContactHistory.Builder()
|
||||
.setId(5L)
|
||||
.setContact(contact)
|
||||
.setRevisionId(5L)
|
||||
.setType(HistoryEntry.Type.SYNTHETIC)
|
||||
.setModificationTime(DateTime.parse("1985-07-12T22:30:00Z"))
|
||||
.setRegistrarId("TheRegistrar")
|
||||
|
||||
-36
@@ -1,36 +0,0 @@
|
||||
// Copyright 2020 The Nomulus Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package google.registry.model.translators;
|
||||
|
||||
import static google.registry.model.translators.EppHistoryVKeyTranslatorFactory.kindPathToVKeyClass;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/** Unit test for {@link EppHistoryVKeyTranslatorFactory}. */
|
||||
class EppHistoryVKeyTranslatorFactoryTest {
|
||||
|
||||
@Test
|
||||
void assertAllVKeyClassesHavingCreateFromOfyKeyMethod() {
|
||||
kindPathToVKeyClass.forEach(
|
||||
(kindPath, vKeyClass) -> {
|
||||
try {
|
||||
vKeyClass.getDeclaredMethod("create", com.googlecode.objectify.Key.class);
|
||||
} catch (NoSuchMethodException e) {
|
||||
fail("Missing static method create(com.googlecode.objectify.Key) on " + vKeyClass, e);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -21,9 +21,6 @@ import static google.registry.testing.DatabaseHelper.persistActiveContact;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.common.ClassPathManager;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.DomainHistory.DomainHistoryId;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.persistence.VKey;
|
||||
import google.registry.testing.AppEngineExtension;
|
||||
import google.registry.testing.TestObject;
|
||||
@@ -57,18 +54,6 @@ public class VKeyTranslatorFactoryTest {
|
||||
assertThat(vkey.getSqlKey()).isEqualTo("ROID-1");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testEntityWithAncestor() {
|
||||
Key<Domain> domainKey = Key.create(Domain.class, "ROID-1");
|
||||
Key<HistoryEntry> historyEntryKey = Key.create(domainKey, HistoryEntry.class, 10L);
|
||||
|
||||
VKey<HistoryEntry> vkey = VKeyTranslatorFactory.createVKey(historyEntryKey);
|
||||
|
||||
assertThat(vkey.getKind()).isEqualTo(DomainHistory.class);
|
||||
assertThat(vkey.getOfyKey()).isEqualTo(historyEntryKey);
|
||||
assertThat(vkey.getSqlKey()).isEqualTo(new DomainHistoryId("ROID-1", 10L));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testExtraEntityClass() {
|
||||
TestObject testObject = TestObject.create("id", "field");
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
// Copyright 2020 The Nomulus Authors. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package google.registry.persistence;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.persistence.transaction.TransactionManagerFactory.tm;
|
||||
|
||||
import com.googlecode.objectify.Key;
|
||||
import com.googlecode.objectify.annotation.Entity;
|
||||
import com.googlecode.objectify.annotation.Id;
|
||||
import google.registry.model.ImmutableObject;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainHistory.DomainHistoryId;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.testing.AppEngineExtension;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||
|
||||
/** Unit test for {@link DomainHistoryVKey}. */
|
||||
class DomainHistoryVKeyTest {
|
||||
|
||||
@RegisterExtension
|
||||
final AppEngineExtension appEngine =
|
||||
AppEngineExtension.builder()
|
||||
.withCloudSql()
|
||||
.withOfyTestEntities(TestEntity.class)
|
||||
.withJpaUnitTestEntities(TestEntity.class)
|
||||
.build();
|
||||
|
||||
@Test
|
||||
void testRestoreSymmetricVKey() {
|
||||
Key<HistoryEntry> ofyKey =
|
||||
Key.create(Key.create(Domain.class, "domainRepoId"), HistoryEntry.class, 10L);
|
||||
DomainHistoryVKey domainHistoryVKey = DomainHistoryVKey.create(ofyKey);
|
||||
TestEntity original = new TestEntity(domainHistoryVKey);
|
||||
tm().transact(() -> tm().insert(original));
|
||||
TestEntity persisted = tm().transact(() -> tm().loadByKey(original.createVKey()));
|
||||
assertThat(persisted).isEqualTo(original);
|
||||
// Double check that the persisted.domainHistoryVKey is a symmetric VKey
|
||||
assertThat(persisted.domainHistoryVKey.createSqlKey())
|
||||
.isEqualTo(new DomainHistoryId("domainRepoId", 10L));
|
||||
assertThat(persisted.domainHistoryVKey.createVKey())
|
||||
.isEqualTo(VKey.createSql(HistoryEntry.class, new DomainHistoryId("domainRepoId", 10L)));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCreateSymmetricVKeyFromOfyKey() {
|
||||
Key<HistoryEntry> ofyKey =
|
||||
Key.create(Key.create(Domain.class, "domainRepoId"), HistoryEntry.class, 10L);
|
||||
DomainHistoryVKey domainHistoryVKey = DomainHistoryVKey.create(ofyKey);
|
||||
assertThat(domainHistoryVKey.createSqlKey())
|
||||
.isEqualTo(new DomainHistoryId("domainRepoId", 10L));
|
||||
assertThat(domainHistoryVKey.createVKey())
|
||||
.isEqualTo(
|
||||
VKey.create(HistoryEntry.class, new DomainHistoryId("domainRepoId", 10L), ofyKey));
|
||||
}
|
||||
|
||||
@Entity
|
||||
@javax.persistence.Entity(name = "TestEntity")
|
||||
private static class TestEntity extends ImmutableObject {
|
||||
|
||||
@Id @javax.persistence.Id String id = "id";
|
||||
|
||||
DomainHistoryVKey domainHistoryVKey;
|
||||
|
||||
TestEntity() {}
|
||||
|
||||
TestEntity(DomainHistoryVKey domainHistoryVKey) {
|
||||
this.domainHistoryVKey = domainHistoryVKey;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VKey<TestEntity> createVKey() {
|
||||
return VKey.createSql(TestEntity.class, id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -365,7 +365,7 @@ public class DomainToXjcConverterTest {
|
||||
.createVKey())
|
||||
.setServerApproveEntities(
|
||||
domain.getRepoId(),
|
||||
domainHistory.getId(),
|
||||
domainHistory.getRevisionId(),
|
||||
ImmutableSet.of(billingEvent.createVKey()))
|
||||
.setTransferRequestTime(DateTime.parse("1919-01-01T00:00:00Z"))
|
||||
.setTransferStatus(TransferStatus.PENDING)
|
||||
|
||||
@@ -205,8 +205,8 @@ final class RdeFixtures {
|
||||
.build())
|
||||
.createVKey())
|
||||
.setServerApproveEntities(
|
||||
historyEntry.getDomainRepoId(),
|
||||
historyEntry.getId(),
|
||||
historyEntry.getRepoId(),
|
||||
historyEntry.getRevisionId(),
|
||||
ImmutableSet.of(billingEvent.createVKey()))
|
||||
.setTransferRequestTime(DateTime.parse("1991-01-01T00:00:00Z"))
|
||||
.setTransferStatus(TransferStatus.PENDING)
|
||||
|
||||
@@ -550,15 +550,14 @@ public final class DatabaseHelper {
|
||||
|
||||
public static Contact persistContactWithPendingTransfer(
|
||||
Contact contact, DateTime requestTime, DateTime expirationTime, DateTime now) {
|
||||
HistoryEntry historyEntryContactTransfer =
|
||||
ContactHistory historyEntryContactTransfer =
|
||||
persistResource(
|
||||
new ContactHistory.Builder()
|
||||
.setType(HistoryEntry.Type.CONTACT_TRANSFER_REQUEST)
|
||||
.setContact(persistResource(contact))
|
||||
.setModificationTime(now)
|
||||
.setRegistrarId(contact.getCurrentSponsorRegistrarId())
|
||||
.build()
|
||||
.toChildHistoryEntity());
|
||||
.build());
|
||||
return persistResource(
|
||||
contact
|
||||
.asBuilder()
|
||||
@@ -568,8 +567,8 @@ public final class DatabaseHelper {
|
||||
createContactTransferDataBuilder(requestTime, expirationTime)
|
||||
.setPendingTransferExpirationTime(now.plus(getContactAutomaticTransferLength()))
|
||||
.setServerApproveEntities(
|
||||
((ContactHistory) historyEntryContactTransfer).getContactRepoId(),
|
||||
historyEntryContactTransfer.getId(),
|
||||
historyEntryContactTransfer.getRepoId(),
|
||||
historyEntryContactTransfer.getRevisionId(),
|
||||
ImmutableSet.of(
|
||||
// Pretend it's 3 days since the request
|
||||
persistResource(
|
||||
@@ -732,8 +731,8 @@ public final class DatabaseHelper {
|
||||
.setServerApproveAutorenewPollMessage(
|
||||
gainingClientAutorenewPollMessage.createVKey())
|
||||
.setServerApproveEntities(
|
||||
historyEntryDomainTransfer.getDomainRepoId(),
|
||||
historyEntryDomainTransfer.getId(),
|
||||
historyEntryDomainTransfer.getRepoId(),
|
||||
historyEntryDomainTransfer.getRevisionId(),
|
||||
ImmutableSet.of(
|
||||
transferBillingEvent.createVKey(),
|
||||
gainingClientAutorenewEvent.createVKey(),
|
||||
@@ -1106,15 +1105,13 @@ public final class DatabaseHelper {
|
||||
tm().loadAllOf(PollMessage.class).stream()
|
||||
.filter(
|
||||
pollMessage ->
|
||||
pollMessage
|
||||
.getResourceName()
|
||||
.equals(historyEntry.getParent().getName())
|
||||
&& pollMessage.getHistoryRevisionId() == historyEntry.getId()
|
||||
pollMessage.getResourceId().equals(historyEntry.getRepoId())
|
||||
&& pollMessage.getHistoryRevisionId()
|
||||
== historyEntry.getRevisionId()
|
||||
&& pollMessage
|
||||
.getType()
|
||||
.getResourceClass()
|
||||
.getName()
|
||||
.equals(historyEntry.getParent().getKind()))
|
||||
.equals(historyEntry.getResourceType()))
|
||||
.collect(toImmutableList())));
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ 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;
|
||||
import google.registry.model.domain.secdns.DomainDsData;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
@@ -381,16 +382,19 @@ public final class FullFieldsTestEntityHelper {
|
||||
Period period,
|
||||
String reason,
|
||||
DateTime modificationTime) {
|
||||
return HistoryEntry.createBuilderForResource(resource)
|
||||
.setType(type)
|
||||
.setPeriod(period)
|
||||
.setXmlBytes("<xml></xml>".getBytes(UTF_8))
|
||||
.setModificationTime(modificationTime)
|
||||
.setRegistrarId(resource.getPersistedCurrentSponsorRegistrarId())
|
||||
.setTrid(Trid.create("ABC-123", "server-trid"))
|
||||
.setBySuperuser(false)
|
||||
.setReason(reason)
|
||||
.setRequestedByRegistrar(false)
|
||||
.build();
|
||||
HistoryEntry.Builder<?, ?> builder =
|
||||
HistoryEntry.createBuilderForResource(resource)
|
||||
.setType(type)
|
||||
.setXmlBytes("<xml></xml>".getBytes(UTF_8))
|
||||
.setModificationTime(modificationTime)
|
||||
.setRegistrarId(resource.getPersistedCurrentSponsorRegistrarId())
|
||||
.setTrid(Trid.create("ABC-123", "server-trid"))
|
||||
.setBySuperuser(false)
|
||||
.setReason(reason)
|
||||
.setRequestedByRegistrar(false);
|
||||
if (builder instanceof DomainHistory.Builder) {
|
||||
((DomainHistory.Builder) builder).setPeriod(period);
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import static com.google.common.truth.Truth.assertAbout;
|
||||
import com.google.common.truth.FailureMetadata;
|
||||
import com.google.common.truth.SimpleSubjectBuilder;
|
||||
import com.google.common.truth.Subject;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.Period;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.testing.TruthChainer.And;
|
||||
@@ -55,8 +56,12 @@ public class HistoryEntrySubject extends Subject {
|
||||
return hasValue(registrarId, actual.getRegistrarId(), "getRegistrarId()");
|
||||
}
|
||||
|
||||
public And<HistoryEntrySubject> hasOtherClientId(String otherClientId) {
|
||||
return hasValue(otherClientId, actual.getOtherRegistrarId(), "getOtherRegistrarId()");
|
||||
public And<HistoryEntrySubject> hasOtherRegistrarId(String otherRegistrarId) {
|
||||
if (!(actual instanceof DomainHistory)) {
|
||||
failWithActual(simpleFact("expected to be DomainHistory"));
|
||||
}
|
||||
return hasValue(
|
||||
otherRegistrarId, ((DomainHistory) actual).getOtherRegistrarId(), "getOtherRegistrarId()");
|
||||
}
|
||||
|
||||
public And<HistoryEntrySubject> hasModificationTime(DateTime modificationTime) {
|
||||
@@ -68,18 +73,25 @@ public class HistoryEntrySubject extends Subject {
|
||||
}
|
||||
|
||||
public And<HistoryEntrySubject> hasPeriod() {
|
||||
if (actual.getPeriod() == null) {
|
||||
if (!(actual instanceof DomainHistory)) {
|
||||
failWithActual(simpleFact("expected to be DomainHistory"));
|
||||
}
|
||||
if (((DomainHistory) actual).getPeriod() == null) {
|
||||
failWithActual(simpleFact("expected to have a period"));
|
||||
}
|
||||
return new And<>(this);
|
||||
}
|
||||
|
||||
public And<HistoryEntrySubject> hasPeriodYears(int years) {
|
||||
if (!(actual instanceof DomainHistory)) {
|
||||
failWithActual(simpleFact("expected to be DomainHistory"));
|
||||
}
|
||||
Period actualPeriod = ((DomainHistory) actual).getPeriod();
|
||||
return hasPeriod()
|
||||
.and()
|
||||
.hasValue(Period.Unit.YEARS, actual.getPeriod().getUnit(), "getPeriod().getUnit()")
|
||||
.hasValue(Period.Unit.YEARS, actualPeriod.getUnit(), "getPeriod().getUnit()")
|
||||
.and()
|
||||
.hasValue(years, actual.getPeriod().getValue(), "getPeriod().getValue()");
|
||||
.hasValue(years, actualPeriod.getValue(), "getPeriod().getValue()");
|
||||
}
|
||||
|
||||
public And<HistoryEntrySubject> hasNoXml() {
|
||||
@@ -93,8 +105,7 @@ public class HistoryEntrySubject extends Subject {
|
||||
return hasValue(reason, actual.getReason(), "getReason()");
|
||||
}
|
||||
|
||||
public And<HistoryEntrySubject> hasMetadataRequestedByRegistrar(
|
||||
boolean requestedByRegistrar) {
|
||||
public And<HistoryEntrySubject> hasMetadataRequestedByRegistrar(boolean requestedByRegistrar) {
|
||||
return hasValue(
|
||||
requestedByRegistrar, actual.getRequestedByRegistrar(), "getRequestedByRegistrar()");
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ package google.registry.testing;
|
||||
import com.google.auto.value.AutoValue;
|
||||
|
||||
/**
|
||||
* Container for values passed to {@link AppEngineExtension} to set the logged in user for tests.
|
||||
* Container for values passed to {@link AppEngineExtension} to set the logged-in user for tests.
|
||||
*/
|
||||
@AutoValue
|
||||
public abstract class UserInfo {
|
||||
|
||||
@@ -24,7 +24,6 @@ import static google.registry.testing.DatabaseHelper.persistResource;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.DomainHistory;
|
||||
import google.registry.model.domain.DomainHistory.DomainHistoryId;
|
||||
import google.registry.model.poll.PollMessage;
|
||||
import google.registry.model.poll.PollMessage.Autorenew;
|
||||
import google.registry.model.poll.PollMessage.OneTime;
|
||||
@@ -54,10 +53,9 @@ public class AckPollMessagesCommandTest extends CommandTestCase<AckPollMessagesC
|
||||
persistResource(
|
||||
new DomainHistory.Builder()
|
||||
.setModificationTime(clock.nowUtc())
|
||||
.setDomainRepoId(domain.getRepoId())
|
||||
.setDomain(domain)
|
||||
.setRegistrarId(domain.getCreationRegistrarId())
|
||||
.setType(HistoryEntry.Type.DOMAIN_CREATE)
|
||||
.setId(2406L)
|
||||
.build());
|
||||
clock.advanceOneMilli();
|
||||
}
|
||||
@@ -195,7 +193,7 @@ public class AckPollMessagesCommandTest extends CommandTestCase<AckPollMessagesC
|
||||
return persistResource(
|
||||
new PollMessage.OneTime.Builder()
|
||||
.setId(id)
|
||||
.setDomainHistoryId(new DomainHistoryId("FSDGS-TLD", domainHistory.getId()))
|
||||
.setHistoryEntry(domainHistory)
|
||||
.setRegistrarId("TheRegistrar")
|
||||
.setEventTime(eventTime)
|
||||
.setMsg(message)
|
||||
|
||||
@@ -25,11 +25,10 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.token.AllocationToken;
|
||||
import google.registry.model.domain.token.AllocationToken.TokenType;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.model.reporting.HistoryEntry.HistoryEntryId;
|
||||
import java.util.Arrays;
|
||||
import javax.annotation.Nullable;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
@@ -174,8 +173,8 @@ class DeleteAllocationTokensCommandTest extends CommandTestCase<DeleteAllocation
|
||||
if (redeemed) {
|
||||
String domainToPersist = domainName != null ? domainName : "example.foo";
|
||||
Domain domain = persistActiveDomain(domainToPersist);
|
||||
Key<HistoryEntry> historyEntryKey = Key.create(Key.create(domain), HistoryEntry.class, 1051L);
|
||||
builder.setRedemptionHistoryEntry(HistoryEntry.createVKey(historyEntryKey));
|
||||
HistoryEntryId historyEntryId = new HistoryEntryId(domain.getRepoId(), 1051L);
|
||||
builder.setRedemptionHistoryId(historyEntryId);
|
||||
}
|
||||
return persistResource(builder.build());
|
||||
}
|
||||
|
||||
@@ -42,8 +42,7 @@ import com.google.common.collect.Iterables;
|
||||
import com.google.common.io.Files;
|
||||
import google.registry.model.domain.token.AllocationToken;
|
||||
import google.registry.model.domain.token.AllocationToken.TokenStatus;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.persistence.VKey;
|
||||
import google.registry.model.reporting.HistoryEntry.HistoryEntryId;
|
||||
import google.registry.testing.DeterministicStringGenerator;
|
||||
import google.registry.testing.DeterministicStringGenerator.Rule;
|
||||
import google.registry.testing.FakeClock;
|
||||
@@ -446,12 +445,12 @@ class GenerateAllocationTokensCommandTest extends CommandTestCase<GenerateAlloca
|
||||
|
||||
private AllocationToken createToken(
|
||||
String token,
|
||||
@Nullable VKey<? extends HistoryEntry> redemptionHistoryEntry,
|
||||
@Nullable HistoryEntryId redemptionHistoryEntryId,
|
||||
@Nullable String domainName) {
|
||||
AllocationToken.Builder builder =
|
||||
new AllocationToken.Builder().setToken(token).setTokenType(SINGLE_USE);
|
||||
if (redemptionHistoryEntry != null) {
|
||||
builder.setRedemptionHistoryEntry(redemptionHistoryEntry);
|
||||
if (redemptionHistoryEntryId != null) {
|
||||
builder.setRedemptionHistoryId(redemptionHistoryEntryId);
|
||||
}
|
||||
builder.setDomainName(domainName);
|
||||
return builder.build();
|
||||
|
||||
@@ -25,10 +25,8 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
import com.beust.jcommander.ParameterException;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.model.domain.Domain;
|
||||
import google.registry.model.domain.token.AllocationToken;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import org.joda.time.DateTime;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -83,8 +81,8 @@ class GetAllocationTokenCommandTest extends CommandTestCase<GetAllocationTokenCo
|
||||
.setToken("foo")
|
||||
.setTokenType(SINGLE_USE)
|
||||
.setDomainName("fqqdn.tld")
|
||||
.setRedemptionHistoryEntry(
|
||||
HistoryEntry.createVKey(Key.create(createHistoryEntryForEppResource(domain))))
|
||||
.setRedemptionHistoryId(
|
||||
createHistoryEntryForEppResource(domain).getHistoryEntryId())
|
||||
.build());
|
||||
runCommand("foo");
|
||||
assertInStdout(
|
||||
|
||||
@@ -212,7 +212,7 @@ public class UnrenewDomainCommandTest extends CommandTestCase<UnrenewDomainComma
|
||||
"valid.tld"));
|
||||
assertThat(thrown)
|
||||
.hasMessageThat()
|
||||
.isEqualTo("Aborting because some domains cannot be unrewed");
|
||||
.isEqualTo("Aborting because some domains cannot be unrenewed");
|
||||
assertInStderr(
|
||||
"Found domains that cannot be unrenewed for the following reasons:",
|
||||
"Domains that don't exist: [nonexistent.tld]",
|
||||
|
||||
@@ -14,31 +14,6 @@ class google.registry.model.contact.Contact {
|
||||
org.joda.time.DateTime lastEppUpdateTime;
|
||||
org.joda.time.DateTime lastTransferTime;
|
||||
}
|
||||
class google.registry.model.contact.ContactBase {
|
||||
@Id java.lang.String repoId;
|
||||
java.lang.String contactId;
|
||||
java.lang.String creationClientId;
|
||||
java.lang.String currentSponsorClientId;
|
||||
java.lang.String email;
|
||||
java.lang.String lastEppUpdateClientId;
|
||||
java.lang.String searchName;
|
||||
org.joda.time.DateTime deletionTime;
|
||||
org.joda.time.DateTime lastEppUpdateTime;
|
||||
org.joda.time.DateTime lastTransferTime;
|
||||
}
|
||||
class google.registry.model.contact.ContactHistory {
|
||||
@Id java.lang.Long id;
|
||||
@Parent com.googlecode.objectify.Key<? extends google.registry.model.EppResource> parent;
|
||||
boolean bySuperuser;
|
||||
byte[] xmlBytes;
|
||||
google.registry.model.contact.ContactBase contactBase;
|
||||
google.registry.model.reporting.HistoryEntry$Type type;
|
||||
java.lang.Boolean requestedByRegistrar;
|
||||
java.lang.String clientId;
|
||||
java.lang.String otherClientId;
|
||||
java.lang.String reason;
|
||||
org.joda.time.DateTime modificationTime;
|
||||
}
|
||||
class google.registry.model.domain.Domain {
|
||||
@Id java.lang.String repoId;
|
||||
google.registry.persistence.VKey<google.registry.model.contact.Contact> adminContact;
|
||||
@@ -62,43 +37,6 @@ class google.registry.model.domain.Domain {
|
||||
org.joda.time.DateTime lastTransferTime;
|
||||
org.joda.time.DateTime registrationExpirationTime;
|
||||
}
|
||||
class google.registry.model.domain.DomainBase {
|
||||
@Id java.lang.String repoId;
|
||||
google.registry.persistence.VKey<google.registry.model.contact.Contact> adminContact;
|
||||
google.registry.persistence.VKey<google.registry.model.contact.Contact> billingContact;
|
||||
google.registry.persistence.VKey<google.registry.model.contact.Contact> registrantContact;
|
||||
google.registry.persistence.VKey<google.registry.model.contact.Contact> techContact;
|
||||
google.registry.persistence.VKey<google.registry.model.poll.PollMessage$Autorenew> autorenewPollMessage;
|
||||
google.registry.persistence.VKey<google.registry.model.poll.PollMessage$OneTime> deletePollMessage;
|
||||
java.lang.String creationClientId;
|
||||
java.lang.String currentSponsorClientId;
|
||||
java.lang.String domainName;
|
||||
java.lang.String idnTableName;
|
||||
java.lang.String lastEppUpdateClientId;
|
||||
java.lang.String smdId;
|
||||
java.lang.String tld;
|
||||
java.util.Set<google.registry.persistence.VKey<google.registry.model.host.Host>> nsHosts;
|
||||
java.util.Set<java.lang.String> subordinateHosts;
|
||||
org.joda.time.DateTime autorenewEndTime;
|
||||
org.joda.time.DateTime deletionTime;
|
||||
org.joda.time.DateTime lastEppUpdateTime;
|
||||
org.joda.time.DateTime lastTransferTime;
|
||||
org.joda.time.DateTime registrationExpirationTime;
|
||||
}
|
||||
class google.registry.model.domain.DomainHistory {
|
||||
@Id java.lang.Long id;
|
||||
@Parent com.googlecode.objectify.Key<? extends google.registry.model.EppResource> parent;
|
||||
boolean bySuperuser;
|
||||
byte[] xmlBytes;
|
||||
google.registry.model.domain.DomainBase domainBase;
|
||||
google.registry.model.reporting.HistoryEntry$Type type;
|
||||
java.lang.Boolean requestedByRegistrar;
|
||||
java.lang.String clientId;
|
||||
java.lang.String otherClientId;
|
||||
java.lang.String reason;
|
||||
java.util.Set<google.registry.persistence.VKey<google.registry.model.host.Host>> nsHosts;
|
||||
org.joda.time.DateTime modificationTime;
|
||||
}
|
||||
class google.registry.model.host.Host {
|
||||
@Id java.lang.String repoId;
|
||||
google.registry.persistence.VKey<google.registry.model.domain.Domain> superordinateDomain;
|
||||
@@ -112,70 +50,3 @@ class google.registry.model.host.Host {
|
||||
org.joda.time.DateTime lastSuperordinateChange;
|
||||
org.joda.time.DateTime lastTransferTime;
|
||||
}
|
||||
class google.registry.model.host.HostBase {
|
||||
@Id java.lang.String repoId;
|
||||
google.registry.persistence.VKey<google.registry.model.domain.Domain> superordinateDomain;
|
||||
java.lang.String creationClientId;
|
||||
java.lang.String currentSponsorClientId;
|
||||
java.lang.String hostName;
|
||||
java.lang.String lastEppUpdateClientId;
|
||||
java.util.Set<java.net.InetAddress> inetAddresses;
|
||||
org.joda.time.DateTime deletionTime;
|
||||
org.joda.time.DateTime lastEppUpdateTime;
|
||||
org.joda.time.DateTime lastSuperordinateChange;
|
||||
org.joda.time.DateTime lastTransferTime;
|
||||
}
|
||||
class google.registry.model.host.HostHistory {
|
||||
@Id java.lang.Long id;
|
||||
@Parent com.googlecode.objectify.Key<? extends google.registry.model.EppResource> parent;
|
||||
boolean bySuperuser;
|
||||
byte[] xmlBytes;
|
||||
google.registry.model.host.HostBase hostBase;
|
||||
google.registry.model.reporting.HistoryEntry$Type type;
|
||||
java.lang.Boolean requestedByRegistrar;
|
||||
java.lang.String clientId;
|
||||
java.lang.String otherClientId;
|
||||
java.lang.String reason;
|
||||
org.joda.time.DateTime modificationTime;
|
||||
}
|
||||
class google.registry.model.reporting.HistoryEntry {
|
||||
@Id java.lang.Long id;
|
||||
@Parent com.googlecode.objectify.Key<? extends google.registry.model.EppResource> parent;
|
||||
boolean bySuperuser;
|
||||
byte[] xmlBytes;
|
||||
google.registry.model.reporting.HistoryEntry$Type type;
|
||||
java.lang.Boolean requestedByRegistrar;
|
||||
java.lang.String clientId;
|
||||
java.lang.String otherClientId;
|
||||
java.lang.String reason;
|
||||
org.joda.time.DateTime modificationTime;
|
||||
}
|
||||
enum google.registry.model.reporting.HistoryEntry$Type {
|
||||
CONTACT_CREATE;
|
||||
CONTACT_DELETE;
|
||||
CONTACT_DELETE_FAILURE;
|
||||
CONTACT_PENDING_DELETE;
|
||||
CONTACT_TRANSFER_APPROVE;
|
||||
CONTACT_TRANSFER_CANCEL;
|
||||
CONTACT_TRANSFER_REJECT;
|
||||
CONTACT_TRANSFER_REQUEST;
|
||||
CONTACT_UPDATE;
|
||||
DOMAIN_ALLOCATE;
|
||||
DOMAIN_AUTORENEW;
|
||||
DOMAIN_CREATE;
|
||||
DOMAIN_DELETE;
|
||||
DOMAIN_RENEW;
|
||||
DOMAIN_RESTORE;
|
||||
DOMAIN_TRANSFER_APPROVE;
|
||||
DOMAIN_TRANSFER_CANCEL;
|
||||
DOMAIN_TRANSFER_REJECT;
|
||||
DOMAIN_TRANSFER_REQUEST;
|
||||
DOMAIN_UPDATE;
|
||||
HOST_CREATE;
|
||||
HOST_DELETE;
|
||||
HOST_DELETE_FAILURE;
|
||||
HOST_PENDING_DELETE;
|
||||
HOST_UPDATE;
|
||||
RDE_IMPORT;
|
||||
SYNTHETIC;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user