Skip to content

Add locale handling to Money.getCurrentCurrency test#48

Merged
marioserrano09 merged 1 commit intomainfrom
26.2.x
Feb 12, 2026
Merged

Add locale handling to Money.getCurrentCurrency test#48
marioserrano09 merged 1 commit intomainfrom
26.2.x

Conversation

@marioserrano09
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings February 12, 2026 14:42
@marioserrano09 marioserrano09 merged commit bbfbb6c into main Feb 12, 2026
2 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the finances API unit test suite to make Money.getCurrentCurrency() deterministic by controlling the JVM default Locale during the test.

Changes:

  • Added Locale import to the MoneyTest test class.
  • Updated testGetCurrentCurrency to temporarily set the default locale to Locale.US, assert "USD", and restore the original locale in a finally block.

Comment on lines +241 to +246
Locale originalLocale = java.util.Locale.getDefault();

try {
// Set a locale with a valid country code for testing
java.util.Locale.setDefault(java.util.Locale.US);

Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Locale is already imported, but the test still uses fully-qualified java.util.Locale calls. Use Locale.getDefault() / Locale.setDefault(Locale.US) consistently here to reduce noise and keep the style aligned with the rest of the codebase.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants