This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
The following commit(s) were added to refs/heads/master by this push:
new c0ee70caf0 Fix unit test failure
c0ee70caf0 is described below
commit c0ee70caf0278c91eda25a6990c97edcd7626f05
Author: James Bognar <[email protected]>
AuthorDate: Tue Dec 30 11:18:36 2025 -0500
Fix unit test failure
---
.../java/org/apache/juneau/commons/lang/StringFormat_Test.java | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/commons/lang/StringFormat_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/commons/lang/StringFormat_Test.java
index a8edb818be..82eb80fdbc 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/commons/lang/StringFormat_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/commons/lang/StringFormat_Test.java
@@ -318,7 +318,14 @@ class StringFormat_Test extends TestBase {
// MessageFormat throws NullPointerException when locale is
null, but StringFormat handles it
// So we test StringFormat's behavior directly instead of
comparing with MessageFormat
// Use Locale.US to get dollar sign for currency formatting
- assertMixedFormat("Price: $19.99", "Price:
{0,number,currency}", Locale.US, 19.99);
+ // Note: Java 25 changed currency format from "$19.99" to "USD
19.99", so we check for both
+ var fmt = fs("Price: {0,number,currency}");
+ var result = stringify(()->fmt.format(Locale.US, 19.99));
+ assertTrue(result.contains("19.99"), "Result should contain
'19.99', but was: " + result);
+ assertTrue(result.contains("Price: "), "Result should contain
'Price: ', but was: " + result);
+ // Accept either old format ($19.99) or new format (USD 19.99)
for Java 25 compatibility
+ assertTrue(result.contains("$") || result.contains("USD"),
+ "Result should contain '$' or 'USD' for currency, but
was: " + result);
}
//====================================================================================================