Require 6 char min for low strength passwords and add validator tests

This commit is contained in:
Tim
2025-07-01 14:04:36 +08:00
parent dafdb423a6
commit 369fcde28a
2 changed files with 47 additions and 1 deletions

View File

@@ -24,7 +24,14 @@ public class PasswordValidator {
checkHigh(password);
break;
default:
// LOW, nothing beyond non-empty
checkLow(password);
break;
}
}
private void checkLow(String password) {
if (password.length() < 6) {
throw new IllegalArgumentException("Password must be at least 6 characters long");
}
}