Class PasswordValidationService
java.lang.Object
com.fiap.tech_challenge.parte1.ms_users.services.validation.PasswordValidationService
- All Implemented Interfaces:
PasswordValidator
Service responsible for validating password change requests.
It ensures that the old password matches and that the new password
is different from the old one.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
validate
(boolean oldPasswordMatches, boolean isSameAsOld) Validates the password change criteria.
-
Constructor Details
-
PasswordValidationService
public PasswordValidationService()
-
-
Method Details
-
validate
public void validate(boolean oldPasswordMatches, boolean isSameAsOld) Validates the password change criteria.- Specified by:
validate
in interfacePasswordValidator
- Parameters:
oldPasswordMatches
- boolean indicating if the old password provided matches the current passwordisSameAsOld
- boolean indicating if the new password is the same as the old password- Throws:
InvalidPasswordException
- if the old password does not match or if the new password is the same as the old one
-