private static double checkedFixing( LocalDate currentFixingTs, LocalDateDoubleTimeSeries indexFixingDateSeries, OvernightIndex index) { OptionalDouble fixedRate = indexFixingDateSeries.get(currentFixingTs); return fixedRate.orElseThrow(() -> new PricingException( "Could not get fixing value of index " + index.getName() + " for date " + currentFixingTs)); } }
private static double checkedFixing( LocalDate currentFixingTs, LocalDateDoubleTimeSeries indexFixingDateSeries, OvernightIndex index) { OptionalDouble fixedRate = indexFixingDateSeries.get(currentFixingTs); return fixedRate.orElseThrow(() -> new PricingException( "Could not get fixing value of index " + index.getName() + " for date " + currentFixingTs)); }
private static double checkedFixing( LocalDate currentFixingTs, LocalDateDoubleTimeSeries indexFixingDateSeries, OvernightIndex index) { OptionalDouble fixedRate = indexFixingDateSeries.get(currentFixingTs); return fixedRate.orElseThrow(() -> new PricingException( "Could not get fixing value of index " + index.getName() + " for date " + currentFixingTs)); } }
public void test_constructor_message() { PricingException test = new PricingException("Hello"); assertEquals(test.getMessage(), "Hello"); }
public void test_constructor_messageCause() { IllegalArgumentException cause = new IllegalArgumentException("Under"); PricingException test = new PricingException("Hello", cause); assertEquals(test.getMessage(), "Hello"); assertEquals(test.getCause(), cause); }