mirror of
https://github.com/google/nomulus.git
synced 2025-07-22 18:55:58 +02:00
Add sunrise and anchor tenant discounts to invoicing pipeline
This officially adds a 15% discount to sunrise creates and makes anchor tenant creates free for the first 2 years. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=204805141
This commit is contained in:
parent
ccbdfd0e41
commit
c4a2b5fa8d
4 changed files with 71 additions and 5 deletions
|
@ -99,6 +99,22 @@ public class BillingEventTest {
|
|||
assertThat(event.flags()).isEqualTo("AUTO_RENEW SYNTHETIC");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParseBillingEventFromRecord_sunriseCreate_reducedPrice_success() {
|
||||
schemaAndRecord.getRecord().put("flags", "SUNRISE");
|
||||
BillingEvent event = BillingEvent.parseFromRecord(schemaAndRecord);
|
||||
assertThat(event.amount()).isEqualTo(17.43);
|
||||
assertThat(event.flags()).isEqualTo("SUNRISE");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParseBillingEventFromRecord_anchorTenant_zeroPrice_success() {
|
||||
schemaAndRecord.getRecord().put("flags", "SUNRISE ANCHOR_TENANT");
|
||||
BillingEvent event = BillingEvent.parseFromRecord(schemaAndRecord);
|
||||
assertThat(event.amount()).isZero();
|
||||
assertThat(event.flags()).isEqualTo("SUNRISE ANCHOR_TENANT");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParseBillingEventFromRecord_nullValue_throwsException() {
|
||||
schemaAndRecord.getRecord().put("tld", null);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue