mirror of
https://github.com/google/nomulus.git
synced 2025-08-06 01:35:17 +02:00
Add TLD extra flow logic for update
This CL implements the TLD-specific extra flow logic for updates, with tests, based on the static helper classes of the previous CL. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=135683537
This commit is contained in:
parent
94c549d960
commit
718da70b71
5 changed files with 53 additions and 67 deletions
|
@ -1,22 +0,0 @@
|
|||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
||||
<command>
|
||||
<update>
|
||||
<domain:update
|
||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||
<domain:name>example.tld</domain:name>
|
||||
</domain:update>
|
||||
</update>
|
||||
<extension>
|
||||
<flags:update xmlns:flags="urn:google:params:xml:ns:flags-0.1">
|
||||
<flags:add>
|
||||
<flags:flag>%FLAG%</flags:flag>
|
||||
</flags:add>
|
||||
</flags:update>
|
||||
<fee:update xmlns:fee="urn:ietf:params:xml:ns:fee-0.6">
|
||||
<fee:currency>USD</fee:currency>
|
||||
<fee:fee>%FEE%</fee:fee>
|
||||
</fee:update>
|
||||
</extension>
|
||||
<clTRID>ABC-12345</clTRID>
|
||||
</command>
|
||||
</epp>
|
|
@ -1,22 +0,0 @@
|
|||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
||||
<command>
|
||||
<update>
|
||||
<domain:update
|
||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||
<domain:name>example.tld</domain:name>
|
||||
</domain:update>
|
||||
</update>
|
||||
<extension>
|
||||
<flags:update xmlns:flags="urn:google:params:xml:ns:flags-0.1">
|
||||
<flags:rem>
|
||||
<flags:flag>%FLAG%</flags:flag>
|
||||
</flags:rem>
|
||||
</flags:update>
|
||||
<fee:update xmlns:fee="urn:ietf:params:xml:ns:fee-0.6">
|
||||
<fee:currency>USD</fee:currency>
|
||||
<fee:fee>%FEE%</fee:fee>
|
||||
</fee:update>
|
||||
</extension>
|
||||
<clTRID>ABC-12345</clTRID>
|
||||
</command>
|
||||
</epp>
|
|
@ -20,6 +20,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
|||
import com.google.common.base.Ascii;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Iterables;
|
||||
import google.registry.flows.EppException;
|
||||
import google.registry.flows.domain.RegistryExtraFlowLogic;
|
||||
|
@ -34,6 +35,7 @@ import google.registry.model.eppinput.EppInput;
|
|||
import google.registry.model.reporting.HistoryEntry;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
/**
|
||||
|
@ -57,7 +59,7 @@ public class TestExtraLogicManager implements RegistryExtraFlowLogic {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<String> getExtensionFlags(
|
||||
public Set<String> getExtensionFlags(
|
||||
DomainResource domainResource, String clientId, DateTime asOfDate) {
|
||||
// Take the part before the period, split by dashes, and treat each part after the first as
|
||||
// a flag.
|
||||
|
@ -65,7 +67,7 @@ public class TestExtraLogicManager implements RegistryExtraFlowLogic {
|
|||
Splitter.on('-').splitToList(
|
||||
Iterables.getFirst(
|
||||
Splitter.on('.').split(domainResource.getFullyQualifiedDomainName()), ""));
|
||||
return components.subList(1, components.size());
|
||||
return ImmutableSet.copyOf(components.subList(1, components.size()));
|
||||
}
|
||||
|
||||
BaseFee domainNameToFeeOrCredit(String domainName) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue