Add a domain application update custom pricing logic test

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142294037
This commit is contained in:
mcilwain 2016-12-16 13:42:50 -08:00 committed by Ben McIlwain
parent 9764ab0a56
commit d485c5d7e2
3 changed files with 56 additions and 3 deletions

View file

@ -82,6 +82,26 @@ public class TestDomainPricingCustomLogic extends DomainPricingCustomLogic {
}
}
@Override
public FeesAndCredits customizeApplicationUpdatePrice(
ApplicationUpdatePriceParameters priceParameters) throws EppException {
if (priceParameters
.domainApplication()
.getFullyQualifiedDomainName()
.startsWith("non-free-update")) {
FeesAndCredits feesAndCredits = priceParameters.feesAndCredits();
List<BaseFee> newFeesAndCredits =
new ImmutableList.Builder<BaseFee>()
.addAll(feesAndCredits.getFeesAndCredits())
.add(Fee.create(BigDecimal.valueOf(100), FeeType.UPDATE))
.build();
return new FeesAndCredits(
feesAndCredits.getCurrency(), toArray(newFeesAndCredits, BaseFee.class));
} else {
return priceParameters.feesAndCredits();
}
}
@Override
public FeesAndCredits customizeRenewPrice(RenewPriceParameters priceParameters)
throws EppException {