]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-19558 Activate different UUIDs flag in WS ITs
authorDuarte Meneses <duarte.meneses@sonarsource.com>
Fri, 16 Jun 2023 21:08:06 +0000 (16:08 -0500)
committersonartech <sonartech@sonarsource.com>
Tue, 20 Jun 2023 20:02:59 +0000 (20:02 +0000)
83 files changed:
server/sonar-webserver-webapi/src/it/java/org/sonar/server/badge/ws/QualityGateActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/badge/ws/TokenActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/ce/ws/CancelActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/developers/ws/SearchEventsActionNewIssuesIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/developers/ws/SearchEventsActionQualityGateIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/duplication/ws/DuplicationsParserIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/duplication/ws/ShowActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/duplication/ws/ShowResponseBuilderIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/favorite/ws/AddActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/favorite/ws/RemoveActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/favorite/ws/SearchActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/issue/AssignActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/issue/SetSeverityActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/issue/SetTypeActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/issue/TransitionServiceIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/issue/ws/DeleteCommentActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/issue/ws/EditCommentActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/issue/ws/ReindexActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/issue/ws/SetSeverityActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/issue/ws/SetTypeActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/measure/live/ComponentIndexFactoryIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/measure/live/ComponentIndexImplIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/measure/live/LiveQualityGateComputerImplIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/measure/ws/SearchHistoryActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/monitoring/MetricsActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/PermissionTemplateServiceIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/permission/ws/template/ApplyTemplateActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/platform/ws/SafeModeMonitoringMetricActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/project/ws/ProjectFinderIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/project/ws/SearchMyScannableProjectsActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/project/ws/UpdateDefaultVisibilityActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/projectanalysis/ws/DeleteActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/projectdump/ws/ExportActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/projecttag/ws/SetActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualitygate/ws/CreateConditionActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualitygate/ws/DeleteConditionActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualitygate/ws/DeselectActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualitygate/ws/ListActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualitygate/ws/RemoveGroupActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualitygate/ws/RemoveUserActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualitygate/ws/SearchActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualitygate/ws/SearchGroupsActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualitygate/ws/SearchUsersActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/QProfileComparisonIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/QProfileResetImplIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/QProfileRulesImplIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/builtin/BuiltInQProfileInsertImplIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/builtin/BuiltInQProfileRepositoryImplIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/builtin/BuiltInQProfileUpdateImplIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/builtin/RuleActivatorIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/ActivateRuleActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/ActivateRulesActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/AddGroupActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/AddProjectActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/AddUserActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/BackupActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/CompareActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/CopyActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/CreateActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/DeactivateRuleActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/DeactivateRulesActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/InheritanceActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/QProfileWsSupportIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/QProfilesWsMediumIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/RemoveGroupActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/RemoveProjectActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/RemoveUserActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/RestoreActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/SearchGroupsActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/SearchUsersActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/SetDefaultActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/qualityprofile/ws/ShowActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/rule/ws/ActiveRuleCompleterIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/rule/ws/DeleteActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/rule/ws/ShowActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/rule/ws/TagsActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/rule/ws/UpdateActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/ui/ws/MarketplaceActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/user/ws/ChangePasswordActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/user/ws/GroupsActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/user/ws/SearchActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/user/ws/UpdateIdentityProviderActionIT.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/ce/projectdump/ExportSubmitterImpl.java

