Skip to content

Commit

Permalink
Remove deprecations (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
jodastephen committed Aug 25, 2024
1 parent ef1d3af commit 9807e37
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/test/java/org/joda/money/TestCurrencyUnit.java
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ void test_factory_of_Locale_nullLocale() {
@Test
void test_factory_of_Locale_unknownCurrency() {
assertThatExceptionOfType(IllegalCurrencyException.class)
.isThrownBy(() -> CurrencyUnit.of(new Locale("en", "XY")))
.isThrownBy(() -> CurrencyUnit.of(Locale.of("en", "XY")))
.withMessage("No currency found for locale 'en_XY'");
}

Expand Down
6 changes: 3 additions & 3 deletions src/test/java/org/joda/money/format/TestMoneyAmountStyle.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
class TestMoneyAmountStyle {

private static final Locale cCachedLocale = Locale.getDefault();
private static final Locale TEST_GB_LOCALE = new Locale("en", "GB", "TEST");
private static final Locale TEST_DE_LOCALE = new Locale("de", "DE", "TEST");
private static final Locale TEST_LV_LOCALE = new Locale("lv", "LV", "TEST");
private static final Locale TEST_GB_LOCALE = Locale.of("en", "GB", "TEST");
private static final Locale TEST_DE_LOCALE = Locale.of("de", "DE", "TEST");
private static final Locale TEST_LV_LOCALE = Locale.of("lv", "LV", "TEST");
private static final BigMoney MONEY = BigMoney.of(CurrencyUnit.GBP, new BigDecimal("87654321.12345678"));

@BeforeEach
Expand Down
9 changes: 4 additions & 5 deletions src/test/java/org/joda/money/format/TestMoneyFormatter.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
class TestMoneyFormatter {

private static final Locale cCachedLocale = Locale.getDefault();
private static final Locale TEST_GB_LOCALE = new Locale("en", "GB", "TEST");
private static final Locale TEST_FR_LOCALE = new Locale("fr", "FR", "TEST");
private static final Locale TEST_GB_LOCALE = Locale.of("en", "GB", "TEST");
private static final Locale TEST_FR_LOCALE = Locale.of("fr", "FR", "TEST");
private static final Money MONEY_GBP_12_34 = Money.parse("GBP 12.34");
private MoneyFormatter iPrintTest;
private MoneyFormatter iCannotPrint;
Expand Down Expand Up @@ -236,10 +236,9 @@ void test_parseBigMoney_CharSequence_incomplete() {

@Test
void test_parseBigMoney_CharSequence_incompleteLongText() {
var str = "12.34 GBP ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB";
assertThatExceptionOfType(MoneyFormatException.class)
.isThrownBy(
() -> iParseTest
.parseBigMoney("12.34 GBP ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB"));
.isThrownBy(() -> iParseTest.parseBigMoney(str));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class TestMoneyFormatterBuilder {
private static final Money JPY_2345 = Money.parse("JPY 2345");

private static final Locale cCachedLocale = Locale.getDefault();
private static final Locale TEST_GB_LOCALE = new Locale("en", "GB", "TEST");
private static final Locale TEST_FR_LOCALE = new Locale("fr", "FR", "TEST");
private static final Locale TEST_GB_LOCALE = Locale.of("en", "GB", "TEST");
private static final Locale TEST_FR_LOCALE = Locale.of("fr", "FR", "TEST");
private static final DecimalFormatSymbols FR_SYMBOLS = new DecimalFormatSymbols(Locale.FRANCE);
private static final char FR_DECIMAL = FR_SYMBOLS.getMonetaryDecimalSeparator();
private static final char FR_GROUP = FR_SYMBOLS.getGroupingSeparator();
Expand Down

0 comments on commit 9807e37

Please sign in to comment.