Skip to content

Commit

Permalink
[test] generate unique user names (#36179)
Browse files Browse the repository at this point in the history
  • Loading branch information
andyb-elastic committed Dec 3, 2018
1 parent 2658e34 commit 6c9cb72
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,9 @@ protected String getProtocol() {
private void setUpUsers() throws IOException {
int usersCount = name.getMethodName().startsWith("testSingle") ? 1 : randomIntBetween(5, 15);
users = new ArrayList<String>(usersCount);

for(int i = 0; i < usersCount; i++) {
String randomUserName = randomAlphaOfLengthBetween(1, 15);
users.add(randomUserName);
createUser(randomUserName, MINIMAL_ACCESS_ROLE);
users.addAll(randomUnique(() -> randomAlphaOfLengthBetween(1, 15), usersCount));
for (String user : users) {
createUser(user, MINIMAL_ACCESS_ROLE);
}
}

Expand Down

0 comments on commit 6c9cb72

Please sign in to comment.