/**
* 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 Cash deposit = DEPOSIT_DEFINITION.toDerivative(referenceDate, CURVES_NAME[0]);
InterestRateCurveSensitivity pvcsComputed = METHOD_DEPOSIT.presentValueCurveSensitivity(deposit, CURVES);
pvcsComputed = pvcsComputed.cleaned(0.0, 1.0E-4);
assertEquals("DepositDefinition: present value curve sensitivity", 1, pvcsComputed.getSensitivities().size());
assertEquals("DepositDefinition: present value curve sensitivity", 1, pvcsComputed.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 Cash depositBunped = DEPOSIT_DEFINITION.toDerivative(referenceDate, bumpedCurveName);
final double[] nodeTimesDisc = new double[] {deposit.getEndTime() };
final double[] sensiDiscMethod = SensitivityFiniteDifference.curveSensitivity(depositBunped, CURVES, CURVES_NAME[0], bumpedCurveName, nodeTimesDisc, deltaShift, METHOD_DEPOSIT);
final List<DoublesPair> sensiPvDisc = pvcsComputed.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);