Skip to content

Commit db1ea20

Browse files
devondragonclaude
andcommitted
test: fix password similarity test case
- Correct validate() method call to include both password and username parameters - Previously passing null for username prevented similarity check from executing - Now properly tests password-to-username similarity validation This ensures the similarity check test actually validates the intended behavior. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e1fa3c2 commit db1ea20

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/test/java/com/digitalsanctuary/spring/user/service/PasswordPolicyServiceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ void validate_rejectsWhenSimilarityAboveThreshold() {
255255
.thenReturn("password.error.similarity");
256256

257257
// Identical strings => 100% similarity >= 80 -> fail
258-
List<String> errors = service.validate(null, "password", null, LOCALE);
258+
List<String> errors = service.validate(null, "password", "password", LOCALE);
259259

260260
assertEquals(1, errors.size());
261261
assertEquals("password.error.similarity", errors.get(0));

0 commit comments

Comments
 (0)