Skip to content

add a test to validate important scenarios.#462

Open
qibinhang wants to merge 1 commit into
lets-blade:v2.1.3from
qibinhang:v2.1.3
Open

add a test to validate important scenarios.#462
qibinhang wants to merge 1 commit into
lets-blade:v2.1.3from
qibinhang:v2.1.3

Conversation

@qibinhang

Copy link
Copy Markdown

I noticed that the checkpw method in com.hellokaton.blade.kit.BCrypt is not fully tested. Specifically, the current test suite does not cover the branch if (hashed_bytes.length != try_bytes.length), which handles scenarios where the stored password hashes may be corrupted. These scenarios are important to consider, as real-world issues—often introduced during database migrations or system updates—can lead to such inconsistencies.

To address this gap, I’ve added a test that explicitly validates this scenario. I hope it proves helpful in detecting potential regressions.

If additional test coverage would be valuable, I’d be happy to contribute further by looking into other classes you consider important for a follow-up PR.

@Shensijia

Shensijia commented Jul 28, 2025 via email

Copy link
Copy Markdown

@qibinhang

Copy link
Copy Markdown
Author

您好,请问这个测试用例是否有用,特别是检测潜在的回归问题?

@Shensijia

Shensijia commented Sep 1, 2025 via email

Copy link
Copy Markdown

@weeklynote

weeklynote commented Sep 1, 2025 via email

Copy link
Copy Markdown

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.

3 participants