diff options
Diffstat (limited to 'guava-tests/test/com/google/common/math/BigDecimalMathTest.java')
-rw-r--r-- | guava-tests/test/com/google/common/math/BigDecimalMathTest.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/guava-tests/test/com/google/common/math/BigDecimalMathTest.java b/guava-tests/test/com/google/common/math/BigDecimalMathTest.java index ff86fd52f..b200a3840 100644 --- a/guava-tests/test/com/google/common/math/BigDecimalMathTest.java +++ b/guava-tests/test/com/google/common/math/BigDecimalMathTest.java @@ -25,6 +25,7 @@ import static java.math.RoundingMode.HALF_UP; import static java.math.RoundingMode.UNNECESSARY; import static java.math.RoundingMode.UP; import static java.math.RoundingMode.values; +import static org.junit.Assert.assertThrows; import com.google.common.annotations.GwtIncompatible; import java.math.BigDecimal; @@ -76,12 +77,10 @@ public class BigDecimalMathTest extends TestCase { assertWithMessage("Expected roundUnnecessaryShouldThrow call") .that(unnecessaryShouldThrow) .isTrue(); - try { - BigDecimalMath.roundToDouble(input, UNNECESSARY); - fail("Expected ArithmeticException for roundToDouble(" + input + ", UNNECESSARY)"); - } catch (ArithmeticException expected) { - // expected - } + assertThrows( + "Expected ArithmeticException for roundToDouble(" + input + ", UNNECESSARY)", + ArithmeticException.class, + () -> BigDecimalMath.roundToDouble(input, UNNECESSARY)); } } } |