Skip to content

fix: standardize charset encoding in test fixtures#313

Merged
chilingling merged 1 commit into
opentiny:developfrom
msslulu:fix/unzip_codecheck
May 29, 2026
Merged

fix: standardize charset encoding in test fixtures#313
chilingling merged 1 commit into
opentiny:developfrom
msslulu:fix/unzip_codecheck

Conversation

@msslulu
Copy link
Copy Markdown
Contributor

@msslulu msslulu commented May 29, 2026

English | 简体中文

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Built its own designer, fully self-validated

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

Background and solution

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • Tests
    • Updated test utilities to use explicit UTF-8 encoding for improved reliability across different system configurations.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Walkthrough

This PR updates four test fixture byte-encoding calls in UtilsTest.java to explicitly use StandardCharsets.UTF_8 instead of platform default charset. Changes affect readAllBytes, multipart file conversion, and unzip test methods with no modifications to test logic or assertions.

Changes

UTF-8 Test Fixture Encoding

Layer / File(s) Summary
Standardize UTF-8 charset in test fixtures
base/src/test/java/com/tinyengine/it/common/utils/UtilsTest.java
Four test methods—testReadAllBytes_Normal, test_readAllBytes_Normal, testConvertMultipartFileToFile_Success, and testUnzip_InvalidZipFile—now encode byte fixtures with explicit StandardCharsets.UTF_8 instead of platform default charset.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

Suggested reviewers

  • hexqi
  • chilingling

Poem

🐰 Four bytes now speak UTF-8 true,
No platform defaults in the test queue,
Standardized fixtures, clear and clean,
The most consistent tests you've seen! 🎯

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: standardize charset encoding in test fixtures' accurately and specifically describes the main change: updating byte encoding to use StandardCharsets.UTF_8 in test fixtures.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@msslulu msslulu changed the title fix: codecheck fix: standardize charset encoding in test fixtures May 29, 2026
@chilingling chilingling merged commit e24a8eb into opentiny:develop May 29, 2026
1 check passed
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