CALCULATOR.constructCreditDefaultSwapContingentLegIntegrationSchedule(VALUATION_DATE, endDate, startDate, cds, YIELD_CURVE, hazardRateCurve);
}
@Test(expectedExceptions = IllegalArgumentException.class)
public void endBeforeValuateTest() {
final CreditDefaultSwapDefinition cds = CreditDefaultSwapDefinitionDataSets.getLegacyVanillaDefinition().withMaturityDate(VALUATION_DATE.plusYears(10));
final ZonedDateTime[] hrDates = new ZonedDateTime[HR_DATES.length];
final double[] hrTimes = new double[HR_TIMES.length];
final int len = HR_DATES.length;
for (int i = 0; i < len; i++) {
hrDates[i] = HR_DATES[i].plusDays(12);
hrTimes[i] = DAY_COUNT.getDayCountFraction(BASE_DATE, hrDates[i]);
}
final HazardRateCurve hazardRateCurve = new HazardRateCurve(hrDates, hrTimes, HR_RATES, OFFSET);
final ZonedDateTime startDate = getStartDate(cds);
final ZonedDateTime endDate = cds.getMaturityDate();
final ZonedDateTime ev = DateUtils.getUTCDate(2043, 1, 6);
CALCULATOR.constructCreditDefaultSwapContingentLegIntegrationSchedule(ev, endDate, startDate, cds, YIELD_CURVE, hazardRateCurve);
// System.out.println(new DoubleMatrix1D(res));
}