You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a MonetaryAmount is instantiated with a scaled BigDecimal, then extracting the big decimal using Money#getNumber leads to a BigDecimal with unexpected scale (e.g. "-1").
java.lang.AssertionError:
Expected :1E+1
Actual :10.00
Background
Using Hibernate with the Jadira multi column user type (or any other Hibernate user type I guess) leads to creation of BigDecimal with a given scale. When on the other end the service returns e.g. BigDecimal - this leads to false service responses.
Workaround
Creating a new BigDecimal with the currencies scale solves the issue.
When a MonetaryAmount is instantiated with a scaled BigDecimal, then extracting the big decimal using
Money#getNumber
leads to a BigDecimal with unexpected scale (e.g. "-1").Example
... leads to the following test-failure ...
Background
Using Hibernate with the Jadira multi column user type (or any other Hibernate user type I guess) leads to creation of BigDecimal with a given scale. When on the other end the service returns e.g. BigDecimal - this leads to false service responses.
Workaround
Creating a new BigDecimal with the currencies scale solves the issue.
The text was updated successfully, but these errors were encountered: