mirror of
https://github.com/google/nomulus.git
synced 2025-08-04 17:01:51 +02:00
Do not cancel pending transfers unless there is one to cancel
A previous CL inadvertently caused the system to always set the transfer status to SERVER_CANCELLED when deleting a resource, even if there was no transfer. This led to RDE problems. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=140890919
This commit is contained in:
parent
7cf29366bc
commit
c0d9b54872
5 changed files with 37 additions and 7 deletions
|
@ -75,6 +75,7 @@ import google.registry.model.poll.PollMessage;
|
|||
import google.registry.model.poll.PollMessage.OneTime;
|
||||
import google.registry.model.registry.Registry;
|
||||
import google.registry.model.reporting.HistoryEntry;
|
||||
import google.registry.model.transfer.TransferData;
|
||||
import google.registry.model.transfer.TransferResponse;
|
||||
import google.registry.testing.ExceptionRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
|
@ -196,6 +197,16 @@ public class DeleteContactsAndHostsActionTest
|
|||
assertNoTasksEnqueued(QUEUE_ASYNC_DELETE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_contactWithoutPendingTransfer_isDeletedAndHasNoTransferData()
|
||||
throws Exception {
|
||||
ContactResource contact = persistContactPendingDelete("blah8221");
|
||||
enqueuer.enqueueAsyncDelete(contact, "TheRegistrar", false);
|
||||
runMapreduce();
|
||||
ContactResource contactAfterDeletion = ofy().load().entity(contact).now();
|
||||
assertThat(contactAfterDeletion.getTransferData()).isEqualTo(TransferData.EMPTY);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_contactWithPendingTransfer_getsDeleted() throws Exception {
|
||||
DateTime transferRequestTime = clock.nowUtc().minusDays(3);
|
||||
|
|
|
@ -480,6 +480,16 @@ public class DomainDeleteFlowTest extends ResourceFlowTestCase<DomainDeleteFlow,
|
|||
runFlowAssertResponse(readFile("domain_delete_response_autorenew_fee.xml", FEE_12_MAP));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_noPendingTransfer_deletedAndHasNoTransferData() throws Exception {
|
||||
setClientIdForFlow("TheRegistrar");
|
||||
setupSuccessfulTest();
|
||||
clock.advanceOneMilli();
|
||||
runFlowAssertResponse(readFile("domain_delete_response_pending.xml"));
|
||||
DomainResource domain = reloadResourceByForeignKey();
|
||||
assertThat(domain.getTransferData()).isEqualTo(TransferData.EMPTY);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_pendingTransfer() throws Exception {
|
||||
setClientIdForFlow("TheRegistrar");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue