// ------------------------------------------------------------------------- public void test_builder_ensureDefaults() { ResetSchedule test = ResetSchedule.builder() .resetFrequency(P1M) .businessDayAdjustment(BusinessDayAdjustment.of(FOLLOWING, GBLO)) .build(); assertEquals(test.getResetFrequency(), P1M); assertEquals(test.getBusinessDayAdjustment(), BusinessDayAdjustment.of(FOLLOWING, GBLO)); assertEquals(test.getResetMethod(), UNWEIGHTED); }
// ------------------------------------------------------------------------- public void coverage() { ResetSchedule test = ResetSchedule.builder() .resetFrequency(P1M) .businessDayAdjustment(BusinessDayAdjustment.of(FOLLOWING, GBLO)) .build(); coverImmutableBean(test); ResetSchedule test2 = ResetSchedule.builder() .resetFrequency(P3M) .businessDayAdjustment(BusinessDayAdjustment.of(MODIFIED_FOLLOWING, GBLO)) .resetMethod(WEIGHTED) .build(); coverBeanEquals(test, test2); }
public void test_serialization() { ResetSchedule test = ResetSchedule.builder() .resetFrequency(P1M) .businessDayAdjustment(BusinessDayAdjustment.of(FOLLOWING, GBLO)) .build(); assertSerialization(test); }
// ------------------------------------------------------------------------- public void test_resolve() { ResetSchedule test = ResetSchedule.builder() .resetFrequency(P1M) .businessDayAdjustment(BusinessDayAdjustment.of(FOLLOWING, GBLO)) .build(); SchedulePeriod accrualPeriod = SchedulePeriod.of(DATE_01_06, DATE_04_07, DATE_01_05, DATE_04_05); Schedule schedule = test.createSchedule(DAY_5, REF_DATA).apply(accrualPeriod); Schedule expected = Schedule.builder() .periods( SchedulePeriod.of(DATE_01_06, DATE_02_05, DATE_01_05, DATE_02_05), SchedulePeriod.of(DATE_02_05, DATE_03_05, DATE_02_05, DATE_03_05), SchedulePeriod.of(DATE_03_05, DATE_04_07, DATE_03_05, DATE_04_05)) .frequency(P1M) .rollConvention(DAY_5) .build(); assertEquals(schedule, expected); }