Skip to content

Commit 68dd27a

Browse files
author
Reşat SABIQ
committed
Minor simplification in initial users loop.
1 parent fed7e2b commit 68dd27a

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/test/java/com/arangodb/ArangoDBTest.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -194,21 +194,19 @@ public void getUsersOnlyRoot() {
194194
@Test
195195
public void getUsers() {
196196
try {
197-
// Allow & account for pre-existing users other than ROOT
197+
// Allow & account for pre-existing users other than ROOT:
198198
final Collection<UserEntity> initialUsers = arangoDB.getUsers();
199+
199200
arangoDB.createUser(USER, PW, null);
200201
final Collection<UserEntity> users = arangoDB.getUsers();
201202
assertThat(users, is(notNullValue()));
202203
assertThat(users.size(), is(initialUsers.size()+1));
203204

204205
List<Matcher<? super String>> matchers = new ArrayList<Matcher<? super String>>(users.size());
205-
// Add initial users, including root
206-
for (UserEntity userEntity : initialUsers) {
207-
Matcher<String> matcher = is(userEntity.getUser());
208-
if (!matchers.contains(matcher))
209-
matchers.add(matcher);
210-
}
211-
// Add USER
206+
// Add initial users, including root:
207+
for (final UserEntity userEntity : initialUsers)
208+
matchers.add(is(userEntity.getUser()));
209+
// Add USER:
212210
matchers.add(is(USER));
213211

214212
for (final UserEntity user : users) {

0 commit comments

Comments
 (0)