mirror of
https://github.com/google/nomulus
synced 2026-01-09 07:33:42 +00:00
Add db-compare tests to three more flows (#963)
* Add db-compare tests to three more flows Add database comparison to the replay tests for DomainDeleteFlowTest, DomainRenewFlowTest and DomainUpdateFlowTest.
This commit is contained in:
@@ -337,6 +337,10 @@ public class DomainContent extends EppResource
|
||||
nullToEmptyImmutableCopy(dsData).stream()
|
||||
.map(dsData -> dsData.cloneWithDomainRepoId(getRepoId()))
|
||||
.collect(toImmutableSet());
|
||||
|
||||
if (transferData != null) {
|
||||
transferData.convertVKeys();
|
||||
}
|
||||
}
|
||||
|
||||
@PostLoad
|
||||
|
||||
@@ -295,7 +295,7 @@ public abstract class PollMessage extends ImmutableObject
|
||||
@Transient @ImmutableObject.DoNotCompare
|
||||
List<DomainPendingActionNotificationResponse> domainPendingActionNotificationResponses;
|
||||
|
||||
@Transient List<DomainTransferResponse> domainTransferResponses;
|
||||
@Transient @ImmutableObject.DoNotCompare List<DomainTransferResponse> domainTransferResponses;
|
||||
|
||||
@Transient List<HostPendingActionNotificationResponse> hostPendingActionNotificationResponses;
|
||||
|
||||
|
||||
@@ -144,6 +144,16 @@ public class DomainTransferData extends TransferData<DomainTransferData.Builder>
|
||||
rootKey, serverApproveAutorenewPollMessage, serverApproveAutorenewPollMessageHistoryId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix the VKey "kind" for the PollMessage keys.
|
||||
*
|
||||
* <p>For use by DomainBase/DomainHistory OnLoad methods ONLY.
|
||||
*/
|
||||
public void convertVKeys() {
|
||||
serverApproveAutorenewPollMessage =
|
||||
PollMessage.Autorenew.convertVKey(serverApproveAutorenewPollMessage);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused") // For Hibernate.
|
||||
private void loadServerApproveBillingEventHistoryId(
|
||||
@AlsoLoad("serverApproveBillingEvent") VKey<BillingEvent.OneTime> val) {
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
package google.registry.model.transfer;
|
||||
|
||||
import static com.google.common.collect.ImmutableList.toImmutableList;
|
||||
import static google.registry.model.ImmutableObject.DoNotCompare;
|
||||
import static google.registry.util.CollectionUtils.isNullOrEmpty;
|
||||
import static google.registry.util.CollectionUtils.nullToEmpty;
|
||||
import static google.registry.util.CollectionUtils.nullToEmptyImmutableCopy;
|
||||
@@ -76,6 +77,7 @@ public abstract class TransferData<
|
||||
* be deleted.
|
||||
*/
|
||||
@Transient
|
||||
@DoNotCompare
|
||||
@IgnoreSave(IfNull.class)
|
||||
Set<VKey<? extends TransferServerApproveEntity>> serverApproveEntities;
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow, Domain
|
||||
|
||||
@Order(value = Order.DEFAULT - 2)
|
||||
@RegisterExtension
|
||||
final ReplayExtension replayExtension = ReplayExtension.createWithoutCompare(clock);
|
||||
final ReplayExtension replayExtension = ReplayExtension.createWithCompare(clock);
|
||||
|
||||
private DomainBase domain;
|
||||
private HistoryEntry earlierHistoryEntry;
|
||||
|
||||
@@ -108,7 +108,7 @@ class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, DomainBa
|
||||
|
||||
@Order(value = Order.DEFAULT - 2)
|
||||
@RegisterExtension
|
||||
final ReplayExtension replayExtension = ReplayExtension.createWithoutCompare(clock);
|
||||
final ReplayExtension replayExtension = ReplayExtension.createWithCompare(clock);
|
||||
|
||||
@BeforeEach
|
||||
void initDomainTest() {
|
||||
|
||||
@@ -117,7 +117,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||
|
||||
@Order(value = Order.DEFAULT - 2)
|
||||
@RegisterExtension
|
||||
final ReplayExtension replayExtension = ReplayExtension.createWithoutCompare(clock);
|
||||
final ReplayExtension replayExtension = ReplayExtension.createWithCompare(clock);
|
||||
|
||||
@BeforeEach
|
||||
void initDomainTest() {
|
||||
|
||||
Reference in New Issue
Block a user