index 0995757dd93edd502bc4182fa0ca119d52bc1629..6f86262e5a199ef2dbb3fd0c16a97ecc159c2d15 100644 (file)
@@ -68,7 +68,7 @@ public class QualityGateActionIT {
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final MapSettings mapSettings = new MapSettings().setProperty(CoreProperties.CORE_FORCE_AUTHENTICATION_PROPERTY, false);
   private final Configuration config = mapSettings.asConfig();
index 833427efe966dce9004767e77cc8400369b7d9f4..4256242dba1a337a0c09df40d86d3dbda3354de4 100644 (file)
@@ -39,7 +39,7 @@ import static org.mockito.Mockito.when;
 public class TokenActionIT {
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
index 2f300182b85b903a86f80e38768d7906dddb3054..381323b96f120b0dfa2ba542822aac6baacf1883 100644 (file)
@@ -50,7 +50,7 @@ public class CancelActionIT {
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private System2 system2 = new TestSystem2();
   private CeQueue queue = new CeQueueImpl(system2, db.getDbClient(), UuidFactoryFast.getInstance(), mock(NodeInformation.class));
index 1c45e83c3e615fdb4f018c59ba039ab79919c16a..61c0b37bfba0fc8584c49225ca2755157b37b494 100644 (file)
@@ -67,7 +67,7 @@ public class SearchEventsActionNewIssuesIT {
     .toArray(RuleType[]::new);
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public EsTester es = EsTester.create();
   @Rule
index b44bee08f15095621f1746c29789a0fd9cfa1b95..45550366d62e8b244e09a6774791b23af99fc120 100644 (file)
@@ -56,7 +56,7 @@ import static org.sonar.server.developers.ws.SearchEventsAction.PARAM_PROJECTS;
 public class SearchEventsActionQualityGateIT {
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public EsTester es = EsTester.create();
   @Rule
index 5e158e3f6d43bc6c5efeea8c5365d84621db1048..31d84eef047e18a179a1fb28f8d9ea35258b2468 100644 (file)
@@ -38,7 +38,7 @@ import static org.sonar.db.component.ComponentTesting.newFileDto;
 public class DuplicationsParserIT {
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final DuplicationsParser parser = new DuplicationsParser(new ComponentFinder(db.getDbClient(), null));
 
index cb879dfd0a3770ab91c3eeb6c44f7387183f9706..2154e45f69a7573ffef0c21c627889781e3a98c3 100644 (file)
@@ -56,7 +56,7 @@ public class ShowActionIT {
   public UserSessionRule userSessionRule = UserSessionRule.standalone();
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   private final TestComponentFinder componentFinder = TestComponentFinder.from(db);
   private final DuplicationsParser parser = new DuplicationsParser(componentFinder);
   private final ShowResponseBuilder showResponseBuilder = new ShowResponseBuilder(db.getDbClient());
index 1b3be141672113bef0816425c572f456f7b6645d..49fc2143fe79ba4f7c82f3f32c18300891ca6b5e 100644 (file)
@@ -40,7 +40,7 @@ import static org.sonar.db.component.ComponentTesting.newFileDto;
 public class ShowResponseBuilderIT {
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private ShowResponseBuilder underTest = new ShowResponseBuilder(db.getDbClient().componentDao());
 
index e276a1608a2263a8eae53b54cbb988ca0193e08b..29bfe9c16021e4eefac591f3ff72a1f5ccc8fa4f 100644 (file)
@@ -57,7 +57,7 @@ public class AddActionIT {
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final DbClient dbClient = db.getDbClient();
   private final DbSession dbSession = db.getSession();
index 6aea81b54fecb061797da8441a99867cb23a3d2a..f927e04eb108fe92e76ce83ac15e4374a913336c 100644 (file)
@@ -51,7 +51,7 @@ public class RemoveActionIT {
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final DbClient dbClient = db.getDbClient();
   private final FavoriteUpdater favoriteUpdater = new FavoriteUpdater(dbClient);
index 8fdd858415e1faa0767ec2261eaa99e0b1a50d54..d4979ac06eb2346896fc3ef9e04d47fe81077bb1 100644 (file)
@@ -60,7 +60,7 @@ public class SearchActionIT {
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   private final DbClient dbClient = db.getDbClient();
 
   private final FavoriteFinder favoriteFinder = new FavoriteFinder(dbClient, userSession);
index 0b46b040e9e016e263e31d1325f7178366b2f299..e69d766ee0876f867628ee3a0517d54d38be709d 100644 (file)
@@ -52,7 +52,7 @@ public class AssignActionIT {
   public UserSessionRule userSession = standalone();
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final IssueChangeContext issueChangeContext = issueChangeContextByUserBuilder(new Date(), "user_uuid").build();
   private final DefaultIssue issue = new DefaultIssue().setKey("ABC").setAssigneeUuid(ISSUE_CURRENT_ASSIGNEE_UUID);
index bf4be8145f0435addaa88c2aa7d1da91c138c911..2ab5f4157e0f182e20196ff21bb373a66518edad 100644 (file)
@@ -57,7 +57,7 @@ public class SetSeverityActionIT {
   public UserSessionRule userSession = UserSessionRule.standalone();
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private IssueFieldsSetter issueUpdater = new IssueFieldsSetter();
 
index 035c7ecc286f8610bb66aa985b013688a6525606..8709b5bb932fd2799c211f15b64ed0e7d7adedc2 100644 (file)
@@ -55,7 +55,7 @@ public class SetTypeActionIT {
   public UserSessionRule userSession = UserSessionRule.standalone();
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private IssueFieldsSetter issueUpdater = new IssueFieldsSetter();
 
index a024aaee6bbde94a3cb82508526dfab1a5ef3e9f..8b731dcd2621de9d9d1d9d9b2bd40707ab15bc4e 100644 (file)
@@ -47,7 +47,7 @@ import static org.sonar.db.component.ComponentTesting.newFileDto;
 public class TransitionServiceIT {
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
 
index dad64408299e9e086e71bd6453071a8bff972288..afc818308cdc8e09ee0ca52d28f7958bc3c1b4eb 100644 (file)
@@ -54,7 +54,7 @@ import static org.sonar.api.web.UserRole.USER;
 public class DeleteCommentActionIT {
 
   @Rule
-  public DbTester dbTester = DbTester.create();
+  public DbTester dbTester = DbTester.create(true);
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
 
index 054be66b573ede5ed25c8233c63c73824c89b2d7..f85df440e0dee1b982f59255abb387d1c0d8fcf4 100644 (file)
@@ -59,7 +59,7 @@ public class EditCommentActionIT {
   private static final long NOW = 10_000_000_000L;
 
   @Rule
-  public DbTester dbTester = DbTester.create();
+  public DbTester dbTester = DbTester.create(true);
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
 
index 751d9ad4b740178224e1b3de185fc9fcb26cc5f5..0cfcdbe9b2cd476338f0603a526d409221ae0c8c 100644 (file)
@@ -47,7 +47,7 @@ public class ReindexActionIT {
   @Rule
   public EsTester es = EsTester.create();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
 
index 22f778dbafef0a2ac588ddf515fd818f73d372d2..19e646b0a726634f3c019c5787a606322df2c21c 100644 (file)
@@ -77,7 +77,7 @@ import static org.sonar.db.issue.IssueTesting.newIssue;
 public class SetSeverityActionIT {
 
   @Rule
-  public DbTester dbTester = DbTester.create();
+  public DbTester dbTester = DbTester.create(true);
   @Rule
   public EsTester es = EsTester.create();
   @Rule
index 735b6373632a14ce651380a0dff18ef45045a1e0..016b8375097983f4ef863b5050e96941df29045d 100644 (file)
@@ -88,7 +88,7 @@ import static org.sonar.db.issue.IssueTesting.newIssue;
 public class SetTypeActionIT {
 
   @Rule
-  public DbTester dbTester = DbTester.create();
+  public DbTester dbTester = DbTester.create(true);
   @Rule
   public EsTester es = EsTester.create();
   @Rule
index 07a22736fd7f602fb2c319bb912d1666f2d7d205..02723775baa9f6d96468a61980707ce57d6a0fd1 100644 (file)
@@ -27,7 +27,7 @@ import org.sonar.db.component.ComponentDto;
 import static org.assertj.core.api.Assertions.assertThat;
 
 public class ComponentIndexFactoryIT {
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   private final ComponentIndexFactory factory = new ComponentIndexFactory(db.getDbClient());
 
   @Test
index cda533e612158196540717620089ca9ba1521c06..7371764f2cd3bf1f5a864f32ec705422b11f360f 100644 (file)
@@ -31,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 
 public class ComponentIndexImplIT {
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   private final ComponentIndexImpl componentIndex = new ComponentIndexImpl(db.getDbClient());
 
   private ComponentDto project;
index ce14f6cf14412bd9ddf9ece33ed2e1c549f95d6f..6391f13cdbb367ffe7538cee9ec6f4c9ffc4a381 100644 (file)
@@ -57,7 +57,7 @@ import static org.sonar.db.metric.MetricTesting.newMetricDto;
 
 public class LiveQualityGateComputerImplIT {
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final MapSettings settings = new MapSettings();
   private final Configuration configuration = new ConfigurationBridge(settings);
index d4baa160954809ba0129993e7495bfccb0da2fe6..e12d941f7c62ec35a0394f90233c949c0a4d4088 100644 (file)
@@ -79,7 +79,7 @@ public class SearchHistoryActionIT {
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final DbClient dbClient = db.getDbClient();
   private final DbSession dbSession = db.getSession();
index 950c519ef6896d2c6c29b8bbb3ef62cadae1307e..cca6520337d8ab41b1001ad792d02423156c5007 100644 (file)
@@ -44,7 +44,7 @@ public class MetricsActionIT {
   public UserSessionRule userSession = standalone();
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final BearerPasscode bearerPasscode = mock(BearerPasscode.class);
   private final SystemPasscode systemPasscode = mock(SystemPasscode.class);
index 5c19c7df10124a4516d313a9bece55f21d8c1198..10b339c08f35337d86247b5a05a94de1df2d352d 100644 (file)
@@ -52,7 +52,7 @@ import static org.sonar.api.resources.Qualifiers.VIEW;
 public class PermissionTemplateServiceIT {
 
   @Rule
-  public DbTester dbTester = DbTester.create();
+  public DbTester dbTester = DbTester.create(true);
 
   private final ResourceTypesRule resourceTypesRule = new ResourceTypesRule().setRootQualifiers(PROJECT, VIEW, APP);
   private final DefaultTemplatesResolver defaultTemplatesResolver = new DefaultTemplatesResolverImpl(dbTester.getDbClient(), resourceTypesRule);
index ddceb1083724ca801e467e1fad6da87c04494a9c..28015aec9c7b98767fdec1198bdc0cd5e0dc7f88 100644 (file)
@@ -58,7 +58,7 @@ import static org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_T
 public class ApplyTemplateActionIT extends BasePermissionWsIT<ApplyTemplateAction> {
 
   @Rule
-  public DbTester dbTester = DbTester.create();
+  public DbTester dbTester = DbTester.create(true);
 
   private UserDto user1;
   private UserDto user2;
index 016cbeceb6e6952a637b6f186cc6429360e82e56..450adaf989799a3df5b9c27c16cbab9a0d0daf25 100644 (file)
@@ -43,7 +43,7 @@ public class SafeModeMonitoringMetricActionIT {
   public UserSessionRule userSession = standalone();
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final BearerPasscode bearerPasscode = mock(BearerPasscode.class);
   private final SystemPasscode systemPasscode = mock(SystemPasscode.class);
index eb49f1d672655553eeecfc0c5503f20f10dbb0c8..b7fdcb85c890d4bb333361934a9ffa89b81a9009 100644 (file)
@@ -35,7 +35,7 @@ import static org.sonar.server.project.ws.ProjectFinder.SearchResult;
 
 public class ProjectFinderIT {
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
 
index c0cf046d05cfa69eb4fc4b0e2d67be608945749a..498b7404ef8c4c7a3ec1517d02e813d89c113e13 100644 (file)
@@ -44,7 +44,7 @@ public class SearchMyScannableProjectsActionIT {
   public UserSessionRule userSession = UserSessionRule.standalone();
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final WsActionTester ws = new WsActionTester(
     new SearchMyScannableProjectsAction(db.getDbClient(), new ProjectFinder(db.getDbClient(), userSession)));
index cb387ad5d51ceef988c78e22e40e76d8b15a4146..90490827343a40ba2400a7b684d24e21dba6cf34 100644 (file)
@@ -39,7 +39,7 @@ import static org.sonar.server.project.ws.UpdateDefaultVisibilityAction.PARAM_PR
 
 public class UpdateDefaultVisibilityActionIT {
   @Rule
-  public final DbTester dbTester = DbTester.create();
+  public final DbTester dbTester = DbTester.create(true);
   @Rule
   public final UserSessionRule userSession = UserSessionRule.standalone();
   public final ProjectDefaultVisibility projectDefaultVisibility = new ProjectDefaultVisibility(dbTester.getDbClient());
index d747bb04732a35cf07276817fa37645b68c0e4ef..0f20bcc79c63fb496291ceedd3930104eefe919f 100644 (file)
@@ -49,7 +49,7 @@ public class DeleteActionIT {
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   private DbClient dbClient = db.getDbClient();
   private DbSession dbSession = db.getSession();
 
index c577a5b79fa2f3438e4585626ee7d868e3ac7269..7da5b50c4621cc7126d5ecd84da44021108b222f 100644 (file)
@@ -29,6 +29,7 @@ import org.sonar.db.DbTester;
 import org.sonar.db.ce.CeTaskTypes;
 import org.sonar.db.component.ComponentDto;
 import org.sonar.db.component.ResourceTypesRule;
+import org.sonar.db.project.ProjectDto;
 import org.sonar.db.user.UserDto;
 import org.sonar.server.ce.projectdump.ExportSubmitter;
 import org.sonar.server.component.ComponentFinder;
@@ -54,18 +55,18 @@ public class ExportActionIT {
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final ExportSubmitter exportSubmitter = mock(ExportSubmitter.class);
   private final ResourceTypesRule resourceTypes = new ResourceTypesRule().setRootQualifiers(Qualifiers.PROJECT, Qualifiers.VIEW);
   private final ProjectDumpWsSupport projectDumpWsSupport = new ProjectDumpWsSupport(db.getDbClient(), userSession, new ComponentFinder(db.getDbClient(), resourceTypes));
   private final ExportAction underTest = new ExportAction(projectDumpWsSupport, userSession, exportSubmitter);
   private final WsActionTester actionTester = new WsActionTester(underTest);
-  private ComponentDto project;
+  private ProjectDto project;
 
   @Before
   public void setUp() {
-    project = db.components().insertPrivateProject(PROJECT_ID, p -> p.setKey(PROJECT_KEY).setName(PROJECT_NAME)).getMainBranchComponent();
+    project = db.components().insertPrivateProject(PROJECT_ID, p -> p.setKey(PROJECT_KEY).setName(PROJECT_NAME)).getProjectDto();
   }
 
   @Test
@@ -132,7 +133,7 @@ public class ExportActionIT {
   }
 
   private CeTask createResponseExampleTask() {
-    CeTask.Component component = new CeTask.Component(project.uuid(), project.getKey(), project.name());
+    CeTask.Component component = new CeTask.Component(project.getUuid(), project.getKey(), project.getName());
     return new CeTask.Builder()
       .setType(CeTaskTypes.PROJECT_EXPORT)
       .setUuid(TASK_ID)
index 206f354480148ab1d2c893f8018290fcfb721865..2903770460b016fcdb7c5e7569b1dfd6ebfc8390 100644 (file)
@@ -29,6 +29,7 @@ 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.ProjectData;
 import org.sonar.db.project.ProjectDto;
 import org.sonar.server.component.TestComponentFinder;
 import org.sonar.server.es.TestProjectIndexers;
@@ -53,21 +54,21 @@ public class SetActionIT {
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone().logIn();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
-  private DbClient dbClient = db.getDbClient();
-  private DbSession dbSession = db.getSession();
+  private final DbClient dbClient = db.getDbClient();
+  private final DbSession dbSession = db.getSession();
+  private final TestProjectIndexers projectIndexers = new TestProjectIndexers();
+  private final TagsWsSupport tagsWsSupport = new TagsWsSupport(dbClient, TestComponentFinder.from(db), userSession, projectIndexers, System2.INSTANCE);
+  private final WsActionTester ws = new WsActionTester(new SetAction(dbClient, tagsWsSupport));
   private ProjectDto project;
-
-  private TestProjectIndexers projectIndexers = new TestProjectIndexers();
-
-  private TagsWsSupport tagsWsSupport = new TagsWsSupport(dbClient, TestComponentFinder.from(db), userSession, projectIndexers, System2.INSTANCE);
-
-  private WsActionTester ws = new WsActionTester(new SetAction(dbClient, tagsWsSupport));
+  private ComponentDto projectComponent;
 
   @Before
   public void setUp() {
-    project = db.components().insertPrivateProject().getProjectDto();
+    ProjectData projectData = db.components().insertPrivateProject();
+    project = projectData.getProjectDto();
+    projectComponent = projectData.getMainBranchComponent();
     userSession.addProjectPermission(ADMIN, project);
   }
 
@@ -161,7 +162,6 @@ public class SetActionIT {
 
   @Test
   public void fail_if_component_is_a_file() {
-    ComponentDto projectComponent = dbClient.componentDao().selectByUuid(dbSession, project.getUuid()).get();
     ComponentDto file = db.components().insertComponent(newFileDto(projectComponent).setKey("FILE_KEY"));
 
     String fileKey = file.getKey();
index d1ce77961eb8f6418b3051a64b953f2b083d32d5..4ee0f1439bf61a221cc4503248e6dc55fda1c02c 100644 (file)
@@ -63,7 +63,7 @@ public class CreateConditionActionIT {
   public UserSessionRule userSession = UserSessionRule.standalone();
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final DbClient dbClient = db.getDbClient();
   private final DbSession dbSession = db.getSession();
index a1b4654be9e1801627c75032513071602cc2f43d..2835115cf707ac8ead3928e042e369ffec9d9ea9 100644 (file)
@@ -48,7 +48,7 @@ import static org.sonar.server.qualitygate.ws.QualityGatesWsParameters.PARAM_ID;
 public class DeleteConditionActionIT {
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
 
index a6a8ffa47b732fa51161589467fe7b5579f57c70..1176bb827b05c09bf30834e5664f70040837b019 100644 (file)
@@ -49,7 +49,7 @@ public class DeselectActionIT {
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final DbClient dbClient = db.getDbClient();
   private final ComponentFinder componentFinder = TestComponentFinder.from(db);
index 94eededce332ac7b0d50065b4b2aa2b5348c4873..3a9fe3f58947262fbb9e2928130a54e9415db1f2 100644 (file)
@@ -55,7 +55,7 @@ public class ListActionIT {
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final DbClient dbClient = db.getDbClient();
   private final QualityGateFinder qualityGateFinder = new QualityGateFinder(dbClient);
index 8ab0a2438cfc1eeeb7bdd35efdf00f51f8237b22..1165e3e6b495d7ed574489c98c7b9389494fc7d8 100644 (file)
@@ -45,7 +45,7 @@ public class RemoveGroupActionIT {
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final DbClient dbClient = db.getDbClient();
   private final QualityGatesWsSupport wsSupport = new QualityGatesWsSupport(dbClient, userSession, TestComponentFinder.from(db));
index e1ea8f01a8049f7aba90a0359b6bd9e9f2743013..5205c5ef779bbaa6c28e3c3ba2e4320d244d82b6 100644 (file)
@@ -45,7 +45,7 @@ public class RemoveUserActionIT {
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final DbClient dbClient = db.getDbClient();
   private final QualityGatesWsSupport wsSupport = new QualityGatesWsSupport(dbClient, userSession, TestComponentFinder.from(db));
index 8746c33cf0f7d6abc0e29b09b9003c4fd6856b5d..f5bdf51833b4fa61fadbb467e022d571851b6237 100644 (file)
@@ -56,7 +56,7 @@ public class SearchActionIT {
   public UserSessionRule userSession = UserSessionRule.standalone();
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final DbClient dbClient = db.getDbClient();
   private final SearchAction underTest = new SearchAction(dbClient, userSession,
index ed3491cb6a069f183f77c6eaa795ee1fc67267b6..f1aa83aeb3455c9327c3dcb487dfa510a6a1e483 100644 (file)
@@ -53,7 +53,7 @@ public class SearchGroupsActionIT {
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final QualityGatesWsSupport wsSupport = new QualityGatesWsSupport(db.getDbClient(), userSession, TestComponentFinder.from(db));
 
index b42f0f7339856504de3b36af726d987bd29fd384..ab23240656c62c1b5ed5abbad41da7bab33277f7 100644 (file)
@@ -52,7 +52,7 @@ public class SearchUsersActionIT {
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final QualityGatesWsSupport wsSupport = new QualityGatesWsSupport(db.getDbClient(), userSession, TestComponentFinder.from(db));
   private AvatarResolver avatarResolver = new FakeAvatarResolver();
index fedcf65c942f11e25eb20c35cc077e3b07db9cf1..8d81172c6278341d335c7d5916a228d0fcf03f59 100644 (file)
@@ -58,7 +58,7 @@ public class QProfileComparisonIT {
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone().anonymous();
   @Rule
-  public DbTester dbTester = DbTester.create();
+  public DbTester dbTester = DbTester.create(true);
   @Rule
   public EsTester es = EsTester.create();
 
index e26eac8c0b86d2932a5e5015025a6819efa15189..ff82030a2b87cbf186f44cfe76e3b131a86734eb 100644 (file)
@@ -56,7 +56,7 @@ public class QProfileResetImplIT {
   private static final String LANGUAGE = "xoo";
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
 
index 6de0361ea53610a393f92535390939d12ba0eb12..508bae0782c9f0609c0bae6b85e171293975db93 100644 (file)
@@ -55,7 +55,7 @@ public class QProfileRulesImplIT {
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public EsTester es = EsTester.create();
 
index 631c741d34ef3fb951dd2076adc1daf31bcce083..651c85e5913de07a7ee7716dffbc13b21770ad53 100644 (file)
@@ -59,7 +59,7 @@ public class BuiltInQProfileInsertImplIT {
   @Rule
   public BuiltInQProfileRepositoryRule builtInQProfileRepository = new BuiltInQProfileRepositoryRule();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final System2 system2 = new AlwaysIncreasingSystem2();
   private final UuidFactory uuidFactory = new SequenceUuidFactory();
index 6f4f752b79941c1f13acf07a23cff3d2d080e64c..6dc286ae50138f32b0ea21d8af7a16488798ce8d 100644 (file)
@@ -50,7 +50,7 @@ public class BuiltInQProfileRepositoryImplIT {
   private static final String SONAR_WAY_QP_NAME = "Sonar way";
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final DbClient dbClient = db.getDbClient();
   private final ServerRuleFinder ruleFinder = new DefaultRuleFinder(dbClient, mock(RuleDescriptionFormatter.class));
index 71c4a03af9377bde17f40c824052cde4d0626067..afe413d6b0f37f3efbddb629b8b489c6affe708e 100644 (file)
@@ -80,7 +80,7 @@ public class BuiltInQProfileUpdateImplIT {
   @Rule
   public BuiltInQProfileRepositoryRule builtInProfileRepository = new BuiltInQProfileRepositoryRule();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   private System2 system2 = new TestSystem2().setNow(NOW);
index 208dc9ee6f9ebf355e3616797a8ba1372ca096d2..d98d870c19662c26fb4fa9105c71b6bf3e1778a6 100644 (file)
@@ -64,7 +64,7 @@ import static org.sonar.server.qualityprofile.ActiveRuleInheritance.OVERRIDES;
  */
 public class RuleActivatorIT {
   @Rule
-  public final DbTester db = DbTester.create();
+  public final DbTester db = DbTester.create(true);
 
   @Rule
   public final UserSessionRule userSession = UserSessionRule.standalone();
index f982f31eae7cdbec6d25b7e5d8c6ad44f8784196..4508853dbd0ae485034c770218fd2a8c5177de7b 100644 (file)
@@ -61,7 +61,7 @@ import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.
 public class ActivateRuleActionIT {
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
 
index c2cf53926db30a48900bd5ce6a768b6499fd17cc..2347b25850cbb1364a4e2e853ba533629aa8f9a3 100644 (file)
@@ -50,7 +50,7 @@ import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.
 public class ActivateRulesActionIT {
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
 
index 64fa9ff5ce97dc3e3787b31225b8abdc097f2790..83ca536267ba387e1b89df40c7ba7c303a35f575 100644 (file)
@@ -53,7 +53,7 @@ public class AddGroupActionIT {
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final QProfileWsSupport wsSupport = new QProfileWsSupport(db.getDbClient(), userSession);
   private final UuidFactory uuidFactory = UuidFactoryFast.getInstance();
index 4edf4521f9a23af5476cdc46cbbff04f5f835084..1ba8e2516083c5d921485f7c09534c0bd153443f 100644 (file)
@@ -56,7 +56,7 @@ public class AddProjectActionIT {
   private static final String LANGUAGE_2 = "foo";
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
 
index a1cdf072a4013dbda91f1ab4b1419dffdc21abb5..44fad8bc8bc0d3a0d11334a7d028f620626149c1 100644 (file)
@@ -52,7 +52,7 @@ public class AddUserActionIT {
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final QProfileWsSupport wsSupport = new QProfileWsSupport(db.getDbClient(), userSession);
   private final UuidFactory uuidFactory = UuidFactoryFast.getInstance();
index 0159f070a83eb9159dd5feebb07416480c8a4de9..b102fbe3c83b4dcde3c849de25bc4c160c39745b 100644 (file)
@@ -43,7 +43,7 @@ public class BackupActionIT {
   private static final String A_LANGUAGE = "xoo";
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
 
index 0e5274a4673e9da8a2430d79f2f613e970120ba3..3186746766d1c6024b95a471f904609eff0cdafd 100644 (file)
@@ -51,7 +51,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
 public class CompareActionIT {
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public UserSessionRule userSessionRule = UserSessionRule.standalone();
   @Rule
index 9433d00d9b4621f0a73fecd392b0bfc39b04759b..f8233a8433f52e9239953663a8565f876d20afdb 100644 (file)
@@ -57,7 +57,7 @@ public class CopyActionIT {
   private static final String A_LANGUAGE = "lang1";
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
index 0bf5c551208261b5cafe607732bec3ba0344630d..57eb50793df22cbd1484013806f7818dc4b72b82 100644 (file)
@@ -76,7 +76,7 @@ public class CreateActionIT {
     .setLanguage(XOO_LANGUAGE);
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public EsTester es = EsTester.create();
   @Rule
index f49a9e7e3abf40f46b09b0892b6443ea1910bf69..39b4157ddb9b5bab1f857ed59b77993f68047cfb 100644 (file)
@@ -57,7 +57,7 @@ import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.
 
 public class DeactivateRuleActionIT {
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
 
index 3e51f51ec0421beef286071c2757cc553e263f52..c05829c33706ed9f328cbb6d9cf474fc8cc2dd38 100644 (file)
@@ -51,7 +51,7 @@ import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.
 public class DeactivateRulesActionIT {
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
 
index ef5abc51e4b60ed7343f2fc2f77ceac2ef159c45..a2710a9452f8de11b9e0007864dd4495c0886707 100644 (file)
@@ -69,7 +69,7 @@ import static org.sonarqube.ws.client.qualityprofile.QualityProfileWsParameters.
 public class InheritanceActionIT {
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public EsTester es = EsTester.create();
   @Rule
index 0feff039eecf250de2fafa177e12ae0039f923ec..0d580f32b7993f6be80b9917d33e07f084c832cb 100644 (file)
@@ -36,7 +36,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
 public class QProfileWsSupportIT {
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
 
index 2318e4b081900574e2a5dc70e43c8376a2f88b8d..4fe7fbe111e312dbb345a59e1f7f9384f4529dc6 100644 (file)
@@ -76,7 +76,7 @@ public class QProfilesWsMediumIT {
   @Rule
   public EsTester es = EsTester.create();
   @Rule
-  public DbTester dbTester = DbTester.create();
+  public DbTester dbTester = DbTester.create(true);
 
   private final DbClient dbClient = dbTester.getDbClient();
   private final DbSession dbSession = dbTester.getSession();
index bc06530287b08bd385e947ad9dae026ac43256ab..62e5b52b1a337892440bdaa1f14dd9aec43afaa0 100644 (file)
@@ -51,7 +51,7 @@ public class RemoveGroupActionIT {
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final QProfileWsSupport wsSupport = new QProfileWsSupport(db.getDbClient(), userSession);
 
index 38ac097dd0df8c383409217d6c3c0ac7bab120fe..32b7603bf9061afefec94f6f2b910853dbdf8434 100644 (file)
@@ -57,7 +57,7 @@ public class RemoveProjectActionIT {
   private static final String LANGUAGE_2 = "foo";
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
 
index 1a6dd87dc9e00be2552aca54eae260ce77a61192..e1635e66bc42fc0bc9619e47214315d152e4d40c 100644 (file)
@@ -51,7 +51,7 @@ public class RemoveUserActionIT {
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final QProfileWsSupport wsSupport = new QProfileWsSupport(db.getDbClient(), userSession);
   private final WsActionTester ws = new WsActionTester(new RemoveUserAction(db.getDbClient(), wsSupport, LANGUAGES));
index 2d86a4125c5712e4fcff3bb6781482b8e90d18d4..4c7276347c684af592c297125ff1eafa51fb174c 100644 (file)
@@ -52,7 +52,7 @@ public class RestoreActionIT {
   private static final String A_LANGUAGE = "xoo";
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
 
index 87ca9310452dee6e9c500c1eda8b0d30acebf889..68db8044d86076b1cb8c6a82b37248a2debe8c47 100644 (file)
@@ -58,7 +58,7 @@ public class SearchGroupsActionIT {
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final QProfileWsSupport wsSupport = new QProfileWsSupport(db.getDbClient(), userSession);
 
index 3b7a78200973efe44d4a2be59356d46e68ce1606..e9e2295d9fbab765642ddbc26c057757eed2ce3b 100644 (file)
@@ -60,7 +60,7 @@ public class SearchUsersActionIT {
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final QProfileWsSupport wsSupport = new QProfileWsSupport(db.getDbClient(), userSession);
   private AvatarResolver avatarResolver = new FakeAvatarResolver();
index c2c51efd83e186c3f2bfc85fcad7f518db1b3a89..1656c5a62eff31a8ebcc2fee8826edc9e8a97226 100644 (file)
@@ -50,7 +50,7 @@ public class SetDefaultActionIT {
   private static final String XOO_2_KEY = "xoo2";
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public UserSessionRule userSessionRule = UserSessionRule.standalone();
 
index c7fc1eb58de0023f946248780682147af5c2e453..c954374da914716bcecea6828cd80d940774e030 100644 (file)
@@ -62,7 +62,7 @@ public class ShowActionIT {
   @Rule
   public EsTester es = EsTester.create();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
 
index 7b7bdad00e91fa55cf0496dc897ea2a63477e696..a24307be57b4cc399b02220d8e0f37d3c85b37f6 100644 (file)
@@ -34,7 +34,7 @@ import static org.assertj.core.api.Assertions.assertThat;
 public class ActiveRuleCompleterIT {
 
   @Rule
-  public DbTester dbTester = DbTester.create();
+  public DbTester dbTester = DbTester.create(true);
 
   @Test
   public void test_completeShow() {
index ccfc4d18a6d820c262e00a2d4673208ac291dc8e..0dc5c7899510d947a5bcaec9fdd5f2b6144b4766 100644 (file)
@@ -50,7 +50,7 @@ public class DeleteActionIT {
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
-  public DbTester dbTester = DbTester.create();
+  public DbTester dbTester = DbTester.create(true);
   @Rule
   public EsTester es = EsTester.create();
   private DbClient dbClient = dbTester.getDbClient();
index eb34ca1e80645e93171bcc493b4923feb0243652..34745ad134919e4425851d7360a5689a75b8d9a8 100644 (file)
@@ -82,7 +82,7 @@ public class ShowActionIT {
   @org.junit.Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   @org.junit.Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final UuidFactory uuidFactory = UuidFactoryFast.getInstance();
   private final MacroInterpreter macroInterpreter = mock(MacroInterpreter.class);
index 04bbeba89810ec8629fbe831d6a010238099b017..cb2daec3685f7faa96ea10a68c2e5cf818387280 100644 (file)
@@ -43,7 +43,7 @@ public class TagsActionIT {
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public EsTester es = EsTester.create();
 
index 0280eaec457a18f979b35303aedf3d52f712e439..910c687bb4ae0607dbc3df3b1047c8b75d461bb1 100644 (file)
@@ -72,7 +72,7 @@ public class UpdateActionIT {
   private static final long PAST = 10000L;
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   @Rule
   public EsTester es = EsTester.create();
index fbf818e71525073280f40c218a412115a2684a50..aeeb6fedb9e34d66aa85b015a021f972ba66e7fe 100644 (file)
@@ -47,7 +47,7 @@ public class MarketplaceActionIT {
   @Rule
   public UserSessionRule userSessionRule = UserSessionRule.standalone();
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private final Server server = mock(Server.class);
   private final DbClient dbClient = db.getDbClient();
index 83b30b34dba7639605a931e644814b88298c3b81..291a79ef12b65604d291570942629c99812e25bf 100644 (file)
@@ -69,7 +69,7 @@ public class ChangePasswordActionIT {
   private static final String NEW_PASSWORD = "12345";
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public UserSessionRule userSessionRule = UserSessionRule.standalone().logIn();
 
index af07217feddf3b004a5a7203c701027371e1eb89..951bb1c1e622600119a825071295922c6a725ec8 100644 (file)
@@ -53,7 +53,7 @@ public class GroupsActionIT {
   private static final String USER_LOGIN = "john";
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone().logIn().addPermission(GlobalPermission.ADMINISTER);
index 4a4c315715d284b3573a2230a0e1932856d141ef..4d498fea5d96c9f4374ce07d05a2eee807677250 100644 (file)
@@ -69,7 +69,7 @@ public class SearchActionIT {
   public UserSessionRule userSession = UserSessionRule.standalone();
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
 
   private ManagedInstanceService managedInstanceService = mock(ManagedInstanceService.class);
   private WsActionTester ws = new WsActionTester(new SearchAction(userSession, db.getDbClient(), new AvatarResolverImpl(), managedInstanceService));
index 125339b82ba602e830467f37e1cadbbb6d622934..afd973ef4b255faeb713fce24e2c01aac1d5ef4b 100644 (file)
@@ -59,7 +59,7 @@ public class UpdateIdentityProviderActionIT {
     .addIdentityProvider(new TestIdentityProvider().setName("Github").setKey("github").setEnabled(true));
 
   @Rule
-  public DbTester db = DbTester.create();
+  public DbTester db = DbTester.create(true);
   @Rule
   public UserSessionRule userSession = UserSessionRule.standalone().logIn().setSystemAdministrator();
 
index 99e37b6d9ed468c1703c905b1d6d6d2a9c6f6cda..45223f39d8062293d7f2f24eea2021055ffa2ad0 100644 (file)
@@ -27,7 +27,7 @@ import org.sonar.ce.task.CeTask;
 import org.sonar.db.DbClient;
 import org.sonar.db.DbSession;
 import org.sonar.db.ce.CeTaskTypes;
-import org.sonar.db.component.ComponentDto;
+import org.sonar.db.project.ProjectDto;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static java.util.Collections.emptyMap;
@@ -48,11 +48,11 @@ public class ExportSubmitterImpl implements ExportSubmitter {
     requireNonNull(projectKey, "Project key can not be null");
 
     try (DbSession dbSession = dbClient.openSession(false)) {
-      Optional<ComponentDto> mainBranch = dbClient.componentDao().selectByKey(dbSession, projectKey);
-      checkArgument(mainBranch.isPresent(), "Project with key [%s] does not exist", projectKey);
+      Optional<ProjectDto> project = dbClient.projectDao().selectProjectByKey(dbSession, projectKey);
+      checkArgument(project.isPresent(), "Project with key [%s] does not exist", projectKey);
 
       CeTaskSubmit submit = ceQueue.prepareSubmit()
-        .setComponent(fromDto(mainBranch.get().uuid(), mainBranch.get().uuid()))
+        .setComponent(fromDto(project.get().getUuid(), project.get().getUuid()))
         .setType(CeTaskTypes.PROJECT_EXPORT)
         .setSubmitterUuid(submitterUuid)
         .setCharacteristics(emptyMap())