BAEL-1217 fixed failing tests
This commit is contained in:
parent
9fee77a9d9
commit
729c392019
|
@ -32,8 +32,7 @@ public class GenericBigDecimalConverter implements GenericConverter {
|
|||
} else {
|
||||
Number number = (Number) source;
|
||||
BigDecimal converted = new BigDecimal(number.doubleValue());
|
||||
converted.setScale(2, BigDecimal.ROUND_HALF_EVEN);
|
||||
return converted;
|
||||
return converted.setScale(2, BigDecimal.ROUND_HALF_EVEN);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ public class CustomConverterTest {
|
|||
@Test
|
||||
public void whenConvertingToBigDecimalUsingGenericConverter_thenSuccess() {
|
||||
assertThat(conversionService.convert(Integer.valueOf(11), BigDecimal.class)).
|
||||
isEqualTo(BigDecimal.valueOf(11));
|
||||
isEqualTo(BigDecimal.valueOf(11.00).setScale(2, BigDecimal.ROUND_HALF_EVEN));
|
||||
assertThat(conversionService.convert(Double.valueOf(25.23), BigDecimal.class))
|
||||
.isEqualByComparingTo(BigDecimal.valueOf(Double.valueOf(25.23)));
|
||||
assertThat(conversionService.convert("2.32", BigDecimal.class))
|
||||
|
|
Loading…
Reference in New Issue