mirror of
https://github.com/google/nomulus.git
synced 2025-06-27 23:03:34 +02:00
Add replay to remaining (non-trivial) flow tests (#1020)
* Add replay to remaining (non-trivial) flow tests Convert all remaining flow tests to do replay/compare testing. In the course of this: - Move the class specific SetClock extension into its own place. - Fix another "cyclic" foreign key (there may be another solution in this case because HostHistory is actually different from HistoryEntry, but that would require changing the way we establish priority since HostHistory is not distinguished from HistoryEntry in the current methodology)
This commit is contained in:
parent
5befc142f5
commit
c827ea033a
18 changed files with 178 additions and 75 deletions
|
@ -42,12 +42,19 @@ import google.registry.model.contact.PostalInfo;
|
||||||
import google.registry.model.contact.PostalInfo.Type;
|
import google.registry.model.contact.PostalInfo.Type;
|
||||||
import google.registry.model.eppcommon.StatusValue;
|
import google.registry.model.eppcommon.StatusValue;
|
||||||
import google.registry.testing.DualDatabaseTest;
|
import google.registry.testing.DualDatabaseTest;
|
||||||
|
import google.registry.testing.ReplayExtension;
|
||||||
import google.registry.testing.TestOfyAndSql;
|
import google.registry.testing.TestOfyAndSql;
|
||||||
|
import org.junit.jupiter.api.Order;
|
||||||
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
/** Unit tests for {@link ContactUpdateFlow}. */
|
/** Unit tests for {@link ContactUpdateFlow}. */
|
||||||
@DualDatabaseTest
|
@DualDatabaseTest
|
||||||
class ContactUpdateFlowTest extends ResourceFlowTestCase<ContactUpdateFlow, ContactResource> {
|
class ContactUpdateFlowTest extends ResourceFlowTestCase<ContactUpdateFlow, ContactResource> {
|
||||||
|
|
||||||
|
@Order(value = Order.DEFAULT - 2)
|
||||||
|
@RegisterExtension
|
||||||
|
final ReplayExtension replayExtension = ReplayExtension.createWithCompare(clock);
|
||||||
|
|
||||||
ContactUpdateFlowTest() {
|
ContactUpdateFlowTest() {
|
||||||
setEppInput("contact_update.xml");
|
setEppInput("contact_update.xml");
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,6 +72,7 @@ import google.registry.model.registry.Registry.TldState;
|
||||||
import google.registry.model.registry.label.ReservedList;
|
import google.registry.model.registry.label.ReservedList;
|
||||||
import google.registry.model.reporting.HistoryEntry;
|
import google.registry.model.reporting.HistoryEntry;
|
||||||
import google.registry.testing.ReplayExtension;
|
import google.registry.testing.ReplayExtension;
|
||||||
|
import google.registry.testing.SetClockExtension;
|
||||||
import org.joda.money.CurrencyUnit;
|
import org.joda.money.CurrencyUnit;
|
||||||
import org.joda.money.Money;
|
import org.joda.money.Money;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
|
@ -79,8 +80,6 @@ import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Disabled;
|
import org.junit.jupiter.api.Disabled;
|
||||||
import org.junit.jupiter.api.Order;
|
import org.junit.jupiter.api.Order;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.BeforeEachCallback;
|
|
||||||
import org.junit.jupiter.api.extension.ExtensionContext;
|
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
/** Unit tests for {@link DomainCheckFlow}. */
|
/** Unit tests for {@link DomainCheckFlow}. */
|
||||||
|
@ -88,7 +87,7 @@ class DomainCheckFlowTest extends ResourceCheckFlowTestCase<DomainCheckFlow, Dom
|
||||||
|
|
||||||
@Order(value = Order.DEFAULT - 3)
|
@Order(value = Order.DEFAULT - 3)
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final SetClockExtension setClockExtension = new SetClockExtension();
|
final SetClockExtension setClockExtension = new SetClockExtension(clock, "2009-01-01T10:00:00Z");
|
||||||
|
|
||||||
@Order(value = Order.DEFAULT - 2)
|
@Order(value = Order.DEFAULT - 2)
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
|
@ -1351,12 +1350,4 @@ class DomainCheckFlowTest extends ResourceCheckFlowTestCase<DomainCheckFlow, Dom
|
||||||
.setStatusValues(ImmutableSet.of(StatusValue.PENDING_DELETE))
|
.setStatusValues(ImmutableSet.of(StatusValue.PENDING_DELETE))
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
class SetClockExtension implements BeforeEachCallback {
|
|
||||||
@Override
|
|
||||||
public void beforeEach(ExtensionContext context) {
|
|
||||||
// Kick the clock back to before the earliest date that we set the clock to.
|
|
||||||
clock.setTo(DateTime.parse("2009-01-01T10:00:00Z"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,12 +66,11 @@ import google.registry.model.reporting.HistoryEntry;
|
||||||
import google.registry.persistence.VKey;
|
import google.registry.persistence.VKey;
|
||||||
import google.registry.testing.AppEngineExtension;
|
import google.registry.testing.AppEngineExtension;
|
||||||
import google.registry.testing.ReplayExtension;
|
import google.registry.testing.ReplayExtension;
|
||||||
|
import google.registry.testing.SetClockExtension;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Order;
|
import org.junit.jupiter.api.Order;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.BeforeEachCallback;
|
|
||||||
import org.junit.jupiter.api.extension.ExtensionContext;
|
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
/** Unit tests for {@link DomainInfoFlow}. */
|
/** Unit tests for {@link DomainInfoFlow}. */
|
||||||
|
@ -79,7 +78,8 @@ class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, DomainBase
|
||||||
|
|
||||||
@Order(value = Order.DEFAULT - 3)
|
@Order(value = Order.DEFAULT - 3)
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final SetClockExtension setClockExtension = new SetClockExtension();
|
final SetClockExtension setClockExtension =
|
||||||
|
new SetClockExtension(clock, "2005-03-03T22:00:00.000Z");
|
||||||
|
|
||||||
@Order(value = Order.DEFAULT - 2)
|
@Order(value = Order.DEFAULT - 2)
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
|
@ -973,12 +973,4 @@ class DomainInfoFlowTest extends ResourceFlowTestCase<DomainInfoFlow, DomainBase
|
||||||
assertIcannReportingActivityFieldLogged("srs-dom-info");
|
assertIcannReportingActivityFieldLogged("srs-dom-info");
|
||||||
assertTldsFieldLogged("tld");
|
assertTldsFieldLogged("tld");
|
||||||
}
|
}
|
||||||
|
|
||||||
class SetClockExtension implements BeforeEachCallback {
|
|
||||||
@Override
|
|
||||||
public void beforeEach(ExtensionContext context) {
|
|
||||||
// Kick the clock back to before the earliest date that we set the clock to.
|
|
||||||
clock.setTo(DateTime.parse("2005-03-03T22:00:00.000Z"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,6 +71,7 @@ import google.registry.model.reporting.DomainTransactionRecord;
|
||||||
import google.registry.model.reporting.DomainTransactionRecord.TransactionReportField;
|
import google.registry.model.reporting.DomainTransactionRecord.TransactionReportField;
|
||||||
import google.registry.model.reporting.HistoryEntry;
|
import google.registry.model.reporting.HistoryEntry;
|
||||||
import google.registry.testing.ReplayExtension;
|
import google.registry.testing.ReplayExtension;
|
||||||
|
import google.registry.testing.SetClockExtension;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.joda.money.Money;
|
import org.joda.money.Money;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
|
@ -78,8 +79,6 @@ import org.joda.time.Duration;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Order;
|
import org.junit.jupiter.api.Order;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.BeforeEachCallback;
|
|
||||||
import org.junit.jupiter.api.extension.ExtensionContext;
|
|
||||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
/** Unit tests for {@link DomainRenewFlow}. */
|
/** Unit tests for {@link DomainRenewFlow}. */
|
||||||
|
@ -104,7 +103,8 @@ class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, DomainBa
|
||||||
|
|
||||||
@Order(value = Order.DEFAULT - 3)
|
@Order(value = Order.DEFAULT - 3)
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final SetClockExtension setClockExtension = new SetClockExtension();
|
final SetClockExtension setClockExtension =
|
||||||
|
new SetClockExtension(clock, expirationTime.minusMillis(20));
|
||||||
|
|
||||||
@Order(value = Order.DEFAULT - 2)
|
@Order(value = Order.DEFAULT - 2)
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
|
@ -812,21 +812,4 @@ class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, DomainBa
|
||||||
TransactionReportField.netRenewsFieldFromYears(5),
|
TransactionReportField.netRenewsFieldFromYears(5),
|
||||||
1));
|
1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Local extension so we can set the clock correctly prior to using it to define basic entities in
|
|
||||||
* AppEngineExtension.
|
|
||||||
*
|
|
||||||
* <p>This has to happen first, we'll get timestamp inversions if we try to set the clock after
|
|
||||||
* these objects are created.
|
|
||||||
*/
|
|
||||||
class SetClockExtension implements BeforeEachCallback {
|
|
||||||
@Override
|
|
||||||
public void beforeEach(ExtensionContext context) {
|
|
||||||
// we have to go far enough back before the expiration time so that the clock advances we do
|
|
||||||
// after each persist don't move us into a grace period. The current value is likely beyond
|
|
||||||
// what is necessary, but this doesn't hurt.
|
|
||||||
clock.setTo(expirationTime.minusMillis(20));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,13 +55,20 @@ import google.registry.model.eppcommon.StatusValue;
|
||||||
import google.registry.model.host.HostResource;
|
import google.registry.model.host.HostResource;
|
||||||
import google.registry.model.reporting.HistoryEntry;
|
import google.registry.model.reporting.HistoryEntry;
|
||||||
import google.registry.testing.DualDatabaseTest;
|
import google.registry.testing.DualDatabaseTest;
|
||||||
|
import google.registry.testing.ReplayExtension;
|
||||||
import google.registry.testing.TestOfyAndSql;
|
import google.registry.testing.TestOfyAndSql;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
|
import org.junit.jupiter.api.Order;
|
||||||
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
/** Unit tests for {@link HostCreateFlow}. */
|
/** Unit tests for {@link HostCreateFlow}. */
|
||||||
@DualDatabaseTest
|
@DualDatabaseTest
|
||||||
class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, HostResource> {
|
class HostCreateFlowTest extends ResourceFlowTestCase<HostCreateFlow, HostResource> {
|
||||||
|
|
||||||
|
@Order(value = Order.DEFAULT - 2)
|
||||||
|
@RegisterExtension
|
||||||
|
final ReplayExtension replayExtension = ReplayExtension.createWithCompare(clock);
|
||||||
|
|
||||||
private void setEppHostCreateInput(String hostName, String hostAddrs) {
|
private void setEppHostCreateInput(String hostName, String hostAddrs) {
|
||||||
setEppInput(
|
setEppInput(
|
||||||
"host_create.xml",
|
"host_create.xml",
|
||||||
|
|
|
@ -47,14 +47,21 @@ import google.registry.model.reporting.HistoryEntry;
|
||||||
import google.registry.model.transfer.DomainTransferData;
|
import google.registry.model.transfer.DomainTransferData;
|
||||||
import google.registry.model.transfer.TransferStatus;
|
import google.registry.model.transfer.TransferStatus;
|
||||||
import google.registry.testing.DualDatabaseTest;
|
import google.registry.testing.DualDatabaseTest;
|
||||||
|
import google.registry.testing.ReplayExtension;
|
||||||
import google.registry.testing.TestOfyAndSql;
|
import google.registry.testing.TestOfyAndSql;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.Order;
|
||||||
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
/** Unit tests for {@link HostDeleteFlow}. */
|
/** Unit tests for {@link HostDeleteFlow}. */
|
||||||
@DualDatabaseTest
|
@DualDatabaseTest
|
||||||
class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, HostResource> {
|
class HostDeleteFlowTest extends ResourceFlowTestCase<HostDeleteFlow, HostResource> {
|
||||||
|
|
||||||
|
@Order(value = Order.DEFAULT - 2)
|
||||||
|
@RegisterExtension
|
||||||
|
final ReplayExtension replayExtension = ReplayExtension.createWithCompare(clock);
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void initFlowTest() {
|
void initFlowTest() {
|
||||||
setEppInput("host_delete.xml", ImmutableMap.of("HOSTNAME", "ns1.example.tld"));
|
setEppInput("host_delete.xml", ImmutableMap.of("HOSTNAME", "ns1.example.tld"));
|
||||||
|
|
|
@ -18,6 +18,7 @@ import static com.google.common.truth.Truth.assertThat;
|
||||||
import static google.registry.testing.DatabaseHelper.assertNoBillingEvents;
|
import static google.registry.testing.DatabaseHelper.assertNoBillingEvents;
|
||||||
import static google.registry.testing.DatabaseHelper.createTld;
|
import static google.registry.testing.DatabaseHelper.createTld;
|
||||||
import static google.registry.testing.DatabaseHelper.newDomainBase;
|
import static google.registry.testing.DatabaseHelper.newDomainBase;
|
||||||
|
import static google.registry.testing.DatabaseHelper.persistNewRegistrar;
|
||||||
import static google.registry.testing.DatabaseHelper.persistResource;
|
import static google.registry.testing.DatabaseHelper.persistResource;
|
||||||
import static google.registry.testing.EppExceptionSubject.assertAboutEppExceptions;
|
import static google.registry.testing.EppExceptionSubject.assertAboutEppExceptions;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
|
@ -34,14 +35,21 @@ import google.registry.flows.host.HostFlowUtils.HostNameNotPunyCodedException;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
import google.registry.model.eppcommon.StatusValue;
|
import google.registry.model.eppcommon.StatusValue;
|
||||||
import google.registry.model.host.HostResource;
|
import google.registry.model.host.HostResource;
|
||||||
|
import google.registry.testing.ReplayExtension;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.Order;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
/** Unit tests for {@link HostInfoFlow}. */
|
/** Unit tests for {@link HostInfoFlow}. */
|
||||||
class HostInfoFlowTest extends ResourceFlowTestCase<HostInfoFlow, HostResource> {
|
class HostInfoFlowTest extends ResourceFlowTestCase<HostInfoFlow, HostResource> {
|
||||||
|
|
||||||
|
@Order(value = Order.DEFAULT - 2)
|
||||||
|
@RegisterExtension
|
||||||
|
final ReplayExtension replayExtension = ReplayExtension.createWithCompare(clock);
|
||||||
|
|
||||||
HostInfoFlowTest() {
|
HostInfoFlowTest() {
|
||||||
setEppInput("host_info.xml", ImmutableMap.of("HOSTNAME", "ns1.example.tld"));
|
setEppInput("host_info.xml", ImmutableMap.of("HOSTNAME", "ns1.example.tld"));
|
||||||
}
|
}
|
||||||
|
@ -105,6 +113,7 @@ class HostInfoFlowTest extends ResourceFlowTestCase<HostInfoFlow, HostResource>
|
||||||
|
|
||||||
private void runTest_superordinateDomain(
|
private void runTest_superordinateDomain(
|
||||||
DateTime domainTransferTime, @Nullable DateTime lastSuperordinateChange) throws Exception {
|
DateTime domainTransferTime, @Nullable DateTime lastSuperordinateChange) throws Exception {
|
||||||
|
persistNewRegistrar("superclientid");
|
||||||
DomainBase domain =
|
DomainBase domain =
|
||||||
persistResource(
|
persistResource(
|
||||||
newDomainBase("parent.foobar")
|
newDomainBase("parent.foobar")
|
||||||
|
|
|
@ -79,15 +79,22 @@ import google.registry.model.reporting.HistoryEntry;
|
||||||
import google.registry.model.transfer.DomainTransferData;
|
import google.registry.model.transfer.DomainTransferData;
|
||||||
import google.registry.model.transfer.TransferStatus;
|
import google.registry.model.transfer.TransferStatus;
|
||||||
import google.registry.testing.DualDatabaseTest;
|
import google.registry.testing.DualDatabaseTest;
|
||||||
|
import google.registry.testing.ReplayExtension;
|
||||||
import google.registry.testing.TaskQueueHelper.TaskMatcher;
|
import google.registry.testing.TaskQueueHelper.TaskMatcher;
|
||||||
import google.registry.testing.TestOfyAndSql;
|
import google.registry.testing.TestOfyAndSql;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
|
import org.junit.jupiter.api.Order;
|
||||||
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
/** Unit tests for {@link HostUpdateFlow}. */
|
/** Unit tests for {@link HostUpdateFlow}. */
|
||||||
@DualDatabaseTest
|
@DualDatabaseTest
|
||||||
class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, HostResource> {
|
class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, HostResource> {
|
||||||
|
|
||||||
|
@Order(value = Order.DEFAULT - 2)
|
||||||
|
@RegisterExtension
|
||||||
|
final ReplayExtension replayExtension = ReplayExtension.createWithCompare(clock);
|
||||||
|
|
||||||
private void setEppHostUpdateInput(
|
private void setEppHostUpdateInput(
|
||||||
String oldHostName, String newHostName, String ipOrStatusToAdd, String ipOrStatusToRem) {
|
String oldHostName, String newHostName, String ipOrStatusToAdd, String ipOrStatusToRem) {
|
||||||
setEppInput(
|
setEppInput(
|
||||||
|
@ -712,6 +719,7 @@ class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, HostResour
|
||||||
.build());
|
.build());
|
||||||
clock.advanceOneMilli();
|
clock.advanceOneMilli();
|
||||||
HostResource renamedHost = doSuccessfulTest();
|
HostResource renamedHost = doSuccessfulTest();
|
||||||
|
clock.advanceOneMilli();
|
||||||
persistResource(domain.asBuilder().setLastTransferTime(clock.nowUtc().minusDays(1)).build());
|
persistResource(domain.asBuilder().setLastTransferTime(clock.nowUtc().minusDays(1)).build());
|
||||||
// The last transfer time should be what was on the superordinate domain at the time of the host
|
// The last transfer time should be what was on the superordinate domain at the time of the host
|
||||||
// update, not what it is later changed to.
|
// update, not what it is later changed to.
|
||||||
|
@ -721,7 +729,9 @@ class HostUpdateFlowTest extends ResourceFlowTestCase<HostUpdateFlow, HostResour
|
||||||
.and()
|
.and()
|
||||||
.hasLastTransferTime(lastTransferTime)
|
.hasLastTransferTime(lastTransferTime)
|
||||||
.and()
|
.and()
|
||||||
.hasLastSuperordinateChange(clock.nowUtc());
|
// Need to add two milliseconds to account for the increment of "persist resource" and the
|
||||||
|
// artificial increment introduced after the flow itself.
|
||||||
|
.hasLastSuperordinateChange(clock.nowUtc().minusMillis(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestOfyAndSql
|
@TestOfyAndSql
|
||||||
|
|
|
@ -32,13 +32,20 @@ import google.registry.flows.poll.PollAckFlow.NotAuthorizedToAckMessageException
|
||||||
import google.registry.model.contact.ContactResource;
|
import google.registry.model.contact.ContactResource;
|
||||||
import google.registry.model.domain.DomainBase;
|
import google.registry.model.domain.DomainBase;
|
||||||
import google.registry.model.poll.PollMessage;
|
import google.registry.model.poll.PollMessage;
|
||||||
|
import google.registry.testing.ReplayExtension;
|
||||||
import org.joda.time.DateTime;
|
import org.joda.time.DateTime;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.Order;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
/** Unit tests for {@link PollAckFlow}. */
|
/** Unit tests for {@link PollAckFlow}. */
|
||||||
class PollAckFlowTest extends FlowTestCase<PollAckFlow> {
|
class PollAckFlowTest extends FlowTestCase<PollAckFlow> {
|
||||||
|
|
||||||
|
@Order(value = Order.DEFAULT - 2)
|
||||||
|
@RegisterExtension
|
||||||
|
final ReplayExtension replayExtension = ReplayExtension.createWithCompare(clock);
|
||||||
|
|
||||||
/** This is the message id being sent in the ACK request. */
|
/** This is the message id being sent in the ACK request. */
|
||||||
private static final long MESSAGE_ID = 3;
|
private static final long MESSAGE_ID = 3;
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ import static google.registry.testing.DatabaseHelper.createTld;
|
||||||
import static google.registry.testing.DatabaseHelper.newDomainBase;
|
import static google.registry.testing.DatabaseHelper.newDomainBase;
|
||||||
import static google.registry.testing.DatabaseHelper.persistActiveContact;
|
import static google.registry.testing.DatabaseHelper.persistActiveContact;
|
||||||
import static google.registry.testing.DatabaseHelper.persistActiveHost;
|
import static google.registry.testing.DatabaseHelper.persistActiveHost;
|
||||||
|
import static google.registry.testing.DatabaseHelper.persistNewRegistrar;
|
||||||
import static google.registry.testing.DatabaseHelper.persistResource;
|
import static google.registry.testing.DatabaseHelper.persistResource;
|
||||||
import static google.registry.testing.EppExceptionSubject.assertAboutEppExceptions;
|
import static google.registry.testing.EppExceptionSubject.assertAboutEppExceptions;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
|
@ -37,13 +38,24 @@ import google.registry.model.reporting.HistoryEntry;
|
||||||
import google.registry.model.transfer.TransferResponse.ContactTransferResponse;
|
import google.registry.model.transfer.TransferResponse.ContactTransferResponse;
|
||||||
import google.registry.model.transfer.TransferResponse.DomainTransferResponse;
|
import google.registry.model.transfer.TransferResponse.DomainTransferResponse;
|
||||||
import google.registry.model.transfer.TransferStatus;
|
import google.registry.model.transfer.TransferStatus;
|
||||||
import org.joda.time.DateTime;
|
import google.registry.testing.ReplayExtension;
|
||||||
|
import google.registry.testing.SetClockExtension;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.Order;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
|
||||||
/** Unit tests for {@link PollRequestFlow}. */
|
/** Unit tests for {@link PollRequestFlow}. */
|
||||||
class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
|
class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
|
||||||
|
|
||||||
|
@Order(value = Order.DEFAULT - 3)
|
||||||
|
@RegisterExtension
|
||||||
|
final SetClockExtension setClockExtension = new SetClockExtension(clock, "2011-01-02T01:01:01Z");
|
||||||
|
|
||||||
|
@Order(value = Order.DEFAULT - 2)
|
||||||
|
@RegisterExtension
|
||||||
|
final ReplayExtension replayExtension = ReplayExtension.createWithCompare(clock);
|
||||||
|
|
||||||
private DomainBase domain;
|
private DomainBase domain;
|
||||||
private ContactResource contact;
|
private ContactResource contact;
|
||||||
private HostResource host;
|
private HostResource host;
|
||||||
|
@ -52,8 +64,8 @@ class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
|
||||||
void setUp() {
|
void setUp() {
|
||||||
setEppInput("poll.xml");
|
setEppInput("poll.xml");
|
||||||
setClientIdForFlow("NewRegistrar");
|
setClientIdForFlow("NewRegistrar");
|
||||||
clock.setTo(DateTime.parse("2011-01-02T01:01:01Z"));
|
|
||||||
createTld("example");
|
createTld("example");
|
||||||
|
persistNewRegistrar("BadRegistrar");
|
||||||
contact = persistActiveContact("jd1234");
|
contact = persistActiveContact("jd1234");
|
||||||
domain = persistResource(newDomainBase("test.example", contact));
|
domain = persistResource(newDomainBase("test.example", contact));
|
||||||
host = persistActiveHost("ns1.test.example");
|
host = persistActiveHost("ns1.test.example");
|
||||||
|
@ -97,7 +109,6 @@ class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testSuccess_contactTransferPending() throws Exception {
|
void testSuccess_contactTransferPending() throws Exception {
|
||||||
clock.setTo(DateTime.parse("2000-06-13T22:00:00.0Z"));
|
|
||||||
setClientIdForFlow("TheRegistrar");
|
setClientIdForFlow("TheRegistrar");
|
||||||
persistResource(
|
persistResource(
|
||||||
new PollMessage.OneTime.Builder()
|
new PollMessage.OneTime.Builder()
|
||||||
|
@ -157,7 +168,7 @@ class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
|
||||||
void testSuccess_wrongRegistrar() throws Exception {
|
void testSuccess_wrongRegistrar() throws Exception {
|
||||||
persistResource(
|
persistResource(
|
||||||
new PollMessage.OneTime.Builder()
|
new PollMessage.OneTime.Builder()
|
||||||
.setClientId("different client id")
|
.setClientId("BadRegistrar")
|
||||||
.setEventTime(clock.nowUtc().minusDays(1))
|
.setEventTime(clock.nowUtc().minusDays(1))
|
||||||
.setMsg("Poll message")
|
.setMsg("Poll message")
|
||||||
.setParent(createHistoryEntryForEppResource(domain))
|
.setParent(createHistoryEntryForEppResource(domain))
|
||||||
|
@ -229,6 +240,7 @@ class PollRequestFlowTest extends FlowTestCase<PollRequestFlow> {
|
||||||
.setParent(historyEntry)
|
.setParent(historyEntry)
|
||||||
.setEventTime(clock.nowUtc().minusDays(1))
|
.setEventTime(clock.nowUtc().minusDays(1))
|
||||||
.build());
|
.build());
|
||||||
|
clock.advanceOneMilli();
|
||||||
assertTransactionalFlow(false);
|
assertTransactionalFlow(false);
|
||||||
runFlowAssertResponse(loadFile("poll_response_host_delete.xml"));
|
runFlowAssertResponse(loadFile("poll_response_host_delete.xml"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1168,7 +1168,12 @@ public class DatabaseHelper {
|
||||||
|
|
||||||
public static <T extends EppResource> HistoryEntry createHistoryEntryForEppResource(
|
public static <T extends EppResource> HistoryEntry createHistoryEntryForEppResource(
|
||||||
T parentResource) {
|
T parentResource) {
|
||||||
return persistResource(new HistoryEntry.Builder().setParent(parentResource).build());
|
return persistResource(
|
||||||
|
new HistoryEntry.Builder()
|
||||||
|
.setType(getHistoryEntryType(parentResource))
|
||||||
|
.setModificationTime(DateTime.now(DateTimeZone.UTC))
|
||||||
|
.setParent(parentResource)
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Persists a single Objectify resource, without adjusting foreign resources or keys. */
|
/** Persists a single Objectify resource, without adjusting foreign resources or keys. */
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
// Copyright 2021 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.testing;
|
||||||
|
|
||||||
|
import org.joda.time.DateTime;
|
||||||
|
import org.junit.jupiter.api.extension.BeforeEachCallback;
|
||||||
|
import org.junit.jupiter.api.extension.ExtensionContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extension used for tests that a) set the clock to a specific time and b) make use of
|
||||||
|
* ReplayExtension or any other test feature that requires writing to a commit log from test
|
||||||
|
* utilities that aren't controlled by the ultimate test class (e.g. AppEngineExtension).
|
||||||
|
*/
|
||||||
|
public class SetClockExtension implements BeforeEachCallback {
|
||||||
|
|
||||||
|
private FakeClock clock;
|
||||||
|
private DateTime dateTime;
|
||||||
|
|
||||||
|
/** Construct from a DateTime, that being the time to set the clock to. */
|
||||||
|
public SetClockExtension(FakeClock clock, DateTime dateTime) {
|
||||||
|
this.clock = clock;
|
||||||
|
this.dateTime = dateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Construct from a dateTime (the time to set the clock to) represented as a string. */
|
||||||
|
public SetClockExtension(FakeClock clock, String dateTime) {
|
||||||
|
this.clock = clock;
|
||||||
|
this.dateTime = DateTime.parse(dateTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void beforeEach(ExtensionContext context) {
|
||||||
|
clock.setTo(dateTime);
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,8 +3,8 @@
|
||||||
<result code="1301">
|
<result code="1301">
|
||||||
<msg>Command completed successfully; ack to dequeue</msg>
|
<msg>Command completed successfully; ack to dequeue</msg>
|
||||||
</result>
|
</result>
|
||||||
<msgQ count="1" id="2-2-ROID-5-3-2000">
|
<msgQ count="1" id="2-2-ROID-5-3-2010">
|
||||||
<qDate>2000-06-08T22:00:00Z</qDate>
|
<qDate>2010-12-28T01:01:01Z</qDate>
|
||||||
<msg>Transfer requested.</msg>
|
<msg>Transfer requested.</msg>
|
||||||
</msgQ>
|
</msgQ>
|
||||||
<resData>
|
<resData>
|
||||||
|
@ -12,9 +12,9 @@
|
||||||
<contact:id>sh8013</contact:id>
|
<contact:id>sh8013</contact:id>
|
||||||
<contact:trStatus>pending</contact:trStatus>
|
<contact:trStatus>pending</contact:trStatus>
|
||||||
<contact:reID>TheRegistrar</contact:reID>
|
<contact:reID>TheRegistrar</contact:reID>
|
||||||
<contact:reDate>2000-06-08T22:00:00.0Z</contact:reDate>
|
<contact:reDate>2010-12-28T01:01:01Z</contact:reDate>
|
||||||
<contact:acID>NewRegistrar</contact:acID>
|
<contact:acID>NewRegistrar</contact:acID>
|
||||||
<contact:acDate>2000-06-13T22:00:00.0Z</contact:acDate>
|
<contact:acDate>2011-01-02T01:01:01Z</contact:acDate>
|
||||||
</contact:trnData>
|
</contact:trnData>
|
||||||
</resData>
|
</resData>
|
||||||
<trID>
|
<trID>
|
||||||
|
|
|
@ -261,11 +261,11 @@ td.section {
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="property_name">generated on</td>
|
<td class="property_name">generated on</td>
|
||||||
<td class="property_value">2021-03-18 19:08:16.381352</td>
|
<td class="property_value">2021-03-19 12:31:33.396532</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="property_name">last flyway file</td>
|
<td class="property_name">last flyway file</td>
|
||||||
<td id="lastFlywayFile" class="property_value">V88__transfer_billing_cancellation_history_id.sql</td>
|
<td id="lastFlywayFile" class="property_value">V89__host_history_host_deferred.sql</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
@ -284,7 +284,7 @@ td.section {
|
||||||
generated on
|
generated on
|
||||||
</text>
|
</text>
|
||||||
<text text-anchor="start" x="4027.94" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00">
|
<text text-anchor="start" x="4027.94" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||||
2021-03-18 19:08:16.381352
|
2021-03-19 12:31:33.396532
|
||||||
</text>
|
</text>
|
||||||
<polygon fill="none" stroke="#888888" points="3940.44,-4 3940.44,-44 4205.44,-44 4205.44,-4 3940.44,-4" /> <!-- allocationtoken_a08ccbef -->
|
<polygon fill="none" stroke="#888888" points="3940.44,-4 3940.44,-44 4205.44,-44 4205.44,-4 3940.44,-4" /> <!-- allocationtoken_a08ccbef -->
|
||||||
<g id="node1" class="node">
|
<g id="node1" class="node">
|
||||||
|
@ -2484,8 +2484,8 @@ td.section {
|
||||||
<polyline fill="none" stroke="black" points="191.5,-646.68 195.4,-643.55 " />
|
<polyline fill="none" stroke="black" points="191.5,-646.68 195.4,-643.55 " />
|
||||||
<polygon fill="black" stroke="black" points="199.31,-646.82 193.05,-639.02 194.61,-637.77 200.87,-645.57 199.31,-646.82" />
|
<polygon fill="black" stroke="black" points="199.31,-646.82 193.05,-639.02 194.61,-637.77 200.87,-645.57 199.31,-646.82" />
|
||||||
<polyline fill="none" stroke="black" points="195.4,-643.55 199.3,-640.42 " />
|
<polyline fill="none" stroke="black" points="195.4,-643.55 199.3,-640.42 " />
|
||||||
<text text-anchor="start" x="1178.5" y="-280.48" font-family="Helvetica,sans-Serif" font-size="14.00">
|
<text text-anchor="start" x="1203" y="-280.48" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||||
fk3d09knnmxrt6iniwnp8j2ykga
|
fk_history_registrar_id
|
||||||
</text>
|
</text>
|
||||||
</g> <!-- kmssecret_f3b28857 -->
|
</g> <!-- kmssecret_f3b28857 -->
|
||||||
<g id="node22" class="node">
|
<g id="node22" class="node">
|
||||||
|
@ -5357,7 +5357,7 @@ td.section {
|
||||||
<td colspan="3"></td>
|
<td colspan="3"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" class="name">fk3d09knnmxrt6iniwnp8j2ykga</td>
|
<td colspan="2" class="name">fk_history_registrar_id</td>
|
||||||
<td class="description right">[foreign key, with no action]</td>
|
<td class="description right">[foreign key, with no action]</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -6110,7 +6110,7 @@ td.section {
|
||||||
<td colspan="3"></td>
|
<td colspan="3"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" class="name">fk3d09knnmxrt6iniwnp8j2ykga</td>
|
<td colspan="2" class="name">fk_history_registrar_id</td>
|
||||||
<td class="description right">[foreign key, with no action]</td>
|
<td class="description right">[foreign key, with no action]</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -261,11 +261,11 @@ td.section {
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="property_name">generated on</td>
|
<td class="property_name">generated on</td>
|
||||||
<td class="property_value">2021-03-18 19:08:14.574191</td>
|
<td class="property_value">2021-03-19 12:31:31.233378</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="property_name">last flyway file</td>
|
<td class="property_name">last flyway file</td>
|
||||||
<td id="lastFlywayFile" class="property_value">V88__transfer_billing_cancellation_history_id.sql</td>
|
<td id="lastFlywayFile" class="property_value">V89__host_history_host_deferred.sql</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
@ -284,7 +284,7 @@ td.section {
|
||||||
generated on
|
generated on
|
||||||
</text>
|
</text>
|
||||||
<text text-anchor="start" x="4626.68" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00">
|
<text text-anchor="start" x="4626.68" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||||
2021-03-18 19:08:14.574191
|
2021-03-19 12:31:31.233378
|
||||||
</text>
|
</text>
|
||||||
<polygon fill="none" stroke="#888888" points="4539.18,-4 4539.18,-44 4804.18,-44 4804.18,-4 4539.18,-4" /> <!-- allocationtoken_a08ccbef -->
|
<polygon fill="none" stroke="#888888" points="4539.18,-4 4539.18,-44 4804.18,-44 4804.18,-4 4539.18,-4" /> <!-- allocationtoken_a08ccbef -->
|
||||||
<g id="node1" class="node">
|
<g id="node1" class="node">
|
||||||
|
@ -5580,8 +5580,8 @@ td.section {
|
||||||
<polyline fill="none" stroke="black" points="298,-1144.89 302.29,-1142.32 " />
|
<polyline fill="none" stroke="black" points="298,-1144.89 302.29,-1142.32 " />
|
||||||
<polygon fill="black" stroke="black" points="305.72,-1146.1 300.58,-1137.52 302.3,-1136.49 307.43,-1145.08 305.72,-1146.1" />
|
<polygon fill="black" stroke="black" points="305.72,-1146.1 300.58,-1137.52 302.3,-1136.49 307.43,-1145.08 305.72,-1146.1" />
|
||||||
<polyline fill="none" stroke="black" points="302.29,-1142.32 306.58,-1139.76 " />
|
<polyline fill="none" stroke="black" points="302.29,-1142.32 306.58,-1139.76 " />
|
||||||
<text text-anchor="start" x="1422" y="-485.69" font-family="Helvetica,sans-Serif" font-size="14.00">
|
<text text-anchor="start" x="1446.5" y="-485.69" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||||
fk3d09knnmxrt6iniwnp8j2ykga
|
fk_history_registrar_id
|
||||||
</text>
|
</text>
|
||||||
</g> <!-- kmssecret_f3b28857 -->
|
</g> <!-- kmssecret_f3b28857 -->
|
||||||
<g id="node22" class="node">
|
<g id="node22" class="node">
|
||||||
|
@ -11079,7 +11079,7 @@ td.section {
|
||||||
<td colspan="3"></td>
|
<td colspan="3"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" class="name">fk3d09knnmxrt6iniwnp8j2ykga</td>
|
<td colspan="2" class="name">fk_history_registrar_id</td>
|
||||||
<td class="description right">[foreign key, with no action]</td>
|
<td class="description right">[foreign key, with no action]</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -12436,7 +12436,7 @@ td.section {
|
||||||
<td colspan="3"></td>
|
<td colspan="3"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" class="name">fk3d09knnmxrt6iniwnp8j2ykga</td>
|
<td colspan="2" class="name">fk_history_registrar_id</td>
|
||||||
<td class="description right">[foreign key, with no action]</td>
|
<td class="description right">[foreign key, with no action]</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -86,3 +86,4 @@ V85__add_required_columns_in_transfer_data.sql
|
||||||
V86__third_poll_message.sql
|
V86__third_poll_message.sql
|
||||||
V87__fix_super_domain_fk.sql
|
V87__fix_super_domain_fk.sql
|
||||||
V88__transfer_billing_cancellation_history_id.sql
|
V88__transfer_billing_cancellation_history_id.sql
|
||||||
|
V89__host_history_host_deferred.sql
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
-- Copyright 2021 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.
|
||||||
|
|
||||||
|
ALTER TABLE "HostHistory" DROP CONSTRAINT fk3d09knnmxrt6iniwnp8j2ykga;
|
||||||
|
ALTER TABLE "HostHistory" DROP CONSTRAINT fk_hosthistory_host;
|
||||||
|
ALTER TABLE "HostHistory" ADD CONSTRAINT fk_history_registrar_id
|
||||||
|
FOREIGN KEY (history_registrar_id)
|
||||||
|
REFERENCES "Registrar"(registrar_id)
|
||||||
|
DEFERRABLE INITIALLY DEFERRED;
|
||||||
|
ALTER TABLE "HostHistory" ADD CONSTRAINT fk_hosthistory_host
|
||||||
|
FOREIGN KEY (host_repo_id)
|
||||||
|
REFERENCES "Host"(repo_id)
|
||||||
|
DEFERRABLE INITIALLY DEFERRED;
|
||||||
|
|
|
@ -1867,14 +1867,6 @@ ALTER TABLE ONLY public."Domain"
|
||||||
ADD CONSTRAINT fk2u3srsfbei272093m3b3xwj23 FOREIGN KEY (current_sponsor_registrar_id) REFERENCES public."Registrar"(registrar_id);
|
ADD CONSTRAINT fk2u3srsfbei272093m3b3xwj23 FOREIGN KEY (current_sponsor_registrar_id) REFERENCES public."Registrar"(registrar_id);
|
||||||
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Name: HostHistory fk3d09knnmxrt6iniwnp8j2ykga; Type: FK CONSTRAINT; Schema: public; Owner: -
|
|
||||||
--
|
|
||||||
|
|
||||||
ALTER TABLE ONLY public."HostHistory"
|
|
||||||
ADD CONSTRAINT fk3d09knnmxrt6iniwnp8j2ykga FOREIGN KEY (history_registrar_id) REFERENCES public."Registrar"(registrar_id);
|
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Name: SignedMarkRevocationEntry fk5ivlhvs3121yx2li5tqh54u4; Type: FK CONSTRAINT; Schema: public; Owner: -
|
-- Name: SignedMarkRevocationEntry fk5ivlhvs3121yx2li5tqh54u4; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||||
--
|
--
|
||||||
|
@ -2171,6 +2163,14 @@ ALTER TABLE ONLY public."GracePeriod"
|
||||||
ADD CONSTRAINT fk_grace_period_registrar_id FOREIGN KEY (registrar_id) REFERENCES public."Registrar"(registrar_id);
|
ADD CONSTRAINT fk_grace_period_registrar_id FOREIGN KEY (registrar_id) REFERENCES public."Registrar"(registrar_id);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: HostHistory fk_history_registrar_id; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY public."HostHistory"
|
||||||
|
ADD CONSTRAINT fk_history_registrar_id FOREIGN KEY (history_registrar_id) REFERENCES public."Registrar"(registrar_id) DEFERRABLE INITIALLY DEFERRED;
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Name: Host fk_host_creation_registrar_id; Type: FK CONSTRAINT; Schema: public; Owner: -
|
-- Name: Host fk_host_creation_registrar_id; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||||
--
|
--
|
||||||
|
@ -2208,7 +2208,7 @@ ALTER TABLE ONLY public."Host"
|
||||||
--
|
--
|
||||||
|
|
||||||
ALTER TABLE ONLY public."HostHistory"
|
ALTER TABLE ONLY public."HostHistory"
|
||||||
ADD CONSTRAINT fk_hosthistory_host FOREIGN KEY (host_repo_id) REFERENCES public."Host"(repo_id);
|
ADD CONSTRAINT fk_hosthistory_host FOREIGN KEY (host_repo_id) REFERENCES public."Host"(repo_id) DEFERRABLE INITIALLY DEFERRED;
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue