mirror of
https://github.com/google/nomulus.git
synced 2025-08-06 01:35:17 +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
|
@ -434,4 +434,13 @@ public class RegistryTest extends EntityTestCase {
|
|||
assertThat(registry.getEapFeeFor(clock.nowUtc().minusDays(2))).isEqualTo(Money.of(USD, 0));
|
||||
assertThat(registry.getEapFeeFor(clock.nowUtc().plusDays(2))).isEqualTo(Money.of(USD, 50));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_eapFee_wrongCurrency() {
|
||||
thrown.expect(
|
||||
IllegalArgumentException.class, "All EAP fees must be in the registry's currency");
|
||||
Registry.get("tld").asBuilder()
|
||||
.setEapFeeSchedule(ImmutableSortedMap.of(START_OF_TIME, Money.zero(EUR)))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue