In order to avoid hackers compromising member accounts, your business owner has asked you to implement a password validation component that satisfies the acceptance criteria detailed below.
- The password should have at least one uppercase character
- The password should have at least one lowercase character
- The password should have at least one digit
- The password should have at least one special character
- The password should be at least 12 characters long
- The password should not have any whitespaces
If a user enters a non-compliant password, the component should return a message notifying the user of what is wrong with the given password. The returned message should be similar to the corresponding description in the acceptance criteria.
HINT:
- This is the complete list of ASCII Special Character - !"#$%&'()*+,-.:;<=>?@[/]^_`{|}~ and this can be represented by the following regular expression [^a-zA-Z0–9]
The solution to this requirement is comprehensively documented in a 2 part TDD Kata series
To run the build, simply type the following in command line:
mvn test
After the build has run, the test reports can be found in target/spock-reports. Use a browser to view the index.html file.