@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();
public class TokenActionIT {
@Rule
- public DbTester db = DbTester.create();
+ public DbTester db = DbTester.create(true);
@Rule
public UserSessionRule userSession = UserSessionRule.standalone();
@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));
.toArray(RuleType[]::new);
@Rule
- public DbTester db = DbTester.create();
+ public DbTester db = DbTester.create(true);
@Rule
public EsTester es = EsTester.create();
@Rule
public class SearchEventsActionQualityGateIT {
@Rule
- public DbTester db = DbTester.create();
+ public DbTester db = DbTester.create(true);
@Rule
public EsTester es = EsTester.create();
@Rule
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));
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());
public class ShowResponseBuilderIT {
@Rule
- public DbTester db = DbTester.create();
+ public DbTester db = DbTester.create(true);
private ShowResponseBuilder underTest = new ShowResponseBuilder(db.getDbClient().componentDao());
@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();
@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);
@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);
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);
public UserSessionRule userSession = UserSessionRule.standalone();
@Rule
- public DbTester db = DbTester.create();
+ public DbTester db = DbTester.create(true);
private IssueFieldsSetter issueUpdater = new IssueFieldsSetter();
public UserSessionRule userSession = UserSessionRule.standalone();
@Rule
- public DbTester db = DbTester.create();
+ public DbTester db = DbTester.create(true);
private IssueFieldsSetter issueUpdater = new IssueFieldsSetter();
public class TransitionServiceIT {
@Rule
- public DbTester db = DbTester.create();
+ public DbTester db = DbTester.create(true);
@Rule
public UserSessionRule userSession = UserSessionRule.standalone();
public class DeleteCommentActionIT {
@Rule
- public DbTester dbTester = DbTester.create();
+ public DbTester dbTester = DbTester.create(true);
@Rule
public UserSessionRule userSession = UserSessionRule.standalone();
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();
@Rule
public EsTester es = EsTester.create();
@Rule
- public DbTester db = DbTester.create();
+ public DbTester db = DbTester.create(true);
@Rule
public UserSessionRule userSession = UserSessionRule.standalone();
public class SetSeverityActionIT {
@Rule
- public DbTester dbTester = DbTester.create();
+ public DbTester dbTester = DbTester.create(true);
@Rule
public EsTester es = EsTester.create();
@Rule
public class SetTypeActionIT {
@Rule
- public DbTester dbTester = DbTester.create();
+ public DbTester dbTester = DbTester.create(true);
@Rule
public EsTester es = EsTester.create();
@Rule
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
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;
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);
@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();
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);
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);
public class ApplyTemplateActionIT extends BasePermissionWsIT<ApplyTemplateAction> {
@Rule
- public DbTester dbTester = DbTester.create();
+ public DbTester dbTester = DbTester.create(true);
private UserDto user1;
private UserDto user2;
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);
public class ProjectFinderIT {
@Rule
- public DbTester db = DbTester.create();
+ public DbTester db = DbTester.create(true);
@Rule
public UserSessionRule userSession = UserSessionRule.standalone();
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)));
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());
@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();
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;
@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
}
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)
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;
@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);
}
@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();
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();
public class DeleteConditionActionIT {
@Rule
- public DbTester db = DbTester.create();
+ public DbTester db = DbTester.create(true);
@Rule
public UserSessionRule userSession = UserSessionRule.standalone();
@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);
@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);
@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));
@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));
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,
@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));
@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();
@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();
private static final String LANGUAGE = "xoo";
@Rule
- public DbTester db = DbTester.create();
+ public DbTester db = DbTester.create(true);
@Rule
public UserSessionRule userSession = UserSessionRule.standalone();
@Rule
public UserSessionRule userSession = UserSessionRule.standalone();
@Rule
- public DbTester db = DbTester.create();
+ public DbTester db = DbTester.create(true);
@Rule
public EsTester es = EsTester.create();
@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();
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));
@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);
*/
public class RuleActivatorIT {
@Rule
- public final DbTester db = DbTester.create();
+ public final DbTester db = DbTester.create(true);
@Rule
public final UserSessionRule userSession = UserSessionRule.standalone();
public class ActivateRuleActionIT {
@Rule
- public DbTester db = DbTester.create();
+ public DbTester db = DbTester.create(true);
@Rule
public UserSessionRule userSession = UserSessionRule.standalone();
public class ActivateRulesActionIT {
@Rule
- public DbTester db = DbTester.create();
+ public DbTester db = DbTester.create(true);
@Rule
public UserSessionRule userSession = UserSessionRule.standalone();
@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();
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();
@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();
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();
public class CompareActionIT {
@Rule
- public DbTester db = DbTester.create();
+ public DbTester db = DbTester.create(true);
@Rule
public UserSessionRule userSessionRule = UserSessionRule.standalone();
@Rule
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
.setLanguage(XOO_LANGUAGE);
@Rule
- public DbTester db = DbTester.create();
+ public DbTester db = DbTester.create(true);
@Rule
public EsTester es = EsTester.create();
@Rule
public class DeactivateRuleActionIT {
@Rule
- public DbTester db = DbTester.create();
+ public DbTester db = DbTester.create(true);
@Rule
public UserSessionRule userSession = UserSessionRule.standalone();
public class DeactivateRulesActionIT {
@Rule
- public DbTester db = DbTester.create();
+ public DbTester db = DbTester.create(true);
@Rule
public UserSessionRule userSession = UserSessionRule.standalone();
public class InheritanceActionIT {
@Rule
- public DbTester db = DbTester.create();
+ public DbTester db = DbTester.create(true);
@Rule
public EsTester es = EsTester.create();
@Rule
public class QProfileWsSupportIT {
@Rule
- public DbTester db = DbTester.create();
+ public DbTester db = DbTester.create(true);
@Rule
public UserSessionRule userSession = UserSessionRule.standalone();
@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();
@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 static final String LANGUAGE_2 = "foo";
@Rule
- public DbTester db = DbTester.create();
+ public DbTester db = DbTester.create(true);
@Rule
public UserSessionRule userSession = UserSessionRule.standalone();
@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));
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();
@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);
@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();
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();
@Rule
public EsTester es = EsTester.create();
@Rule
- public DbTester db = DbTester.create();
+ public DbTester db = DbTester.create(true);
@Rule
public UserSessionRule userSession = UserSessionRule.standalone();
public class ActiveRuleCompleterIT {
@Rule
- public DbTester dbTester = DbTester.create();
+ public DbTester dbTester = DbTester.create(true);
@Test
public void test_completeShow() {
@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();
@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);
@Rule
public UserSessionRule userSession = UserSessionRule.standalone();
@Rule
- public DbTester db = DbTester.create();
+ public DbTester db = DbTester.create(true);
@Rule
public EsTester es = EsTester.create();
private static final long PAST = 10000L;
@Rule
- public DbTester db = DbTester.create();
+ public DbTester db = DbTester.create(true);
@Rule
public EsTester es = EsTester.create();
@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();
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();
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);
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));
.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();
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;
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())