aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db/src/test/java
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2016-01-27 17:11:54 +0100
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2016-01-28 16:02:49 +0100
commitb4bd77bb0d4307e65cd8b6fa13364205e675316f (patch)
treeebdcf1f4055b4a76673ff10915fc2f6652407a1f /sonar-db/src/test/java
parent9b79004bd2f01f07fe07009002275a857f32a8b9 (diff)
downloadsonarqube-b4bd77bb0d4307e65cd8b6fa13364205e675316f.tar.gz
sonarqube-b4bd77bb0d4307e65cd8b6fa13364205e675316f.zip
SONAR-7250 WS users/current - add details
Diffstat (limited to 'sonar-db/src/test/java')
-rw-r--r--sonar-db/src/test/java/org/sonar/db/user/GroupDbTester.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/sonar-db/src/test/java/org/sonar/db/user/GroupDbTester.java b/sonar-db/src/test/java/org/sonar/db/user/GroupDbTester.java
new file mode 100644
index 00000000000..3ded0c4175a
--- /dev/null
+++ b/sonar-db/src/test/java/org/sonar/db/user/GroupDbTester.java
@@ -0,0 +1,44 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+package org.sonar.db.user;
+
+import org.sonar.db.DbClient;
+import org.sonar.db.DbSession;
+import org.sonar.db.DbTester;
+
+public class GroupDbTester {
+ private final DbTester db;
+ private final DbClient dbClient;
+ private final DbSession dbSession;
+
+ public GroupDbTester(DbTester db) {
+ this.db = db;
+ this.dbClient = db.getDbClient();
+ this.dbSession = db.getSession();
+ }
+
+ public GroupDto insertGroup(GroupDto groupDto) {
+ GroupDto updatedGroup = dbClient.groupDao().insert(dbSession, groupDto);
+ db.commit();
+
+ return updatedGroup;
+ }
+}