/**
* Tests present value curve sensitivity when the valuation date is on trade date.
*/
public void presentValueCurveSensitivityBetweenSettleMaturity() {
final ZonedDateTime referenceDate = DateUtils.getUTCDate(2011, 12, 20);
final DepositZero deposit = DEPOSIT_DEFINITION.toDerivative(referenceDate, CURVES_NAME[0]);
InterestRateCurveSensitivity pvcsMethod = METHOD_DEPOSIT.presentValueCurveSensitivity(deposit, CURVES);
pvcsMethod = pvcsMethod.cleaned(0.0, 1.0E-4);
assertEquals("DepositDefinition: present value curve sensitivity", 1, pvcsMethod.getSensitivities().size());
assertEquals("DepositDefinition: present value curve sensitivity", 1, pvcsMethod.getSensitivities().get(CURVES_NAME[0]).size());
final double deltaTolerancePrice = 1.0E+2;
//Testing note: Sensitivity is for a movement of 1. 1E+2 = 1 cent for a 1 bp move. Tolerance increased to cope with numerical imprecision of finite difference.
final double deltaShift = 1.0E-6;
// Discounting curve sensitivity
final String bumpedCurveName = "Bumped Curve";
final DepositZero depositBumped = DEPOSIT_DEFINITION.toDerivative(referenceDate, bumpedCurveName);
final double[] nodeTimesDisc = new double[] {deposit.getEndTime() };
final double[] sensiDiscMethod = SensitivityFiniteDifference.curveSensitivity(depositBumped, CURVES, CURVES_NAME[0], bumpedCurveName, nodeTimesDisc, deltaShift, METHOD_DEPOSIT);
final List<DoublesPair> sensiPvDisc = pvcsMethod.getSensitivities().get(CURVES_NAME[0]);
final DoublesPair pairPv = sensiPvDisc.get(0);
assertEquals("Sensitivity coupon pv to forward curve: Node " + 0, nodeTimesDisc[0], pairPv.getFirst(), 1E-8);