aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db/src/test
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2017-02-13 15:06:48 +0100
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2017-02-13 15:06:48 +0100
commit8820bf56ef9617140e4d7d2483584af7bb185779 (patch)
treec3e26b02aa2e6baf8dd5ac282c3f5b0dbf1788f5 /sonar-db/src/test
parentad57a55ea39e3c012edf6ea57db88c0b813f5ae9 (diff)
downloadsonarqube-8820bf56ef9617140e4d7d2483584af7bb185779.tar.gz
sonarqube-8820bf56ef9617140e4d7d2483584af7bb185779.zip
SONAR-8752 SONAR-8751 personal org name from username
and also populate description
Diffstat (limited to 'sonar-db/src/test')
-rw-r--r--sonar-db/src/test/java/org/sonar/db/user/UserDbTester.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/sonar-db/src/test/java/org/sonar/db/user/UserDbTester.java b/sonar-db/src/test/java/org/sonar/db/user/UserDbTester.java
index 10e539f2c80..6257ac9434a 100644
--- a/sonar-db/src/test/java/org/sonar/db/user/UserDbTester.java
+++ b/sonar-db/src/test/java/org/sonar/db/user/UserDbTester.java
@@ -22,6 +22,7 @@ package org.sonar.db.user;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
+import java.util.function.Consumer;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import org.sonar.core.permission.GlobalPermissions;
@@ -58,6 +59,12 @@ public class UserDbTester {
return insertUser(dto);
}
+ public UserDto insertUser(Consumer<UserDto> populateUserDto) {
+ UserDto dto = newUserDto().setActive(true);
+ populateUserDto.accept(dto);
+ return insertUser(dto);
+ }
+
public UserDto insertUser(UserDto userDto) {
UserDto updatedUser = dbClient.userDao().insert(db.getSession(), userDto);
db.commit();