Restore symmetric VKey referenced by BillingEvent.Cancellation (#928)

This commit is contained in:
Shicong Huang 2021-01-14 13:16:24 -05:00 committed by GitHub
parent f669e3ca59
commit 56e384aa4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 181 additions and 108 deletions

View file

@ -318,13 +318,8 @@ public class BillingEventTest extends EntityTestCase {
historyEntry2,
"foo.tld");
// Set ID to be the same to ignore for the purposes of comparison.
newCancellation = newCancellation.asBuilder().setId(cancellationOneTime.getId()).build();
// TODO(b/168537779): Remove setRecurringEventKey after symmetric VKey can be reconstructed
// correctly.
assertThat(newCancellation)
.isEqualTo(
cancellationOneTime.asBuilder().setOneTimeEventKey(oneTime.createVKey()).build());
assertThat(newCancellation.asBuilder().setId(cancellationOneTime.getId()).build())
.isEqualTo(cancellationOneTime);
}
@TestOfyAndSql
@ -340,13 +335,8 @@ public class BillingEventTest extends EntityTestCase {
historyEntry2,
"foo.tld");
// Set ID to be the same to ignore for the purposes of comparison.
newCancellation = newCancellation.asBuilder().setId(cancellationRecurring.getId()).build();
// TODO(b/168537779): Remove setRecurringEventKey after symmetric VKey can be reconstructed
// correctly.
assertThat(newCancellation)
.isEqualTo(
cancellationRecurring.asBuilder().setRecurringEventKey(recurring.createVKey()).build());
assertThat(newCancellation.asBuilder().setId(cancellationRecurring.getId()).build())
.isEqualTo(cancellationRecurring);
}
@TestOfyAndSql

View file

@ -8,8 +8,8 @@ class google.registry.model.billing.BillingEvent$Cancellation {
@Id java.lang.Long id;
@Parent com.googlecode.objectify.Key<google.registry.model.reporting.HistoryEntry> parent;
google.registry.model.billing.BillingEvent$Reason reason;
google.registry.persistence.VKey<google.registry.model.billing.BillingEvent$OneTime> refOneTime;
google.registry.persistence.VKey<google.registry.model.billing.BillingEvent$Recurring> refRecurring;
google.registry.persistence.BillingVKey$BillingEventVKey refOneTime;
google.registry.persistence.BillingVKey$BillingRecurrenceVKey refRecurring;
java.lang.String clientId;
java.lang.String targetId;
java.util.Set<google.registry.model.billing.BillingEvent$Flag> flags;