mirror of
https://github.com/google/nomulus.git
synced 2025-08-02 07:52:11 +02:00
Add extra flow logic hooks for transfer approve, cancel and reject
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=139217498
This commit is contained in:
parent
5262cd2854
commit
fb47d2563d
12 changed files with 150 additions and 6 deletions
|
@ -51,6 +51,8 @@ import google.registry.model.contact.ContactAuthInfo;
|
|||
import google.registry.model.domain.DomainAuthInfo;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.TestExtraLogicManager;
|
||||
import google.registry.model.domain.TestExtraLogicManager.TestExtraLogicManagerSuccessException;
|
||||
import google.registry.model.domain.rgp.GracePeriodStatus;
|
||||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||
import google.registry.model.eppcommon.StatusValue;
|
||||
|
@ -93,6 +95,8 @@ public class DomainTransferApproveFlowTest
|
|||
.build())
|
||||
.build());
|
||||
setClientIdForFlow("TheRegistrar");
|
||||
createTld("extra");
|
||||
RegistryExtraFlowLogicProxy.setOverride("extra", TestExtraLogicManager.class);
|
||||
setupDomainWithPendingTransfer();
|
||||
clock.advanceOneMilli();
|
||||
}
|
||||
|
@ -490,5 +494,12 @@ public class DomainTransferApproveFlowTest
|
|||
|
||||
// NB: No need to test pending delete status since pending transfers will get cancelled upon
|
||||
// entering pending delete phase. So it's already handled in that test case.
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccess_extra() throws Exception {
|
||||
setupDomainWithPendingTransfer("extra");
|
||||
clock.advanceOneMilli();
|
||||
thrown.expect(TestExtraLogicManagerSuccessException.class, "transfer approved");
|
||||
doFailingTest("domain_transfer_approve_extra.xml");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,6 +35,8 @@ import google.registry.model.contact.ContactAuthInfo;
|
|||
import google.registry.model.domain.DomainAuthInfo;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.TestExtraLogicManager;
|
||||
import google.registry.model.domain.TestExtraLogicManager.TestExtraLogicManagerSuccessException;
|
||||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||
import google.registry.model.poll.PollMessage;
|
||||
import google.registry.model.registrar.Registrar;
|
||||
|
@ -297,4 +299,13 @@ public class DomainTransferCancelFlowTest
|
|||
|
||||
// NB: No need to test pending delete status since pending transfers will get cancelled upon
|
||||
// entering pending delete phase. So it's already handled in that test case.
|
||||
|
||||
@Test
|
||||
public void testSuccess_extra() throws Exception {
|
||||
setupDomainWithPendingTransfer("extra");
|
||||
clock.advanceOneMilli();
|
||||
RegistryExtraFlowLogicProxy.setOverride("extra", TestExtraLogicManager.class);
|
||||
thrown.expect(TestExtraLogicManagerSuccessException.class, "transfer cancelled");
|
||||
doFailingTest("domain_transfer_cancel_extra.xml");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,6 +35,8 @@ import google.registry.model.contact.ContactAuthInfo;
|
|||
import google.registry.model.domain.DomainAuthInfo;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
import google.registry.model.domain.GracePeriod;
|
||||
import google.registry.model.domain.TestExtraLogicManager;
|
||||
import google.registry.model.domain.TestExtraLogicManager.TestExtraLogicManagerSuccessException;
|
||||
import google.registry.model.eppcommon.AuthInfo.PasswordAuth;
|
||||
import google.registry.model.eppcommon.Trid;
|
||||
import google.registry.model.poll.PendingActionNotificationResponse;
|
||||
|
@ -259,4 +261,13 @@ public class DomainTransferRejectFlowTest
|
|||
|
||||
// NB: No need to test pending delete status since pending transfers will get cancelled upon
|
||||
// entering pending delete phase. So it's already handled in that test case.
|
||||
|
||||
@Test
|
||||
public void testSuccess_extra() throws Exception {
|
||||
setupDomainWithPendingTransfer("extra");
|
||||
clock.advanceOneMilli();
|
||||
RegistryExtraFlowLogicProxy.setOverride("extra", TestExtraLogicManager.class);
|
||||
thrown.expect(TestExtraLogicManagerSuccessException.class, "transfer rejected");
|
||||
doFailingTest("domain_transfer_reject_extra.xml");
|
||||
}
|
||||
}
|
||||
|
|
11
javatests/google/registry/flows/domain/testdata/domain_transfer_approve_extra.xml
vendored
Normal file
11
javatests/google/registry/flows/domain/testdata/domain_transfer_approve_extra.xml
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
||||
<command>
|
||||
<transfer op="approve">
|
||||
<domain:transfer
|
||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||
<domain:name>example.extra</domain:name>
|
||||
</domain:transfer>
|
||||
</transfer>
|
||||
<clTRID>ABC-12345</clTRID>
|
||||
</command>
|
||||
</epp>
|
11
javatests/google/registry/flows/domain/testdata/domain_transfer_cancel_extra.xml
vendored
Normal file
11
javatests/google/registry/flows/domain/testdata/domain_transfer_cancel_extra.xml
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
||||
<command>
|
||||
<transfer op="cancel">
|
||||
<domain:transfer
|
||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||
<domain:name>example.extra</domain:name>
|
||||
</domain:transfer>
|
||||
</transfer>
|
||||
<clTRID>ABC-12345</clTRID>
|
||||
</command>
|
||||
</epp>
|
11
javatests/google/registry/flows/domain/testdata/domain_transfer_reject_extra.xml
vendored
Normal file
11
javatests/google/registry/flows/domain/testdata/domain_transfer_reject_extra.xml
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
||||
<command>
|
||||
<transfer op="reject">
|
||||
<domain:transfer
|
||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||
<domain:name>example.extra</domain:name>
|
||||
</domain:transfer>
|
||||
</transfer>
|
||||
<clTRID>ABC-12345</clTRID>
|
||||
</command>
|
||||
</epp>
|
|
@ -254,9 +254,30 @@ public class TestExtraLogicManager implements RegistryExtraFlowLogic {
|
|||
throw new TestExtraLogicManagerSuccessException("restored");
|
||||
}
|
||||
|
||||
/** Performs additional tasks required for a transfer command. */
|
||||
/** Performs additional tasks required for a transfer approve command. */
|
||||
@Override
|
||||
public void performAdditionalDomainTransferLogic(
|
||||
public void performAdditionalDomainTransferApproveLogic(
|
||||
DomainResource domain, String clientId, HistoryEntry historyEntry) throws EppException {
|
||||
throw new TestExtraLogicManagerSuccessException("transfer approved");
|
||||
}
|
||||
|
||||
/** Performs additional tasks required for a transfer cancel command. */
|
||||
@Override
|
||||
public void performAdditionalDomainTransferCancelLogic(
|
||||
DomainResource domain, String clientId, HistoryEntry historyEntry) throws EppException {
|
||||
throw new TestExtraLogicManagerSuccessException("transfer cancelled");
|
||||
}
|
||||
|
||||
/** Performs additional tasks required for a transfer reject command. */
|
||||
@Override
|
||||
public void performAdditionalDomainTransferRejectLogic(
|
||||
DomainResource domain, String clientId, HistoryEntry historyEntry) throws EppException {
|
||||
throw new TestExtraLogicManagerSuccessException("transfer rejected");
|
||||
}
|
||||
|
||||
/** Performs additional tasks required for a transfer request command. */
|
||||
@Override
|
||||
public void performAdditionalDomainTransferRequestLogic(
|
||||
DomainResource domainResource,
|
||||
String clientId,
|
||||
DateTime asOfDate,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue