final ExternalId marketDataId = ExternalId.of(SCHEME, "US3mLibor");
final double rate = 0.0012345;
final SnapshotDataBundle marketValues = new SnapshotDataBundle();
marketValues.setDataPoint(marketDataId, rate);
final ZonedDateTime now = DateUtils.getUTCDate(2013, 2, 4);
CurveNode iborNode = new CashNode(Tenor.of(Period.ZERO), Tenor.THREE_MONTHS, LIBOR_3M_ID, "Mapper");
final CurveNodeVisitor<InstrumentDefinition<?>> converter = new CashNodeConverter(CONVENTION_SOURCE, HOLIDAY_SOURCE, REGION_SOURCE, marketValues, marketDataId, now);
InstrumentDefinition<?> definition = iborNode.accept(converter);
assertTrue(definition instanceof DepositIborDefinition);
DepositIborDefinition ibor = (DepositIborDefinition) definition;
final IborIndex ibor3m = new IborIndex(Currency.USD, Tenor.THREE_MONTHS.getPeriod(), 2, THIRTY_360, MODIFIED_FOLLOWING, false, LIBOR_3M_ID.getValue());
DepositIborDefinition expectedLibor = new DepositIborDefinition(Currency.USD, DateUtils.getUTCDate(2013, 2, 6), DateUtils.getUTCDate(2013, 5, 6), 1, rate, 90. / 360, ibor3m);
assertEquals(expectedLibor, ibor);
iborNode = new CashNode(Tenor.of(Period.ZERO), Tenor.SIX_MONTHS, LIBOR_6M_ID, "Mapper");
definition = iborNode.accept(converter);
assertTrue(definition instanceof DepositIborDefinition);
ibor = (DepositIborDefinition) definition;
final IborIndex ibor6m = new IborIndex(Currency.USD, Tenor.SIX_MONTHS.getPeriod(), 2, ACT_360, MODIFIED_FOLLOWING, false, LIBOR_6M_ID.getValue());
expectedLibor = new DepositIborDefinition(Currency.USD, DateUtils.getUTCDate(2013, 2, 6), DateUtils.getUTCDate(2013, 8, 6), 1, rate, 181. / 360, ibor6m);
assertEquals(expectedLibor, ibor);