public void testFRA() {
final ExternalId marketDataId = ExternalId.of(SCHEME, "US3mLibor");
final double rate = 0.0012345;
final SnapshotDataBundle marketValues = new SnapshotDataBundle();
marketValues.setDataPoint(marketDataId, rate);
final FRANode fraNode = new FRANode(Tenor.SIX_MONTHS, Tenor.NINE_MONTHS, LIBOR_3M_ID, "Mapper");
final IborIndex index = new IborIndex(Currency.USD, Tenor.THREE_MONTHS.getPeriod(), 2, THIRTY_360, MODIFIED_FOLLOWING, false, LIBOR_3M_ID.getValue());
final ZonedDateTime now = DateUtils.getUTCDate(2013, 3, 1);
final CurveNodeVisitor<InstrumentDefinition<?>> converter = new FRANodeConverter(CONVENTION_SOURCE, HOLIDAY_SOURCE, REGION_SOURCE, marketValues, marketDataId, now);
final InstrumentDefinition<?> definition = fraNode.accept(converter);
assertTrue(definition instanceof ForwardRateAgreementDefinition);
final ForwardRateAgreementDefinition fra = (ForwardRateAgreementDefinition) definition;
final ForwardRateAgreementDefinition expectedFRA = ForwardRateAgreementDefinition.from(DateUtils.getUTCDate(2013, 9, 5), DateUtils.getUTCDate(2013, 12, 5), 1, index, rate, CALENDAR);
assertEquals(expectedFRA, fra);
}