Skip to content

Commit

Permalink
Confirm passwords are diff
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Crawford <[email protected]>
  • Loading branch information
stephen-crawford committed Aug 3, 2023
1 parent bc07dd4 commit a12f2fc
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertNotEquals;
import static org.opensearch.security.OpenSearchSecurityPlugin.PLUGINS_PREFIX;
import static org.opensearch.security.dlic.rest.api.InternalUsersApiAction.RESTRICTED_FROM_USERNAME;
import static org.opensearch.security.support.ConfigConstants.SECURITY_RESTAPI_ADMIN_ENABLED;
Expand Down Expand Up @@ -1030,6 +1031,10 @@ public void testGeneratedPasswordContents() {

org.passay.PasswordValidator validator = new org.passay.PasswordValidator(lengthRule, characteristicsRule);
validator.validate(data);
}

String password2 = UserService.generatePassword();
PasswordData data2 = new PasswordData(password2);
assertNotEquals(password, password2);
assertNotEquals(data, data2);
}
}

0 comments on commit a12f2fc

Please sign in to comment.