static Swaption sut2() { return Swaption.builder() .expiryDate(AdjustableDate.of(LocalDate.of(2014, 6, 10), ADJUSTMENT)) .expiryTime(LocalTime.of(14, 0)) .expiryZone(ZoneId.of("GMT")) .longShort(SHORT) .swaptionSettlement(CASH_SETTLE) .underlying(FixedIborSwapConventions.USD_FIXED_6M_LIBOR_3M .createTrade(LocalDate.of(2014, 6, 10), Tenor.TENOR_10Y, BuySell.BUY, 1d, FIXED_RATE, REF_DATA).getProduct()) .build(); }
public void test_builder_expiryAfterStart() { assertThrowsIllegalArg(() -> Swaption.builder() .expiryDate(AdjustableDate.of(LocalDate.of(2014, 6, 17), ADJUSTMENT)) .expiryTime(EXPIRY_TIME) .expiryZone(ZONE) .longShort(LONG) .swaptionSettlement(PHYSICAL_SETTLE) .underlying(SWAP) .build()); }
ZoneId expiryZone = ZoneId.of("Europe/Brussels"); Swaption swaptionExpected = Swaption.builder() .expiryDate(expiryDate) .expiryZone(expiryZone) .expiryTime(expiryTime)
.expiryDate(expiryDate) .expiryZone(expiryZone) .expiryTime(expiryTime)
public void test_physicalSettlement() { Swaption swaption = Swaption.builder() .swaptionSettlement(PhysicalSwaptionSettlement.DEFAULT) .expiryDate(AdjustableDate.of(SWAPTION_EXERCISE_DATE)) .expiryTime(SWAPTION_EXPIRY_TIME) .expiryZone(SWAPTION_EXPIRY_ZONE) .longShort(LongShort.LONG) .underlying(SWAP_REC) .build(); assertThrowsIllegalArg(() -> PRICER_SWAPTION.presentValue(swaption.resolve(REF_DATA), RATE_PROVIDER, VOLS)); }
static Swaption sut() { return Swaption.builder() .expiryDate(ADJUSTABLE_EXPIRY_DATE) .expiryTime(EXPIRY_TIME) .expiryZone(ZONE) .longShort(LONG) .swaptionSettlement(PHYSICAL_SETTLE) .underlying(SWAP) .build(); }
public void test_builder_invalidSwapOis() { assertThrowsIllegalArg(() -> Swaption.builder() .expiryDate(ADJUSTABLE_EXPIRY_DATE) .expiryTime(EXPIRY_TIME) .expiryZone(ZONE) .longShort(LONG) .swaptionSettlement(PHYSICAL_SETTLE) .underlying(SWAP_OIS) .build()); }
public void test_physicalSettlement() { Swaption swaption = Swaption .builder() .expiryDate(AdjustableDate.of(MATURITY, BDA_MF)) .expiryTime(LocalTime.NOON) .expiryZone(ZoneOffset.UTC) .swaptionSettlement(PhysicalSwaptionSettlement.DEFAULT) .longShort(LONG) .underlying(SWAP_PAY) .build(); assertThrowsIllegalArg(() -> PRICER.impliedVolatility(swaption.resolve(REF_DATA), RATE_PROVIDER, VOLS)); }
public void test_builder_invalidSwapXCcy() { assertThrowsIllegalArg(() -> Swaption.builder() .expiryDate(ADJUSTABLE_EXPIRY_DATE) .expiryTime(EXPIRY_TIME) .expiryZone(ZONE) .longShort(LONG) .swaptionSettlement(PHYSICAL_SETTLE) .underlying(SWAP_XCCY) .build()); }
public void test_builder_invalidSwapBasis() { assertThrowsIllegalArg(() -> Swaption.builder() .expiryDate(ADJUSTABLE_EXPIRY_DATE) .expiryTime(EXPIRY_TIME) .expiryZone(ZONE) .longShort(LONG) .swaptionSettlement(PHYSICAL_SETTLE) .underlying(SWAP_BASIS) .build()); }