mirror of
https://github.com/google/nomulus.git
synced 2025-06-29 07:43:37 +02:00
Validate EAP currency in Registry build
Verify that the currency of all entries in the EAP fee schedule map matches that of the registry object itself. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=124967612
This commit is contained in:
parent
ec39f15a23
commit
5a4877805b
3 changed files with 30 additions and 8 deletions
|
@ -826,15 +826,19 @@ public class Registry extends ImmutableObject implements Buildable {
|
|||
checkArgument(
|
||||
instance.getServerStatusChangeCost().getCurrencyUnit().equals(instance.currency),
|
||||
"Server status change cost must be in the registry's currency");
|
||||
Predicate<Money> currencyCheck = new Predicate<Money>(){
|
||||
@Override
|
||||
public boolean apply(Money money) {
|
||||
return money.getCurrencyUnit().equals(instance.currency);
|
||||
}};
|
||||
checkArgument(
|
||||
Iterables.all(
|
||||
instance.getRenewBillingCostTransitions().values(),
|
||||
new Predicate<Money>(){
|
||||
@Override
|
||||
public boolean apply(Money money) {
|
||||
return money.getCurrencyUnit().equals(instance.currency);
|
||||
}}),
|
||||
instance.getRenewBillingCostTransitions().values(), currencyCheck),
|
||||
"Renew cost must be in the registry's currency");
|
||||
checkArgument(
|
||||
Iterables.all(
|
||||
instance.eapFeeSchedule.toValueMap().values(), currencyCheck),
|
||||
"All EAP fees must be in the registry's currency");
|
||||
checkArgumentNotNull(
|
||||
instance.pricingEngineClassName, "All registries must have a configured pricing engine");
|
||||
instance.tldStrId = tldName;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue