final IndexON index = new IndexON(OVERNIGHT_ID.getValue(), Currency.USD, ACT_360, 1);
AnnuityCouponFixedDefinition fixedLeg = AnnuityCouponFixedDefinition.from(Currency.USD, settlementDate, Period.ofYears(10), Period.ofMonths(6), CALENDAR, ACT_360,
MODIFIED_FOLLOWING, false, 1, rate, true);
AnnuityCouponONSimplifiedDefinition floatLeg = AnnuityCouponONSimplifiedDefinition.from(settlementDate, Period.ofYears(10), 1, false, index, 1,
CALENDAR, MODIFIED_FOLLOWING, Period.ofYears(1), false);
assertEquals(new SwapDefinition(fixedLeg, floatLeg), definition);
settlementDate = DateUtils.getUTCDate(2013, 3, 5);
swapNode = new SwapNode(Tenor.of(Period.ZERO), Tenor.TEN_YEARS, OIS_ID, FIXED_LEG_ID, "Mapper");
definition = swapNode.accept(converter);
assertTrue(definition instanceof SwapDefinition);
fixedLeg = AnnuityCouponFixedDefinition.from(Currency.USD, settlementDate, Period.ofYears(10), Period.ofMonths(6), CALENDAR, ACT_360,
MODIFIED_FOLLOWING, false, 1, rate, false);
floatLeg = AnnuityCouponONSimplifiedDefinition.from(settlementDate, Period.ofYears(10), 1, true, index, 1,
CALENDAR, MODIFIED_FOLLOWING, Period.ofYears(1), false);
assertEquals(new SwapDefinition(floatLeg, fixedLeg), definition);
settlementDate = DateUtils.getUTCDate(2013, 4, 5);
swapNode = new SwapNode(Tenor.ONE_MONTH, Tenor.TEN_YEARS, FIXED_LEG_ID, OIS_ID, "Mapper");
definition = swapNode.accept(converter);
assertTrue(definition instanceof SwapDefinition);
fixedLeg = AnnuityCouponFixedDefinition.from(Currency.USD, settlementDate, Period.ofYears(10), Period.ofMonths(6), CALENDAR, ACT_360,
MODIFIED_FOLLOWING, false, 1, rate, true);
floatLeg = AnnuityCouponONSimplifiedDefinition.from(settlementDate, Period.ofYears(10), 1, false, index, 1,
CALENDAR, MODIFIED_FOLLOWING, Period.ofYears(1), false);
assertEquals(new SwapDefinition(fixedLeg, floatLeg), definition);
}