From b4bd77bb0d4307e65cd8b6fa13364205e675316f Mon Sep 17 00:00:00 2001 From: Teryk Bellahsene Date: Wed, 27 Jan 2016 17:11:54 +0100 Subject: SONAR-7250 WS users/current - add details --- .../test/java/org/sonar/db/user/GroupDbTester.java | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 sonar-db/src/test/java/org/sonar/db/user/GroupDbTester.java (limited to 'sonar-db/src/test/java') 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; + } +} -- cgit v1.2.3