]> source.dussan.org Git - sonarqube.git/commitdiff
Delete unused class IssueAuthorizationDto
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Mon, 1 Dec 2014 11:27:40 +0000 (12:27 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Mon, 1 Dec 2014 12:21:24 +0000 (13:21 +0100)
sonar-core/src/main/java/org/sonar/core/issue/db/IssueAuthorizationDto.java [deleted file]
sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java
sonar-core/src/test/java/org/sonar/core/issue/db/IssueAuthorizationDtoTest.java [deleted file]

diff --git a/sonar-core/src/main/java/org/sonar/core/issue/db/IssueAuthorizationDto.java b/sonar-core/src/main/java/org/sonar/core/issue/db/IssueAuthorizationDto.java
deleted file mode 100644 (file)
index e4d1989..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube 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.
- *
- * SonarQube 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.core.issue.db;
-
-import org.sonar.core.persistence.Dto;
-
-import java.io.Serializable;
-import java.util.List;
-
-import static com.google.common.collect.Lists.newArrayList;
-
-public final class IssueAuthorizationDto extends Dto<String> implements Serializable {
-
-  private String projectUuid;
-  private List<String> groups = newArrayList();
-  private List<String> users = newArrayList();
-
-  @Override
-  public String getKey() {
-    return projectUuid;
-  }
-
-  public String getProjectUuid() {
-    return projectUuid;
-  }
-
-  public IssueAuthorizationDto setProjectUuid(String projectUuid) {
-    this.projectUuid = projectUuid;
-    return this;
-  }
-
-  public List<String> getGroups() {
-    return groups;
-  }
-
-  public IssueAuthorizationDto setGroups(List<String> groups) {
-    this.groups = groups;
-    return this;
-  }
-
-  public IssueAuthorizationDto addGroup(String group) {
-    groups.add(group);
-    return this;
-  }
-
-  public List<String> getUsers() {
-    return users;
-  }
-
-  public IssueAuthorizationDto setUsers(List<String> users) {
-    this.users = users;
-    return this;
-  }
-
-  public IssueAuthorizationDto addUser(String user) {
-    users.add(user);
-    return this;
-  }
-
-}
index 51da304c1571c6158428e235905403bceb21e002..410afd9297054ed5f1c39d8e67cffdc826a9299c 100644 (file)
@@ -65,7 +65,6 @@ import org.sonar.core.issue.db.ActionPlanDto;
 import org.sonar.core.issue.db.ActionPlanMapper;
 import org.sonar.core.issue.db.ActionPlanStatsDto;
 import org.sonar.core.issue.db.ActionPlanStatsMapper;
-import org.sonar.core.issue.db.IssueAuthorizationDto;
 import org.sonar.core.issue.db.IssueChangeDto;
 import org.sonar.core.issue.db.IssueChangeMapper;
 import org.sonar.core.issue.db.IssueDto;
@@ -201,7 +200,6 @@ public class MyBatis implements BatchComponent, ServerComponent {
     loadAlias(conf, "Measure", MeasureDto.class);
     loadAlias(conf, "Metric", MetricDto.class);
     loadAlias(conf, "Issue", IssueDto.class);
-    loadAlias(conf, "IssueAuthorization", IssueAuthorizationDto.class);
     loadAlias(conf, "IssueChange", IssueChangeDto.class);
     loadAlias(conf, "IssueFilter", IssueFilterDto.class);
     loadAlias(conf, "IssueFilterFavourite", IssueFilterFavouriteDto.class);
diff --git a/sonar-core/src/test/java/org/sonar/core/issue/db/IssueAuthorizationDtoTest.java b/sonar-core/src/test/java/org/sonar/core/issue/db/IssueAuthorizationDtoTest.java
deleted file mode 100644 (file)
index 9c83be9..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube 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.
- *
- * SonarQube 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.core.issue.db;
-
-import org.junit.Test;
-
-import static com.google.common.collect.Lists.newArrayList;
-import static org.fest.assertions.Assertions.assertThat;
-
-public class IssueAuthorizationDtoTest {
-
-  @Test
-  public void getter_and_setter() throws Exception {
-    IssueAuthorizationDto dto = new IssueAuthorizationDto()
-      .setProjectUuid("Sample")
-      .setGroups(newArrayList("sonar-users"))
-      .setUsers(newArrayList("john"));
-
-    assertThat(dto.getKey()).isEqualTo("Sample");
-    assertThat(dto.getProjectUuid()).isEqualTo("Sample");
-    assertThat(dto.getGroups()).containsExactly("sonar-users");
-    assertThat(dto.getUsers()).containsExactly("john");
-  }
-
-  @Test
-  public void add_group() throws Exception {
-    IssueAuthorizationDto dto = new IssueAuthorizationDto()
-      .setProjectUuid("Sample")
-      .setGroups(newArrayList("sonar-users"))
-      .setUsers(newArrayList("john"));
-
-    assertThat(dto.getGroups()).containsExactly("sonar-users");
-
-    dto.addGroup("sonar-admins");
-
-    assertThat(dto.getGroups()).containsExactly("sonar-users", "sonar-admins");
-  }
-
-  @Test
-  public void add_user() throws Exception {
-    IssueAuthorizationDto dto = new IssueAuthorizationDto()
-      .setProjectUuid("Sample")
-      .setGroups(newArrayList("sonar-users"))
-      .setUsers(newArrayList("john"));
-
-    assertThat(dto.getUsers()).containsExactly("john");
-
-    dto.addUser("doe");
-
-    assertThat(dto.getUsers()).containsExactly("john", "doe");
-  }
-}