mirror of
https://github.com/google/nomulus.git
synced 2025-07-05 10:43:26 +02: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:
parent
f983d564f8
commit
17cd9ba4f1
7 changed files with 20 additions and 4 deletions
|
@ -337,6 +337,10 @@ public class DomainContent extends EppResource
|
||||||
nullToEmptyImmutableCopy(dsData).stream()
|
nullToEmptyImmutableCopy(dsData).stream()
|
||||||
.map(dsData -> dsData.cloneWithDomainRepoId(getRepoId()))
|
.map(dsData -> dsData.cloneWithDomainRepoId(getRepoId()))
|
||||||
.collect(toImmutableSet());
|
.collect(toImmutableSet());
|
||||||
|
|
||||||
|
if (transferData != null) {
|
||||||
|
transferData.convertVKeys();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostLoad
|
@PostLoad
|
||||||
|
|
|
@ -295,7 +295,7 @@ public abstract class PollMessage extends ImmutableObject
|
||||||
@Transient @ImmutableObject.DoNotCompare
|
@Transient @ImmutableObject.DoNotCompare
|
||||||
List<DomainPendingActionNotificationResponse> domainPendingActionNotificationResponses;
|
List<DomainPendingActionNotificationResponse> domainPendingActionNotificationResponses;
|
||||||
|
|
||||||
@Transient List<DomainTransferResponse> domainTransferResponses;
|
@Transient @ImmutableObject.DoNotCompare List<DomainTransferResponse> domainTransferResponses;
|
||||||
|
|
||||||
@Transient List<HostPendingActionNotificationResponse> hostPendingActionNotificationResponses;
|
@Transient List<HostPendingActionNotificationResponse> hostPendingActionNotificationResponses;
|
||||||
|
|
||||||
|
|
|
@ -144,6 +144,16 @@ public class DomainTransferData extends TransferData<DomainTransferData.Builder>
|
||||||
rootKey, serverApproveAutorenewPollMessage, serverApproveAutorenewPollMessageHistoryId);
|
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.
|
@SuppressWarnings("unused") // For Hibernate.
|
||||||
private void loadServerApproveBillingEventHistoryId(
|
private void loadServerApproveBillingEventHistoryId(
|
||||||
@AlsoLoad("serverApproveBillingEvent") VKey<BillingEvent.OneTime> val) {
|
@AlsoLoad("serverApproveBillingEvent") VKey<BillingEvent.OneTime> val) {
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
package google.registry.model.transfer;
|
package google.registry.model.transfer;
|
||||||
|
|
||||||
import static com.google.common.collect.ImmutableList.toImmutableList;
|
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.isNullOrEmpty;
|
||||||
import static google.registry.util.CollectionUtils.nullToEmpty;
|
import static google.registry.util.CollectionUtils.nullToEmpty;
|
||||||
import static google.registry.util.CollectionUtils.nullToEmptyImmutableCopy;
|
import static google.registry.util.CollectionUtils.nullToEmptyImmutableCopy;
|
||||||
|
@ -76,6 +77,7 @@ public abstract class TransferData<
|
||||||
* be deleted.
|
* be deleted.
|
||||||
*/
|
*/
|
||||||
@Transient
|
@Transient
|
||||||
|
@DoNotCompare
|
||||||
@IgnoreSave(IfNull.class)
|
@IgnoreSave(IfNull.class)
|
||||||
Set<VKey<? extends TransferServerApproveEntity>> serverApproveEntities;
|
Set<VKey<? extends TransferServerApproveEntity>> serverApproveEntities;
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow, Domain
|
||||||
|
|
||||||
@Order(value = Order.DEFAULT - 2)
|
@Order(value = Order.DEFAULT - 2)
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final ReplayExtension replayExtension = ReplayExtension.createWithoutCompare(clock);
|
final ReplayExtension replayExtension = ReplayExtension.createWithCompare(clock);
|
||||||
|
|
||||||
private DomainBase domain;
|
private DomainBase domain;
|
||||||
private HistoryEntry earlierHistoryEntry;
|
private HistoryEntry earlierHistoryEntry;
|
||||||
|
|
|
@ -108,7 +108,7 @@ class DomainRenewFlowTest extends ResourceFlowTestCase<DomainRenewFlow, DomainBa
|
||||||
|
|
||||||
@Order(value = Order.DEFAULT - 2)
|
@Order(value = Order.DEFAULT - 2)
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final ReplayExtension replayExtension = ReplayExtension.createWithoutCompare(clock);
|
final ReplayExtension replayExtension = ReplayExtension.createWithCompare(clock);
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void initDomainTest() {
|
void initDomainTest() {
|
||||||
|
|
|
@ -117,7 +117,7 @@ class DomainUpdateFlowTest extends ResourceFlowTestCase<DomainUpdateFlow, Domain
|
||||||
|
|
||||||
@Order(value = Order.DEFAULT - 2)
|
@Order(value = Order.DEFAULT - 2)
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
final ReplayExtension replayExtension = ReplayExtension.createWithoutCompare(clock);
|
final ReplayExtension replayExtension = ReplayExtension.createWithCompare(clock);
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void initDomainTest() {
|
void initDomainTest() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue