[BAEL-18364] move spring-rest-*** articles - 1

This commit is contained in:
Sjmillington
2019-10-17 17:17:31 +01:00
parent db85c8f275
commit f1673ce653
20415 changed files with 1639515 additions and 0 deletions
@@ -0,0 +1,25 @@
package com.baeldung.maths;
import org.junit.Assert;
import org.junit.Test;
import java.math.BigDecimal;
import java.math.RoundingMode;
public class BigDecimalImplUnitTest {
@Test
public void givenBigDecimalNumbers_whenAddedTogether_thenGetExpectedResult() {
BigDecimal serviceTax = new BigDecimal("56.0084578639");
serviceTax = serviceTax.setScale(2, RoundingMode.CEILING);
BigDecimal entertainmentTax = new BigDecimal("23.00689");
entertainmentTax = entertainmentTax.setScale(2, RoundingMode.FLOOR);
BigDecimal totalTax = serviceTax.add(entertainmentTax);
BigDecimal result = BigDecimal.valueOf(79.01);
Assert.assertEquals(result, totalTax);
}
}