import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.DateUtils;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class ActivityResultSetIteratorTest {
@Rule
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.config.Settings;
import org.sonar.api.platform.Server;
import org.sonar.server.issue.index.IssueIndexer;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import static com.google.common.collect.Lists.newArrayList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
-@Category(DbTests.class)
+
public class IssuesActionTest {
final static String PROJECT_KEY = "struts";
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.System2;
import org.sonar.db.DbSession;
import org.sonar.db.component.ComponentDbTester;
import org.sonar.db.component.ComponentDto;
import org.sonar.server.exceptions.NotFoundException;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.db.component.ComponentTesting.newProjectDto;
import static org.sonar.server.component.ComponentFinder.ParamNames.ID_AND_KEY;
-@Category(DbTests.class)
+
public class ComponentFinderTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.sonar.api.i18n.I18n;
import org.sonar.server.exceptions.ForbiddenException;
import org.sonar.server.exceptions.NotFoundException;
import org.sonar.server.tester.UserSessionRule;
-import org.sonar.test.DbTests;
import static com.google.common.collect.Lists.newArrayList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.when;
import static org.sonar.core.permission.GlobalPermissions.PROVISIONING;
-@Category(DbTests.class)
+
public class ComponentServiceTest {
System2 system2 = System2.INSTANCE;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.server.ws.WebService.Param;
import org.sonar.api.utils.System2;
import org.sonar.server.exceptions.NotFoundException;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import static org.mockito.Mockito.mock;
-@Category(DbTests.class)
+
public class SearchViewComponentsActionTest {
@Rule
import javax.annotation.Nullable;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.resources.Qualifiers;
import org.sonar.api.utils.System2;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.TestRequest;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.test.DbTests;
import org.sonarqube.ws.MediaTypes;
import org.sonarqube.ws.WsComponents.ShowWsResponse;
import static org.sonarqube.ws.client.component.ComponentsWsParameters.PARAM_ID;
import static org.sonarqube.ws.client.component.ComponentsWsParameters.PARAM_KEY;
-@Category(DbTests.class)
+
public class ShowActionTest {
@Rule
public ExpectedException expectedException = ExpectedException.none();
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.mockito.Mockito;
import org.sonar.api.i18n.I18n;
import org.sonar.server.exceptions.NotFoundException;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.test.DbTests;
import org.sonar.test.JsonAssert;
import org.sonarqube.ws.MediaTypes;
import org.sonarqube.ws.WsComponents;
import static org.sonarqube.ws.client.component.ComponentsWsParameters.PARAM_QUALIFIERS;
import static org.sonarqube.ws.client.component.ComponentsWsParameters.PARAM_STRATEGY;
-@Category(DbTests.class)
+
public class TreeActionTest {
@Rule
public ExpectedException expectedException = ExpectedException.none();
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.config.Settings;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
import org.sonar.db.component.ComponentDto;
+import org.sonar.db.component.ComponentTesting;
import org.sonar.db.property.PropertiesDao;
import org.sonar.db.property.PropertyDto;
-import org.sonar.db.component.ComponentTesting;
import org.sonar.server.properties.ProjectSettingsFactory;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.server.computation.component.Component.Type.PROJECT;
-@Category(DbTests.class)
+
public class SettingsRepositoryTest {
private static final Component ROOT = ReportComponent.builder(PROJECT, 1).setKey("ROOT").build();
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.sonar.api.rule.RuleKey;
import org.sonar.server.computation.metric.MetricImpl;
import org.sonar.server.computation.metric.MetricRepository;
import org.sonar.server.computation.metric.ReportMetricValidator;
-import org.sonar.test.DbTests;
import static com.google.common.collect.FluentIterable.from;
import static java.lang.String.format;
import static org.mockito.Mockito.when;
@RunWith(DataProviderRunner.class)
-@Category(DbTests.class)
+
public class MapBasedRawMeasureRepositoryTest {
@Rule
public DbTester dbTester = DbTester.create(System2.INSTANCE);
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class MetricRepositoryImplTest {
private static final String SOME_KEY = "some_key";
private static final long SOME_ID = 156;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.config.Settings;
import org.sonar.api.security.DefaultGroups;
import org.sonar.api.utils.System2;
import org.sonar.server.es.EsTester;
import org.sonar.server.issue.index.IssueAuthorizationIndexer;
import org.sonar.server.issue.index.IssueIndexDefinition;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.db.component.ComponentTesting.newView;
import static org.sonar.server.computation.component.Component.Type.PROJECT;
import static org.sonar.server.computation.component.Component.Type.VIEW;
-@Category(DbTests.class)
+
public class ApplyPermissionsStepTest extends BaseStepTest {
private static final String ROOT_KEY = "ROOT_KEY";
import javax.annotation.Nullable;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.sonar.api.utils.System2;
import org.sonar.batch.protocol.Constants;
import org.sonar.server.computation.batch.BatchReportReaderRule;
import org.sonar.server.computation.component.Component;
import org.sonar.server.computation.component.MutableTreeRootHolderRule;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.batch.protocol.Constants.ComponentType.DIRECTORY;
import static org.sonar.db.component.ComponentTesting.newProjectDto;
import static org.sonar.db.component.SnapshotTesting.newSnapshotForProject;
-@Category(DbTests.class)
+
@RunWith(DataProviderRunner.class)
public class BuildComponentTreeStepTest {
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.db.DbTester;
import org.sonar.server.computation.metric.Metric;
import org.sonar.server.computation.metric.MetricImpl;
import org.sonar.server.computation.metric.MetricRepositoryRule;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.guava.api.Assertions.assertThat;
import static org.sonar.server.computation.measure.MeasureRepoEntry.toEntries;
import static org.sonar.server.computation.step.CustomMeasuresCopyStep.dtoToMeasure;
-@Category(DbTests.class)
+
public class CustomMeasuresCopyStepTest {
static final int PROJECT_REF = 1;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.sonar.api.config.Settings;
import org.sonar.api.utils.System2;
import org.sonar.server.computation.component.ViewsComponent;
import org.sonar.server.computation.period.Period;
import org.sonar.server.computation.period.PeriodsHolderImpl;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.sonar.core.config.CorePropertyDefinitions.TIMEMACHINE_MODE_PREVIOUS_VERSION;
import static org.sonar.core.config.CorePropertyDefinitions.TIMEMACHINE_MODE_VERSION;
-@Category(DbTests.class)
+
@RunWith(DataProviderRunner.class)
public class LoadPeriodsStepTest extends BaseStepTest {
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
import org.sonar.server.computation.analysis.AnalysisMetadataHolderRule;
import org.sonar.server.computation.component.ReportComponent;
import org.sonar.server.computation.event.Event;
import org.sonar.server.computation.event.EventRepository;
-import org.sonar.test.DbTests;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-@Category(DbTests.class)
+
public class PersistEventsStepTest extends BaseStepTest {
System2 system2 = mock(System2.class);
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.System2;
import org.sonar.batch.protocol.Constants;
import org.sonar.server.computation.scm.Changeset;
import org.sonar.server.computation.scm.ScmInfoRepositoryRule;
import org.sonar.server.computation.source.SourceLinesRepositoryRule;
-import org.sonar.test.DbTests;
import static com.google.common.collect.Lists.newArrayList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-@Category(DbTests.class)
+
public class PersistFileSourcesStepTest extends BaseStepTest {
private static final int FILE_REF = 3;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.measures.Metric;
import org.sonar.api.utils.System2;
import org.sonar.core.util.Uuids;
import org.sonar.server.computation.measure.MeasureToMeasureDto;
import org.sonar.server.computation.metric.MetricRepositoryRule;
import org.sonar.server.computation.period.Period;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.api.measures.CoreMetrics.CLASS_COMPLEXITY_DISTRIBUTION;
import static org.sonar.server.computation.measure.Measure.newMeasureBuilder;
import static org.sonar.server.computation.measure.MeasureVariations.newMeasureVariationsBuilder;
-@Category(DbTests.class)
+
public class PersistMeasuresStepTest extends BaseStepTest {
private static final String STRING_METRIC_KEY = "string-metric-key";
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.i18n.I18n;
import org.sonar.api.utils.System2;
import org.sonar.batch.protocol.Constants;
import org.sonar.server.computation.component.Component;
import org.sonar.server.computation.component.ReportComponent;
import org.sonar.server.computation.component.VisitException;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.failBecauseExceptionWasNotThrown;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-@Category(DbTests.class)
+
public class PersistProjectLinksStepTest extends BaseStepTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
import org.sonar.server.computation.metric.MetricRepositoryRule;
import org.sonar.server.computation.period.Period;
import org.sonar.server.computation.period.PeriodsHolderRule;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.db.component.SnapshotTesting.createForComponent;
import static org.sonar.db.component.SnapshotTesting.newSnapshotForProject;
import static org.sonar.server.computation.measure.Measure.newMeasureBuilder;
-@Category(DbTests.class)
+
public class ReportComputeMeasureVariationsStepTest {
static final Metric ISSUES_METRIC = new MetricImpl(1, "violations", "violations", Metric.MetricType.INT);
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.DateUtils;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.server.computation.component.Component;
import org.sonar.server.computation.component.FileAttributes;
import org.sonar.server.computation.component.MutableDbIdsRepositoryRule;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.guava.api.Assertions.assertThat;
import static org.sonar.server.computation.component.Component.Type.PROJECT;
import static org.sonar.server.computation.component.ReportComponent.builder;
-@Category(DbTests.class)
+
public class ReportPersistComponentsStepTest extends BaseStepTest {
private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.DateUtils;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.server.computation.component.ReportComponent;
import org.sonar.server.computation.period.Period;
import org.sonar.server.computation.period.PeriodsHolderRule;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.sonar.core.config.CorePropertyDefinitions.TIMEMACHINE_MODE_DATE;
import static org.sonar.core.config.CorePropertyDefinitions.TIMEMACHINE_MODE_PREVIOUS_ANALYSIS;
-@Category(DbTests.class)
+
public class ReportPersistSnapshotsStepTest extends BaseStepTest {
private static final String PROJECT_KEY = "PROJECT_KEY";
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.DateUtils;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.server.computation.component.Component;
import org.sonar.server.computation.component.DbIdsRepositoryImpl;
import org.sonar.server.computation.component.ReportComponent;
-import org.sonar.test.DbTests;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-@Category(DbTests.class)
+
public class SwitchSnapshotStepTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.DateUtils;
import org.sonar.api.utils.MessageException;
import org.sonar.server.computation.batch.TreeRootHolderRule;
import org.sonar.server.computation.component.Component;
import org.sonar.server.computation.component.ReportComponent;
-import org.sonar.test.DbTests;
-@Category(DbTests.class)
+
public class ValidateProjectStepTest {
static long DEFAULT_ANALYSIS_TIME = 1433131200000L; // 2015-06-01
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
import org.sonar.server.computation.metric.MetricRepositoryRule;
import org.sonar.server.computation.period.Period;
import org.sonar.server.computation.period.PeriodsHolderRule;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.db.component.SnapshotTesting.createForComponent;
import static org.sonar.db.component.SnapshotTesting.newSnapshotForProject;
import static org.sonar.db.component.SnapshotTesting.newSnapshotForView;
-@Category(DbTests.class)
+
public class ViewsComputeMeasureVariationsStepTest {
static final Metric ISSUES_METRIC = new MetricImpl(1, "violations", "violations", Metric.MetricType.INT);
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.resources.Qualifiers;
import org.sonar.api.resources.Scopes;
import org.sonar.api.utils.System2;
import org.sonar.server.computation.component.MutableDbIdsRepositoryRule;
import org.sonar.server.computation.component.ProjectViewAttributes;
import org.sonar.server.computation.component.ViewsComponent;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.sonar.server.computation.component.Component.Type.VIEW;
import static org.sonar.server.computation.component.ViewsComponent.builder;
-@Category(DbTests.class)
+
public class ViewsPersistComponentsStepTest extends BaseStepTest {
private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.DateUtils;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.server.computation.component.ViewsComponent;
import org.sonar.server.computation.period.Period;
import org.sonar.server.computation.period.PeriodsHolderRule;
-import org.sonar.test.DbTests;
import static java.lang.String.valueOf;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.server.computation.component.Component.Type.VIEW;
import static org.sonar.server.computation.component.ComponentFunctions.toKey;
-@Category(DbTests.class)
+
public class ViewsPersistSnapshotsStepTest extends BaseStepTest {
private static final int PROJECT_KEY = 1;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.api.web.Dashboard;
import org.sonar.api.web.DashboardLayout;
import org.sonar.db.DbTester;
import org.sonar.db.issue.IssueFilterDao;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class ProjectCustomDashboardTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
import org.sonar.db.component.ComponentDao;
import org.sonar.db.component.ComponentDto;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.db.component.ComponentTesting.newFileDto;
import static org.sonar.db.component.ComponentTesting.newProjectDto;
-@Category(DbTests.class)
+
public class DuplicationsParserTest {
@Rule
import java.util.Collection;
import java.util.Date;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.rules.Rule;
import org.sonar.api.rules.RuleFinder;
import org.sonar.db.component.ComponentDto;
import org.sonar.db.issue.IssueDto;
import org.sonar.db.issue.IssueMapper;
-import org.sonar.test.DbTests;
-@Category(DbTests.class)
+
public class IssueStorageTest {
IssueChangeContext context = IssueChangeContext.createUser(new Date(), "emmerik");
import java.util.Date;
import org.junit.Before;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.rules.Rule;
import org.sonar.api.rules.RuleFinder;
import org.sonar.db.DbClient;
import org.sonar.db.DbTester;
import org.sonar.server.issue.index.IssueIndexer;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-@Category(DbTests.class)
+
public class ServerIssueStorageTest {
System2 system = mock(System2.class);
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.DateUtils;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
import org.sonar.db.issue.IssueFilterDao;
import org.sonar.db.loadedtemplate.LoadedTemplateDao;
-import org.sonar.test.DbTests;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-@Category(DbTests.class)
+
public class RegisterIssueFiltersTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.TestResponse;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.test.DbTests;
import static org.sonar.test.JsonAssert.assertJson;
-@Category(DbTests.class)
+
public class SearchActionTest {
static final String EMPTY_ISSUE_FILTERS_JSON = "{" +
" \"issueFilters\": []" +
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class IssueAuthorizationDaoTest {
@Rule
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.config.Settings;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.db.DbTester;
import org.sonar.server.es.EsTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class IssueAuthorizationIndexerTest {
@Rule
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.config.Settings;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.db.DbTester;
import org.sonar.server.es.EsTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class IssueIndexerTest {
@ClassRule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
-import org.sonarqube.ws.Issues;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class IssueResultSetIteratorTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.measures.CoreMetrics;
import org.sonar.api.measures.Metric;
import org.sonar.api.utils.DateUtils;
import org.sonar.db.DbTester;
import org.sonar.db.component.ResourceDao;
import org.sonar.db.component.SnapshotDto;
-import org.sonar.test.DbTests;
import static com.google.common.collect.Lists.newArrayList;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class MeasureFilterExecutorTest {
private static final long JAVA_PROJECT_ID = 1L;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.config.Settings;
import org.sonar.api.measures.Metric;
import org.sonar.server.user.index.UserIndexDefinition;
import org.sonar.server.user.ws.UserJsonWriter;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.data.Offset.offset;
import static org.sonar.api.measures.Metric.ValueType.WORK_DUR;
import static org.sonar.server.util.TypeValidationsTesting.newFullTypeValidations;
-@Category(DbTests.class)
+
public class CreateActionTest {
private static final String DEFAULT_PROJECT_UUID = "project-uuid";
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.System2;
import org.sonar.api.web.UserRole;
import org.sonar.server.exceptions.ForbiddenException;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.db.measure.custom.CustomMeasureTesting.newCustomMeasureDto;
import static org.sonar.server.measure.custom.ws.DeleteAction.PARAM_ID;
-@Category(DbTests.class)
+
public class DeleteActionTest {
public static final String ACTION = "delete";
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.config.Settings;
import org.sonar.api.measures.Metric;
import org.sonar.server.user.index.UserDoc;
import org.sonar.server.user.index.UserIndexDefinition;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.db.measure.custom.CustomMeasureTesting.newCustomMeasureDto;
import static org.sonar.server.measure.custom.ws.CustomMeasuresWs.ENDPOINT;
import static org.sonar.server.measure.custom.ws.MetricsAction.ACTION;
-@Category(DbTests.class)
+
public class MetricsActionTest {
private static final String DEFAULT_PROJECT_UUID = "project-uuid";
private static final String DEFAULT_PROJECT_KEY = "project-key";
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.config.Settings;
import org.sonar.api.measures.Metric.ValueType;
import org.sonar.server.user.index.UserIndexDefinition;
import org.sonar.server.user.ws.UserJsonWriter;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.data.Offset.offset;
import static org.sonar.server.measure.custom.ws.UpdateAction.PARAM_VALUE;
import static org.sonar.server.util.TypeValidationsTesting.newFullTypeValidations;
-@Category(DbTests.class)
+
public class UpdateActionTest {
@Rule
public ExpectedException expectedException = ExpectedException.none();
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.resources.Qualifiers;
import org.sonar.api.utils.System2;
import org.sonar.server.exceptions.NotFoundException;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.test.DbTests;
import org.sonarqube.ws.MediaTypes;
import org.sonarqube.ws.WsMeasures.ComponentWsResponse;
import static org.sonarqube.ws.client.measure.MeasuresWsParameters.PARAM_COMPONENT_ID;
import static org.sonarqube.ws.client.measure.MeasuresWsParameters.PARAM_METRIC_KEYS;
-@Category(DbTests.class)
+
public class ComponentActionTest {
private static final String PROJECT_UUID = "project-uuid";
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.measures.Metric.ValueType;
import org.sonar.api.resources.Qualifiers;
import org.sonar.server.ws.TestRequest;
import org.sonar.server.ws.TestResponse;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.test.DbTests;
import org.sonarqube.ws.Common;
import org.sonarqube.ws.MediaTypes;
import org.sonarqube.ws.WsMeasures;
import static org.sonarqube.ws.client.measure.MeasuresWsParameters.PARAM_QUALIFIERS;
import static org.sonarqube.ws.client.measure.MeasuresWsParameters.PARAM_STRATEGY;
-@Category(DbTests.class)
+
public class ComponentTreeActionTest {
@Rule
public UserSessionRule userSession = UserSessionRule.standalone();
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.db.DbTester;
import org.sonar.db.metric.MetricDao;
-import org.sonar.test.DbTests;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNull.nullValue;
import static org.junit.Assert.assertThat;
-@Category(DbTests.class)
+
public class DefaultMetricFinderTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.measures.Metric.ValueType;
import org.sonar.api.utils.System2;
import org.sonar.server.ruby.RubyBridge;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
import static org.sonar.server.metric.ws.CreateAction.PARAM_NAME;
import static org.sonar.server.metric.ws.CreateAction.PARAM_TYPE;
-@Category(DbTests.class)
+
public class CreateActionTest {
private static final String DEFAULT_KEY = "custom-metric-key";
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.System2;
import org.sonar.core.permission.GlobalPermissions;
import org.sonar.server.ruby.RubyBridge;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
import static org.mockito.Mockito.mock;
import static org.sonar.db.metric.MetricTesting.newMetricDto;
-@Category(DbTests.class)
+
public class DeleteActionTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
import org.sonar.db.metric.MetricDao;
import org.sonar.db.metric.MetricDto;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import org.sonar.test.JsonAssert;
import static org.sonar.db.metric.MetricTesting.newMetricDto;
-@Category(DbTests.class)
+
public class DomainsActionTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.server.ws.WebService.Param;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.db.DbTester;
import org.sonar.db.metric.MetricDto;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.db.metric.MetricTesting.newMetricDto;
import static org.sonar.server.metric.ws.SearchAction.PARAM_IS_CUSTOM;
-@Category(DbTests.class)
+
public class SearchActionTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.measures.Metric.ValueType;
import org.sonar.api.utils.System2;
import org.sonar.server.ruby.RubyBridge;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
import static org.sonar.server.metric.ws.UpdateAction.PARAM_NAME;
import static org.sonar.server.metric.ws.UpdateAction.PARAM_TYPE;
-@Category(DbTests.class)
+
public class UpdateActionTest {
private static final String DEFAULT_KEY = "custom-metric-key";
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.mockito.ArgumentCaptor;
import org.sonar.api.resources.Qualifiers;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.usergroups.ws.UserGroupFinder;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY;
-@Category(DbTests.class)
+
public class AddGroupActionTest {
UserSessionRule userSession = UserSessionRule.standalone();
WsTester ws;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.mockito.ArgumentCaptor;
import org.sonar.api.resources.Qualifiers;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.usergroups.ws.UserGroupFinder;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_USER_LOGIN;
-@Category(DbTests.class)
+
public class AddUserActionTest {
@Rule
public DbTester db = DbTester.create(System2.INSTANCE);
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.resources.Qualifiers;
import org.sonar.api.security.DefaultGroups;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.usergroups.ws.UserGroupFinder;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.api.server.ws.WebService.Param.SELECTED;
import static org.sonar.core.permission.GlobalPermissions.SYSTEM_ADMIN;
import static org.sonar.db.component.ComponentTesting.newProjectDto;
import static org.sonar.db.component.ComponentTesting.newView;
+import static org.sonar.test.JsonAssert.assertJson;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY;
-import static org.sonar.test.JsonAssert.assertJson;
-@Category(DbTests.class)
+
public class GroupsActionTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.mockito.ArgumentCaptor;
import org.sonar.api.resources.Qualifiers;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.usergroups.ws.UserGroupFinder;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY;
-@Category(DbTests.class)
+
public class RemoveGroupActionTest {
UserSessionRule userSession = UserSessionRule.standalone();
WsTester ws;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.mockito.ArgumentCaptor;
import org.sonar.api.resources.Qualifiers;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.usergroups.ws.UserGroupFinder;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_USER_LOGIN;
-@Category(DbTests.class)
+
public class RemoveUserActionTest {
@Rule
public DbTester db = DbTester.create(System2.INSTANCE);
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
import org.sonar.server.i18n.I18nRule;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.test.DbTests;
import org.sonarqube.ws.MediaTypes;
import org.sonarqube.ws.WsPermissions;
import static org.sonar.core.permission.GlobalPermissions.SYSTEM_ADMIN;
import static org.sonar.test.JsonAssert.assertJson;
-@Category(DbTests.class)
+
public class SearchGlobalPermissionsActionTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.resources.Qualifiers;
import org.sonar.api.utils.System2;
import org.sonar.server.usergroups.ws.UserGroupFinder;
import org.sonar.server.ws.TestResponse;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.test.DbTests;
import org.sonarqube.ws.MediaTypes;
import org.sonarqube.ws.WsPermissions.SearchProjectPermissionsWsResponse;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_QUALIFIER;
-@Category(DbTests.class)
+
public class SearchProjectPermissionsActionTest {
@Rule
public ExpectedException expectedException = ExpectedException.none();
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.resources.Qualifiers;
import org.sonar.api.server.ws.WebService.Param;
import org.sonar.server.exceptions.ForbiddenException;
import org.sonar.server.exceptions.NotFoundException;
import org.sonar.server.exceptions.UnauthorizedException;
-import org.sonarqube.ws.MediaTypes;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.usergroups.ws.UserGroupFinder;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.test.DbTests;
+import org.sonarqube.ws.MediaTypes;
import org.sonarqube.ws.WsPermissions.WsGroupsResponse;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.db.permission.PermissionTemplateTesting.newPermissionTemplateDto;
import static org.sonar.db.permission.PermissionTemplateTesting.newPermissionTemplateGroupDto;
import static org.sonar.db.user.GroupTesting.newGroupDto;
+import static org.sonar.test.JsonAssert.assertJson;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
-import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
-import static org.sonar.test.JsonAssert.assertJson;
+import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
+
-@Category(DbTests.class)
public class TemplateGroupsActionTest {
@Rule
public ExpectedException expectedException = ExpectedException.none();
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.resources.Qualifiers;
import org.sonar.api.server.ws.WebService;
import org.sonar.server.usergroups.ws.UserGroupFinder;
import org.sonar.server.ws.TestRequest;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.test.DbTests;
import org.sonarqube.ws.WsPermissions;
import org.sonarqube.ws.WsPermissions.UsersWsResponse;
import static org.sonarqube.ws.MediaTypes.PROTOBUF;
import static org.sonarqube.ws.WsPermissions.UsersWsResponse.parseFrom;
-@Category(DbTests.class)
+
public class TemplateUsersActionTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.resources.Qualifiers;
import org.sonar.api.server.ws.WebService.Param;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.usergroups.ws.UserGroupFinder;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.api.web.UserRole.ISSUE_ADMIN;
import static org.sonar.core.permission.GlobalPermissions.SYSTEM_ADMIN;
import static org.sonar.db.component.ComponentTesting.newProjectDto;
import static org.sonar.db.user.UserTesting.newUserDto;
+import static org.sonar.test.JsonAssert.assertJson;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PERMISSION;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_PROJECT_KEY;
-import static org.sonar.test.JsonAssert.assertJson;
-@Category(DbTests.class)
+
public class UsersActionTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.resources.Qualifiers;
import org.sonar.api.utils.System2;
import org.sonar.server.usergroups.ws.UserGroupFinder;
import org.sonar.server.ws.TestRequest;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.test.DbTests;
import static com.google.common.collect.FluentIterable.from;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
-@Category(DbTests.class)
+
public class AddGroupToTemplateActionTest {
private static final String GROUP_NAME = "group-name";
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.resources.Qualifiers;
import org.sonar.api.utils.System2;
import org.sonar.server.usergroups.ws.UserGroupFinder;
import org.sonar.server.ws.TestRequest;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.test.DbTests;
import static com.google.common.collect.FluentIterable.from;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_USER_LOGIN;
-@Category(DbTests.class)
+
public class AddUserToTemplateActionTest {
private static final String USER_LOGIN = "user-login";
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.config.Settings;
import org.sonar.api.resources.Qualifiers;
import org.sonar.server.ws.TestRequest;
import org.sonar.server.ws.TestResponse;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
-@Category(DbTests.class)
+
public class ApplyTemplateActionTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.resources.Qualifiers;
import org.sonar.api.utils.System2;
import org.sonar.server.usergroups.ws.UserGroupFinder;
import org.sonar.server.ws.TestRequest;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.test.DbTests;
import static com.google.common.collect.FluentIterable.from;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
-@Category(DbTests.class)
+
public class RemoveGroupFromTemplateActionTest {
private static final String GROUP_NAME = "group-name";
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.resources.Qualifiers;
import org.sonar.api.utils.System2;
import org.sonar.server.usergroups.ws.UserGroupFinder;
import org.sonar.server.ws.TestRequest;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.test.DbTests;
import static com.google.common.collect.FluentIterable.from;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_USER_LOGIN;
-@Category(DbTests.class)
+
public class RemoveUserFromTemplateActionTest {
private static final String USER_LOGIN = "user-login";
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.config.Settings;
import org.sonar.api.resources.Qualifiers;
import org.sonar.server.i18n.I18nRule;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.test.DbTests;
import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.server.permission.DefaultPermissionTemplates.defaultRootQualifierTemplateProperty;
import static org.sonar.test.JsonAssert.assertJson;
-@Category(DbTests.class)
+
public class SearchTemplatesActionTest {
@ClassRule
public static DbTester db = DbTester.create(System2.INSTANCE);
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.config.PropertyDefinitions;
import org.sonar.api.resources.Qualifiers;
import org.sonar.server.usergroups.ws.UserGroupFinder;
import org.sonar.server.ws.TestRequest;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.test.DbTests;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID;
import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_NAME;
-@Category(DbTests.class)
+
public class SetDefaultTemplateActionTest {
@Rule
public DbTester db = DbTester.create(System2.INSTANCE);
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.config.Settings;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
import org.sonar.server.search.IndexDefinition;
import org.sonar.server.view.index.ViewDoc;
import org.sonar.server.view.index.ViewIndexDefinition;
-import org.sonar.test.DbTests;
import static com.google.common.collect.Lists.newArrayList;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class BackendCleanupMediumTest {
@ClassRule
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.config.Settings;
import org.sonar.api.resources.Qualifiers;
import org.sonar.server.test.index.TestIndexer;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.anyString;
import static org.sonar.server.project.ws.BulkDeleteAction.PARAM_IDS;
import static org.sonar.server.project.ws.BulkDeleteAction.PARAM_KEYS;
-@Category(DbTests.class)
+
public class BulkDeleteActionTest {
private static final String ACTION = "bulk_delete";
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.config.Settings;
import org.sonar.api.resources.Qualifiers;
import org.sonar.server.test.index.TestIndexer;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.guava.api.Assertions.assertThat;
import static org.sonar.server.project.ws.DeleteAction.PARAM_ID;
import static org.sonar.server.project.ws.DeleteAction.PARAM_KEY;
-@Category(DbTests.class)
+
public class DeleteActionTest {
private static final String ACTION = "delete";
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.server.ws.WebService.Param;
import org.sonar.api.utils.DateUtils;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.db.DbTester;
import org.sonar.db.component.ComponentDto;
-import org.sonar.db.component.SnapshotDto;
import org.sonar.db.component.ComponentTesting;
+import org.sonar.db.component.SnapshotDto;
import org.sonar.db.component.SnapshotTesting;
import org.sonar.server.exceptions.ForbiddenException;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import org.sonar.test.JsonAssert;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class GhostsActionTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.server.ws.WebService.Param;
import org.sonar.api.utils.DateUtils;
import org.sonar.db.DbTester;
import org.sonar.db.component.ComponentDao;
import org.sonar.db.component.ComponentDto;
-import org.sonar.db.component.SnapshotDto;
import org.sonar.db.component.ComponentTesting;
+import org.sonar.db.component.SnapshotDto;
import org.sonar.db.component.SnapshotTesting;
import org.sonar.server.exceptions.ForbiddenException;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import org.sonar.test.JsonAssert;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class ProvisionedActionTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.measures.CoreMetrics;
import org.sonar.api.utils.System2;
import org.sonar.server.exceptions.NotFoundException;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.test.DbTests;
import org.sonarqube.ws.MediaTypes;
import org.sonarqube.ws.WsQualityGates.ProjectStatusWsResponse;
import org.sonarqube.ws.WsQualityGates.ProjectStatusWsResponse.Status;
import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_PROJECT_ID;
import static org.sonarqube.ws.client.qualitygate.QualityGatesWsParameters.PARAM_PROJECT_KEY;
-@Category(DbTests.class)
+
public class ProjectStatusActionTest {
private static final String ANALYSIS_ID = "task-uuid";
@Rule
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.config.Settings;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.rule.Severity;
import org.sonar.server.es.EsTester;
import org.sonar.server.qualityprofile.ActiveRuleChange;
import org.sonar.server.rule.index.RuleIndexDefinition;
-import org.sonar.test.DbTests;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import static org.sonar.server.rule.index.RuleIndexDefinition.INDEX;
import static org.sonar.server.rule.index.RuleIndexDefinition.TYPE_ACTIVE_RULE;
-@Category(DbTests.class)
+
public class ActiveRuleIndexerTest {
static final RuleKey RULE_KEY_1 = RuleTesting.XOO_X1;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
import org.sonar.db.qualityprofile.ActiveRuleKey;
import org.sonar.server.qualityprofile.ActiveRule;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.api.rule.Severity.BLOCKER;
import static org.sonar.api.rule.Severity.INFO;
import static org.sonar.server.qualityprofile.ActiveRule.Inheritance.INHERITED;
-@Category(DbTests.class)
+
public class ActiveRuleResultSetIteratorTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.api.web.UserRole;
import org.sonar.db.DbClient;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsTester;
import org.sonar.server.ws.WsTester.TestRequest;
-import org.sonar.test.DbTests;
import static org.mockito.Mockito.mock;
-@Category(DbTests.class)
+
public class ProjectsActionTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.resources.Language;
import org.sonar.api.resources.Languages;
import org.sonar.server.qualityprofile.QProfileLoader;
import org.sonar.server.qualityprofile.QProfileLookup;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.sonar.server.qualityprofile.ws.SearchAction.PARAM_PROJECT_KEY;
import static org.sonar.test.JsonAssert.assertJson;
-@Category(DbTests.class)
+
public class SearchActionTest {
@Rule
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.config.Settings;
import org.sonar.api.resources.Language;
import org.sonar.api.resources.Languages;
import org.sonar.server.rule.index.RuleIndexDefinition;
import org.sonar.server.rule.index.RuleIndexer;
import org.sonar.server.rule.index.RuleQuery;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.sonar.api.rule.Severity.BLOCKER;
import static org.sonar.api.rule.Severity.INFO;
-@Category(DbTests.class)
+
public class RegisterRulesTest {
static final Date DATE1 = DateUtils.parseDateTime("2014-01-01T19:10:03+0100");
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.config.Settings;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.rule.RuleStatus;
import org.sonar.db.rule.RuleDto;
import org.sonar.db.rule.RuleTesting;
import org.sonar.server.es.EsTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class RuleIndexerTest {
@ClassRule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.rule.RuleStatus;
import org.sonar.api.rule.Severity;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class RuleResultSetIteratorTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
import org.sonar.api.utils.System2;
import org.sonar.server.exceptions.NotFoundException;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
@RunWith(MockitoJUnitRunner.class)
-@Category(DbTests.class)
+
public class HashActionTest {
final static String COMPONENT_KEY = "Action.java";
import java.util.List;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.measures.CoreMetrics;
import org.sonar.api.measures.Metric;
import org.sonar.api.measures.Metrics;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class RegisterMetricsTest {
@Rule
import java.util.Map;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.DateUtils;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.db.dashboard.WidgetPropertyDao;
import org.sonar.db.issue.IssueFilterDao;
import org.sonar.db.loadedtemplate.LoadedTemplateDao;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-@Category(DbTests.class)
+
public class RenameIssueWidgetsTest {
@Rule
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.config.Settings;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
import org.sonar.server.es.EsTester;
import org.sonar.server.source.index.FileSourcesUpdaterHelper;
import org.sonar.server.test.db.TestTesting;
-import org.sonar.test.DbTests;
import org.sonar.test.TestUtils;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.server.test.index.TestIndexDefinition.INDEX;
import static org.sonar.server.test.index.TestIndexDefinition.TYPE;
-@Category(DbTests.class)
+
public class TestIndexerTest {
@ClassRule
import org.junit.After;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
import org.sonar.db.protobuf.DbFileSources;
import org.sonar.server.source.index.FileSourcesUpdaterHelper;
import org.sonar.server.test.db.TestTesting;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import static org.sonar.server.test.index.TestIndexDefinition.FIELD_TEST_UUID;
import static org.sonar.server.test.index.TestIndexDefinition.FIELD_UPDATED_AT;
-@Category(DbTests.class)
+
public class TestResultSetIteratorTest {
@Rule
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.config.Settings;
import org.sonar.api.utils.System2;
import org.sonar.api.web.UserRole;
import org.sonar.server.test.index.TestIndexDefinition;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
-@Category(DbTests.class)
+
public class ListActionTest {
@Rule
import java.util.List;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.core.user.GroupMembership;
import org.sonar.db.DbTester;
import org.sonar.server.exceptions.NotFoundException;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
/**
* Use BbUnit tests because there's no IT on this feature for the moment
*/
-@Category(DbTests.class)
+
public class GroupMembershipServiceTest {
@Rule
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.mockito.ArgumentCaptor;
import org.sonar.api.config.Settings;
import org.sonar.api.platform.NewUserHandler;
import org.sonar.server.user.index.UserIndexDefinition;
import org.sonar.server.user.index.UserIndexer;
import org.sonar.server.util.Validation;
-import org.sonar.test.DbTests;
import static com.google.common.collect.Lists.newArrayList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.api.CoreProperties.CORE_AUTHENTICATOR_LOCAL_USERS;
import static org.sonar.api.CoreProperties.CORE_DEFAULT_GROUP;
-@Category(DbTests.class)
+
public class UserUpdaterTest {
static final String DEFAULT_LOGIN = "marius";
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.config.Settings;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.db.DbTester;
import org.sonar.server.es.EsTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class UserIndexerTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class UserResultSetIteratorTest {
@Rule
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.config.Settings;
import org.sonar.api.i18n.I18n;
import org.sonar.api.server.ws.WebService;
import org.sonar.server.user.index.UserIndexDefinition;
import org.sonar.server.user.index.UserIndexer;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-@Category(DbTests.class)
+
public class CreateActionTest {
static final Settings settings = new Settings().setProperty("sonar.defaultGroup", "sonar-users");
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.config.Settings;
import org.sonar.api.server.ws.WebService;
import org.sonar.api.utils.System2;
import org.sonar.server.user.index.UserIndexDefinition;
import org.sonar.server.user.index.UserIndexer;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.sonar.db.user.UserTokenTesting.newUserToken;
-@Category(DbTests.class)
+
public class DeactivateActionTest {
static final Settings settings = new Settings();
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.config.Settings;
import org.sonar.api.server.ws.WebService.Param;
import org.sonar.api.utils.System2;
import org.sonar.server.user.index.UserIndex;
import org.sonar.server.user.index.UserIndexDefinition;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.db.user.UserTesting.newUserDto;
import static org.sonar.db.user.UserTokenTesting.newUserToken;
-@Category(DbTests.class)
+
public class SearchActionTest {
@ClassRule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.System2;
import org.sonar.core.permission.GlobalPermissions;
import org.sonar.server.exceptions.NotFoundException;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.server.usergroups.ws.UserGroupsWsParameters.PARAM_GROUP_NAME;
import static org.sonar.server.usergroups.ws.UserGroupsWsParameters.PARAM_LOGIN;
-@Category(DbTests.class)
+
public class AddUserActionTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.System2;
import org.sonar.core.permission.GlobalPermissions;
import org.sonar.server.exceptions.ServerException;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
-@Category(DbTests.class)
+
public class CreateActionTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.CoreProperties;
import org.sonar.api.config.Settings;
import org.sonar.api.utils.System2;
import org.sonar.server.exceptions.NotFoundException;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.db.user.GroupTesting.newGroupDto;
import static org.sonar.server.usergroups.ws.UserGroupsWsParameters.PARAM_GROUP_NAME;
-@Category(DbTests.class)
+
public class DeleteActionTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.System2;
import org.sonar.core.permission.GlobalPermissions;
import org.sonar.server.exceptions.NotFoundException;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.server.usergroups.ws.UserGroupsWsParameters.PARAM_GROUP_NAME;
import static org.sonar.server.usergroups.ws.UserGroupsWsParameters.PARAM_LOGIN;
-@Category(DbTests.class)
+
public class RemoveUserActionTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.server.ws.WebService.Param;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.db.user.UserGroupDao;
import org.sonar.db.user.UserGroupDto;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.db.user.GroupTesting.newGroupDto;
-@Category(DbTests.class)
+
public class SearchActionTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.System2;
import org.sonar.core.permission.GlobalPermissions;
import org.sonar.server.exceptions.ServerException;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsTester;
-import org.sonar.test.DbTests;
-@Category(DbTests.class)
+
public class UpdateActionTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.server.ws.WebService.Param;
import org.sonar.api.server.ws.WebService.SelectionMode;
import org.sonar.api.utils.System2;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.WsTester;
import org.sonar.server.ws.WsTester.TestRequest;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.server.usergroups.ws.UserGroupsWsParameters.PARAM_GROUP_NAME;
-@Category(DbTests.class)
+
public class UsersActionTest {
@Rule
import com.google.common.base.Optional;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.sonar.db.user.UserTokenTesting.newUserToken;
-@Category(DbTests.class)
+
public class UserTokenAuthenticatorTest {
static final String GRACE_HOPPER = "grace.hopper";
static final String ADA_LOVELACE = "ada.lovelace";
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.System2;
import org.sonar.core.permission.GlobalPermissions;
import org.sonar.server.usertoken.TokenGenerator;
import org.sonar.server.ws.TestRequest;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.test.DbTests;
import org.sonarqube.ws.MediaTypes;
import org.sonarqube.ws.WsUserTokens.GenerateWsResponse;
import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.PARAM_LOGIN;
import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.PARAM_NAME;
-@Category(DbTests.class)
+
public class GenerateActionTest {
private static final String GRACE_HOPPER = "grace.hopper";
private static final String ADA_LOVELACE = "ada.lovelace";
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.System2;
import org.sonar.core.permission.GlobalPermissions;
import org.sonar.server.tester.UserSessionRule;
import org.sonar.server.ws.TestRequest;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.db.user.UserTokenTesting.newUserToken;
import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.PARAM_LOGIN;
import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.PARAM_NAME;
-@Category(DbTests.class)
+
public class RevokeActionTest {
static final String GRACE_HOPPER = "grace.hopper";
static final String ADA_LOVELACE = "ada.lovelace";
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.System2;
import org.sonar.core.permission.GlobalPermissions;
import org.sonar.server.ws.TestRequest;
import org.sonar.server.ws.TestResponse;
import org.sonar.server.ws.WsActionTester;
-import org.sonar.test.DbTests;
import org.sonarqube.ws.MediaTypes;
import org.sonarqube.ws.WsUserTokens.SearchWsResponse;
import static org.sonar.test.JsonAssert.assertJson;
import static org.sonarqube.ws.client.usertoken.UserTokensWsParameters.PARAM_LOGIN;
-@Category(DbTests.class)
+
public class SearchActionTest {
static final String GRACE_HOPPER = "grace.hopper";
static final String ADA_LOVELACE = "ada.lovelace";
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.config.Settings;
import org.sonar.api.utils.System2;
import org.sonar.api.web.UserRole;
import org.sonar.server.issue.index.IssueIndexDefinition;
import org.sonar.server.issue.index.IssueIndexer;
import org.sonar.server.tester.UserSessionRule;
-import org.sonar.test.DbTests;
import static com.google.common.collect.Lists.newArrayList;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class ViewIndexerTest {
@Rule
<name>with-db-drivers</name>
</property>
</activation>
- <properties>
- <junitGroups>org.sonar.test.DbTests</junitGroups>
- </properties>
<dependencies>
<dependency>
<groupId>mysql</groupId>
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.database.model.User;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
import org.sonar.db.user.UserDao;
-import org.sonar.test.DbTests;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
-@Category(DbTests.class)
+
public class DeprecatedUserFinderTest {
@Rule
import javax.annotation.Nullable;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.System2;
import org.sonar.api.utils.log.LogTester;
import org.sonar.api.utils.log.LoggerLevel;
import org.sonar.api.utils.log.Loggers;
import org.sonar.db.dialect.Oracle;
-import org.sonar.test.DbTests;
import static com.google.common.collect.Lists.newArrayList;
import static java.util.Arrays.asList;
import static org.sonar.db.WildcardPosition.BEFORE;
import static org.sonar.db.WildcardPosition.BEFORE_AND_AFTER;
-@Category(DbTests.class)
+
public class DatabaseUtilsTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class IsAliveMapperTest {
@Rule
import java.util.NoSuchElementException;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
-@Category(DbTests.class)
+
public class ResultSetIteratorTest {
@Rule
import java.util.Map;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-@Category(DbTests.class)
+
public class ActivityDaoTest {
System2 system = mock(System2.class);
import java.util.List;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.internal.TestSystem2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.db.ce.CeTaskTypes.REPORT;
-@Category(DbTests.class)
+
public class CeActivityDaoTest {
TestSystem2 system2 = new TestSystem2().setNow(1_450_000_000_000L);
import java.util.List;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.Paging;
import org.sonar.api.utils.System2;
import org.sonar.api.utils.internal.TestSystem2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static com.google.common.collect.Lists.newArrayList;
import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.db.ce.CeQueueTesting.newCeQueueDto;
-@Category(DbTests.class)
+
public class CeQueueDaoTest {
System2 system2 = new TestSystem2().setNow(1_450_000_000_000L);
import java.util.List;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.resources.Qualifiers;
import org.sonar.api.utils.DateUtils;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
import org.sonar.db.RowNotFoundException;
-import org.sonar.test.DbTests;
import static com.google.common.collect.Lists.newArrayList;
import static com.google.common.collect.Sets.newHashSet;
import static org.sonar.db.component.ComponentTesting.newSubView;
import static org.sonar.db.component.ComponentTesting.newView;
-@Category(DbTests.class)
+
public class ComponentDaoTest {
@Rule
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.db.component.ComponentTesting.newProjectDto;
/**
* On H2, the index on PROJECTS.KEE is unique. In order to simulate the MySQL behaviour where the index is not unique, we need to create a schema where there's no unique index on PROJECTS.KEE
*/
-@Category(DbTests.class)
+
public class ComponentDaoWithDuplicatedKeysTest {
static final String PROJECT_KEY = "PROJECT_KEY";
import java.util.List;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class ComponentLinkDaoTest {
@Rule
import javax.annotation.Nullable;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.component.Component;
import org.sonar.api.resources.Qualifiers;
import org.sonar.api.resources.Scopes;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static com.google.common.collect.Lists.newArrayList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-@Category(DbTests.class)
+
public class ResourceDaoTest {
static System2 system = mock(System2.class);
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.resources.Qualifiers;
import org.sonar.api.utils.System2;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class ResourceIndexDaoTest {
@Rule
import java.util.Map;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class ResourceKeyUpdaterDaoTest {
@Rule
import java.util.List;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.resources.Qualifiers;
import org.sonar.api.resources.Scopes;
import org.sonar.api.utils.System2;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static com.google.common.collect.Lists.newArrayList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.db.component.SnapshotQuery.SORT_ORDER.DESC;
import static org.sonar.db.component.SnapshotTesting.newSnapshotForProject;
-@Category(DbTests.class)
+
public class SnapshotDaoTest {
@Rule
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class ActiveDashboardDaoTest {
@Rule
import java.util.Date;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
-@Category(DbTests.class)
+
public class DashboardDaoTest {
@Rule
import java.util.Collection;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
public class WidgetDaoTest {
@Rule
import java.util.List;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class DuplicationDaoTest {
@Rule
import java.util.List;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class EventDaoTest {
@Rule
import java.util.List;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static com.google.common.collect.Lists.newArrayList;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
public class ActionPlanDaoTest {
private static final String[] EXCLUDED_COLUMNS = new String[] {"id", "created_at", "updated_at"};
import java.util.Collection;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class ActionPlanStatsDaoTest {
@Rule
import java.util.List;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.DateUtils;
import org.sonar.api.utils.System2;
import org.sonar.core.issue.DefaultIssueComment;
import org.sonar.core.issue.FieldDiffs;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static com.google.common.collect.Lists.newArrayList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
-@Category(DbTests.class)
+
public class IssueChangeDaoTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
-@Category(DbTests.class)
+
public class IssueChangeMapperTest {
@Rule
import org.apache.ibatis.executor.result.DefaultResultHandler;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.utils.System2;
import org.sonar.db.component.ComponentTesting;
import org.sonar.db.rule.RuleDto;
import org.sonar.db.rule.RuleTesting;
-import org.sonar.test.DbTests;
import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class IssueDaoTest {
public static final RuleDto RULE = RuleTesting.newXooX1();
import java.util.List;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class IssueFilterDaoTest {
@Rule
import java.util.List;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class IssueFilterFavouriteDaoTest {
@Rule
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.DateUtils;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class IssueMapperTest {
@Rule
import javax.annotation.Nullable;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
import org.sonar.db.component.ComponentDto;
import org.sonar.db.component.ComponentTesting;
import org.sonar.db.component.SnapshotDto;
-import org.sonar.test.DbTests;
import static com.google.common.collect.Lists.newArrayList;
import static com.google.common.collect.Sets.newHashSet;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.guava.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class MeasureDaoTest {
private static final int SNAPSHOT_ID = 5;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.System2;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
import org.sonar.db.RowNotFoundException;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.offset;
import static org.sonar.db.measure.custom.CustomMeasureTesting.newCustomMeasureDto;
-@Category(DbTests.class)
+
public class CustomMeasureDaoTest {
@Rule
public DbTester db = DbTester.create(System2.INSTANCE);
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.System2;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
import org.sonar.db.RowNotFoundException;
-import org.sonar.test.DbTests;
import static com.google.common.collect.Sets.newHashSet;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.db.metric.MetricTesting.newMetricDto;
-@Category(DbTests.class)
+
public class MetricDaoTest {
@Rule
import org.apache.ibatis.session.ResultHandler;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
import org.sonar.db.user.GroupDto;
import org.sonar.db.user.GroupRoleDto;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.api.web.UserRole.ADMIN;
import static org.sonar.api.web.UserRole.USER;
import static org.sonar.db.user.GroupTesting.newGroupDto;
-@Category(DbTests.class)
+
public class GroupWithPermissionDaoTest {
private static final long COMPONENT_ID = 100L;
import java.util.List;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.api.web.UserRole;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class GroupWithPermissionTemplateDaoTest {
private static final long TEMPLATE_ID = 50L;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.config.Settings;
import org.sonar.api.utils.System2;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
import org.sonar.db.user.RoleDao;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-@Category(DbTests.class)
+
public class PermissionRepositoryTest {
static final String DEFAULT_TEMPLATE = "default_20130101_010203";
import org.apache.ibatis.session.ResultHandler;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.db.DbTester;
import org.sonar.db.user.GroupDto;
import org.sonar.db.user.UserDto;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.sonar.db.user.GroupTesting.newGroupDto;
import static org.sonar.db.user.UserTesting.newUserDto;
-@Category(DbTests.class)
+
public class PermissionTemplateDaoTest {
System2 system = mock(System2.class);
import org.apache.ibatis.session.ResultHandler;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
import org.sonar.db.user.UserDto;
import org.sonar.db.user.UserRoleDto;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.api.web.UserRole.ADMIN;
import static org.sonar.api.web.UserRole.USER;
import static org.sonar.db.user.UserTesting.newUserDto;
-@Category(DbTests.class)
+
public class UserWithPermissionDaoTest {
private static final long COMPONENT_ID = 100L;
import javax.annotation.Nullable;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class UserWithPermissionTemplateDaoTest {
private static final Long TEMPLATE_ID = 50L;
import java.util.List;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
-@Category(DbTests.class)
+
public class PropertiesDaoTest {
@Rule
import java.util.List;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static com.google.common.collect.Lists.newArrayList;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class PurgeCommandsTest {
@Rule
import java.util.List;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.resources.Scopes;
import org.sonar.api.utils.System2;
import org.sonar.core.util.Uuids;
import org.sonar.db.ce.CeQueueDto;
import org.sonar.db.component.ComponentDto;
import org.sonar.db.component.ComponentTesting;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.sonar.db.ce.CeTaskTypes.REPORT;
-@Category(DbTests.class)
+
public class PurgeDaoTest {
System2 system2 = mock(System2.class);
import java.util.List;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class ProjectQgateAssociationDaoTest {
@Rule
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class QualityGateConditionDaoTest {
private static final String[] COLUMNS_WITHOUT_TIMESTAMPS = {
import java.util.Iterator;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class QualityGateDaoTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.rule.Severity;
import org.sonar.api.utils.System2;
import org.sonar.db.DbClient;
import org.sonar.db.DbTester;
import org.sonar.db.rule.RuleDto;
import org.sonar.db.rule.RuleTesting;
-import org.sonar.test.DbTests;
import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.when;
// TODO add missing tests
-@Category(DbTests.class)
+
public class ActiveRuleDaoTest {
static final long NOW = 10000000L;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.core.util.UtcDateUtils;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-@Category(DbTests.class)
+
public class QualityProfileDaoTest {
System2 system = mock(System2.class);
import org.apache.ibatis.session.ResultHandler;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.rule.RuleStatus;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
import org.sonar.db.RowNotFoundException;
-import org.sonar.test.DbTests;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.guava.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class RuleDaoTest {
@Rule
import org.apache.commons.io.IOUtils;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
import org.sonar.db.source.FileSourceDto.Type;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class FileSourceDaoTest {
@Rule
import org.junit.After;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.System2;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class AuthorDaoTest {
@Rule
import java.util.Collections;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class AuthorizationDaoTest {
private static final int USER = 100;
import java.util.List;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.DateUtils;
import org.sonar.api.utils.System2;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.sonar.db.user.GroupTesting.newGroupDto;
-@Category(DbTests.class)
+
public class GroupDaoTest {
@Rule
import java.util.List;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.data.MapEntry.entry;
-@Category(DbTests.class)
+
public class GroupMembershipDaoTest {
@Rule
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.security.DefaultGroups;
import org.sonar.api.utils.System2;
import org.sonar.api.web.UserRole;
import org.sonar.core.permission.GlobalPermissions;
import org.sonar.db.DbClient;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class RoleDaoTest {
@Rule
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class RoleMapperTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.user.UserQuery;
import org.sonar.api.utils.DateUtils;
import org.sonar.db.measure.MeasureFilterFavouriteDto;
import org.sonar.db.property.PropertyDto;
import org.sonar.db.property.PropertyQuery;
-import org.sonar.test.DbTests;
import static java.util.Arrays.asList;
import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
import static org.sonar.db.user.GroupMembershipQuery.IN;
import static org.sonar.db.user.GroupMembershipQuery.builder;
-@Category(DbTests.class)
+
public class UserDaoTest {
@Rule
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
-@Category(DbTests.class)
+
public class UserGroupDaoTest {
@Rule
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.System2;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
import org.sonar.db.RowNotFoundException;
-import org.sonar.test.DbTests;
import static com.google.common.collect.Lists.newArrayList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.db.user.UserTokenTesting.newUserToken;
-@Category(DbTests.class)
+
public class UserTokenDaoTest {
@Rule
public DbTester db = DbTester.create(System2.INSTANCE);
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.sonar.api.utils.System2;
import org.sonar.db.BatchSession;
import org.sonar.db.DbTester;
import org.sonar.db.version.Select.Row;
import org.sonar.db.version.Select.RowReader;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
-@Category(DbTests.class)
+
public class BaseDataChangeTest {
@Rule
import org.junit.Rule;
import org.junit.Test;
-import org.junit.experimental.categories.Category;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
-import org.sonar.test.DbTests;
import static org.assertj.core.api.Assertions.assertThat;
-@Category(DbTests.class)
+
public class DatabaseVersionTest {
@Rule
+++ /dev/null
-/*
- * 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.test;
-
-/**
- * JUnit category declared on all the tests that interact with database. These tests
- * are executed on all the supported DB, not only on the default embedded H2.
- */
-public interface DbTests {
-}