use of javax.money.convert.ConversionQuery in project jsr354-ri-bp by JavaMoney.
the class ECBHistoricRateProviderTest method shouldSetTimeInLocalDateTime.
@Test
public void shouldSetTimeInLocalDateTime() {
Calendar localDate = new GregorianCalendar(2014, Calendar.JANUARY, 9);
ConversionQuery conversionQuery = ConversionQueryBuilder.of().setTermCurrency(EURO).set(localDate).build();
CurrencyConversion currencyConversion = provider.getCurrencyConversion(conversionQuery);
assertNotNull(currencyConversion);
MonetaryAmount money = Money.of(BigDecimal.TEN, DOLLAR);
MonetaryAmount result = currencyConversion.apply(money);
assertEquals(result.getCurrency(), EURO);
assertTrue(result.getNumber().doubleValue() > 0);
}
Aggregations