mirror of
https://github.com/google/nomulus.git
synced 2025-08-05 17:28:25 +02:00
Add additional specific PricingEngineProxy methods
We already had methods to return just the create or just the renew price. I added more to return just the premium flag or just the fee class. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=136833071
This commit is contained in:
parent
fad0aa4ffa
commit
aecca10989
7 changed files with 29 additions and 19 deletions
|
@ -18,7 +18,7 @@ import static com.google.common.io.BaseEncoding.base16;
|
|||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.model.domain.fee.Fee.FEE_EXTENSION_URIS;
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
import static google.registry.pricing.PricingEngineProxy.getPricesForDomainName;
|
||||
import static google.registry.pricing.PricingEngineProxy.isDomainPremium;
|
||||
import static google.registry.testing.DatastoreHelper.assertBillingEvents;
|
||||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
import static google.registry.testing.DatastoreHelper.createTlds;
|
||||
|
@ -173,7 +173,7 @@ public class DomainCreateFlowTest extends ResourceFlowTestCase<DomainCreateFlow,
|
|||
DomainResource domain = reloadResourceByForeignKey();
|
||||
|
||||
// Calculate the total cost.
|
||||
Money cost = getPricesForDomainName(getUniqueIdFromCommand(), clock.nowUtc()).isPremium()
|
||||
Money cost = isDomainPremium(getUniqueIdFromCommand(), clock.nowUtc())
|
||||
? Money.of(USD, 200)
|
||||
: Money.of(USD, 26);
|
||||
Money eapFee = Money.of(Registry.get(domainTld).getCurrency(),
|
||||
|
|
|
@ -84,7 +84,7 @@ public class TldSpecificLogicProxyTest extends ShardableTestCase {
|
|||
b, Money.of(USD, 50)))
|
||||
.build());
|
||||
basicCreateCost =
|
||||
PricingEngineProxy.getPricesForDomainName("example.tld", clock.nowUtc()).getCreateCost();
|
||||
PricingEngineProxy.getDomainCreateCost("example.tld", clock.nowUtc(), 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -17,7 +17,7 @@ package google.registry.pricing;
|
|||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.pricing.PricingEngineProxy.getDomainCreateCost;
|
||||
import static google.registry.pricing.PricingEngineProxy.getDomainRenewCost;
|
||||
import static google.registry.pricing.PricingEngineProxy.getPricesForDomainName;
|
||||
import static google.registry.pricing.PricingEngineProxy.isDomainPremium;
|
||||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
import static google.registry.testing.DatastoreHelper.persistPremiumList;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
|
@ -91,9 +91,9 @@ public class PricingEngineProxyTest {
|
|||
@Test
|
||||
public void testIsPremiumDomain() throws Exception {
|
||||
createTld("example");
|
||||
assertThat(getPricesForDomainName("poor.example", clock.nowUtc()).isPremium()).isFalse();
|
||||
assertThat(getPricesForDomainName("rich.example", clock.nowUtc()).isPremium()).isTrue();
|
||||
assertThat(getPricesForDomainName("richer.example", clock.nowUtc()).isPremium()).isTrue();
|
||||
assertThat(isDomainPremium("poor.example", clock.nowUtc())).isFalse();
|
||||
assertThat(isDomainPremium("rich.example", clock.nowUtc())).isTrue();
|
||||
assertThat(isDomainPremium("richer.example", clock.nowUtc())).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue