Skip to content

Commit 6579446

Browse files
committed
1 parent 0a7207b commit 6579446

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

calc/src/test/java/org/javamoney/calc/common/FutureValueTest.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2013, Credit Suisse (Anatole Tresch), Werner Keil.
2+
* Copyright (c) 2012, 2014, Credit Suisse (Anatole Tresch), Werner Keil.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
55
* use this file except in compliance with the License. You may obtain a copy of
@@ -18,11 +18,9 @@
1818
import static org.junit.Assert.assertEquals;
1919

2020
import java.math.BigDecimal;
21-
import java.math.RoundingMode;
22-
23-
import javax.money.MonetaryContext;
2421
import javax.money.MonetaryOperator;
2522
import javax.money.MonetaryRoundings;
23+
import javax.money.RoundingContext;
2624

2725
import org.javamoney.moneta.Money;
2826
import org.junit.Ignore;
@@ -35,8 +33,8 @@ public class FutureValueTest {
3533
public void test() {
3634
FutureValue f = FutureValue.of();
3735
Money money = Money.of(100, "CHF");
38-
MonetaryOperator rounding = MonetaryRoundings
39-
.getRounding(new MonetaryContext.Builder().setPrecision(2)
36+
MonetaryOperator rounding = MonetaryRoundings.getRounding(
37+
new RoundingContext.Builder().setScale(2)
4038
//.setRoundingMode(RoundingMode.HALF_EVEN)
4139
.create());
4240
assertEquals(Money.of(BigDecimal.valueOf(95.24), "CHF"), f.calculate(money,new Rate(0.05), 1)

calc/src/test/java/org/javamoney/calc/common/PresentValueTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@
1212
import static org.junit.Assert.assertEquals;
1313

1414
import java.math.BigDecimal;
15-
import java.math.RoundingMode;
16-
17-
import javax.money.MonetaryContext;
1815
import javax.money.MonetaryOperator;
1916
import javax.money.MonetaryRoundings;
17+
import javax.money.RoundingContext;
2018

2119
import org.javamoney.moneta.Money;
2220
import org.junit.Test;
@@ -28,7 +26,7 @@ public void test() {
2826
PresentValue f = PresentValue.of();
2927
Money money = Money.of(100, "CHF");
3028
MonetaryOperator rounding = MonetaryRoundings
31-
.getRounding(new MonetaryContext.Builder().setMaxScale(2)
29+
.getRounding(new RoundingContext.Builder().setScale(2)
3230
//.setRoundingMode(RoundingMode.HALF_EVEN)
3331
.create());
3432
assertEquals(Money.of(BigDecimal.valueOf(95.24), "CHF"),

0 commit comments

Comments
 (0)