public void test_builder() { FutureValueNotional test1 = FutureValueNotional.builder() .value(VALUE) .valueDate(VAL_DATE) .dayCountDays(NUM_DAYS) .build(); assertEquals(test1.getValue(), OptionalDouble.of(VALUE)); assertEquals(test1.getDayCountDays(), OptionalInt.of(NUM_DAYS)); assertEquals(test1.getValueDate(), Optional.of(VAL_DATE)); FutureValueNotional test2 = FutureValueNotional.builder() .value(VALUE) .build(); assertEquals(test2.getValue(), OptionalDouble.of(VALUE)); assertEquals(test2.getDayCountDays(), OptionalInt.empty()); assertEquals(test2.getValueDate(), Optional.empty()); }
calcEl.findChild("futureValueNotional").ifPresent(fvnEl -> { FutureValueNotional notional = FutureValueNotional.builder() .value(document.parseDecimal(fvnEl.getChild("amount"))) .dayCountDays(fvnEl.findChild("calculationPeriodNumberOfDays") .map(str -> (int) document.parseDecimal(str))
public void coverage() { FutureValueNotional futureValueNotionalOne = FutureValueNotional.builder() .value(1001d) .dayCountDays(30) .valueDate(LocalDate.of(2016, 6, 6)) .build(); coverImmutableBean(futureValueNotionalOne); FutureValueNotional futureValueNotionalTwo = FutureValueNotional.builder() .value(2001d) .dayCountDays(60) .valueDate(LocalDate.of(2017, 6, 6)) .build(); coverBeanEquals(futureValueNotionalOne, futureValueNotionalTwo); }