mirror of
https://github.com/google/nomulus.git
synced 2025-04-30 03:57:51 +02:00
Fix ContactTransferData SQL loads (#967)
* Fix ContactTransferData SQL loads ContactTransferData is currently loaded back from SQL as an unspecialized TransferData object. Replace it with the ContactTransferData object that we use it to reconstitute. It's likely that this could be done more straightforwardly with a schema change. * Changes requested in review
This commit is contained in:
parent
a2ffb504f5
commit
eb80559b28
2 changed files with 21 additions and 11 deletions
|
@ -406,17 +406,20 @@ public abstract class PollMessage extends ImmutableObject
|
||||||
pendingActionNotificationResponse.processedDate));
|
pendingActionNotificationResponse.processedDate));
|
||||||
}
|
}
|
||||||
if (contactId != null && transferResponse != null) {
|
if (contactId != null && transferResponse != null) {
|
||||||
contactTransferResponses =
|
// The transferResponse is currently an unspecialized TransferResponse instance, create a
|
||||||
ImmutableList.of(
|
// ContactTransferResponse so that the value is consistently specialized and store it in the
|
||||||
new ContactTransferResponse.Builder()
|
// list representation for datastore.
|
||||||
.setContactId(contactId)
|
transferResponse =
|
||||||
.setGainingClientId(transferResponse.getGainingClientId())
|
new ContactTransferResponse.Builder()
|
||||||
.setLosingClientId(transferResponse.getLosingClientId())
|
.setContactId(contactId)
|
||||||
.setTransferStatus(transferResponse.getTransferStatus())
|
.setGainingClientId(transferResponse.getGainingClientId())
|
||||||
.setTransferRequestTime(transferResponse.getTransferRequestTime())
|
.setLosingClientId(transferResponse.getLosingClientId())
|
||||||
.setPendingTransferExpirationTime(
|
.setTransferStatus(transferResponse.getTransferStatus())
|
||||||
transferResponse.getPendingTransferExpirationTime())
|
.setTransferRequestTime(transferResponse.getTransferRequestTime())
|
||||||
.build());
|
.setPendingTransferExpirationTime(
|
||||||
|
transferResponse.getPendingTransferExpirationTime())
|
||||||
|
.build();
|
||||||
|
contactTransferResponses = ImmutableList.of((ContactTransferResponse) transferResponse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,14 +41,21 @@ import google.registry.model.transfer.TransferData;
|
||||||
import google.registry.model.transfer.TransferResponse;
|
import google.registry.model.transfer.TransferResponse;
|
||||||
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.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 ContactTransferApproveFlow}. */
|
/** Unit tests for {@link ContactTransferApproveFlow}. */
|
||||||
@DualDatabaseTest
|
@DualDatabaseTest
|
||||||
class ContactTransferApproveFlowTest
|
class ContactTransferApproveFlowTest
|
||||||
extends ContactTransferFlowTestCase<ContactTransferApproveFlow, ContactResource> {
|
extends ContactTransferFlowTestCase<ContactTransferApproveFlow, ContactResource> {
|
||||||
|
|
||||||
|
@Order(value = Order.DEFAULT - 2)
|
||||||
|
@RegisterExtension
|
||||||
|
final ReplayExtension replayExtension = ReplayExtension.createWithCompare(clock);
|
||||||
|
|
||||||
@BeforeEach
|
@BeforeEach
|
||||||
void setUp() {
|
void setUp() {
|
||||||
setEppInput("contact_transfer_approve.xml");
|
setEppInput("contact_transfer_approve.xml");
|
||||||
|
|
Loading…
Add table
Reference in a new issue