Search in sources :

Example 11 with ComponentFinder

use of org.sonar.server.component.ComponentFinder in project sonarqube by SonarSource.

the class IssuesActionTest method before.

@Before
public void before() {
    IssueIndex issueIndex = new IssueIndex(es.client(), system2, userSessionRule, new AuthorizationTypeSupport(userSessionRule));
    IssuesAction issuesAction = new IssuesAction(db.getDbClient(), issueIndex, userSessionRule, new ComponentFinder(db.getDbClient()));
    tester = new WsTester(new BatchWs(issuesAction));
}
Also used : ComponentFinder(org.sonar.server.component.ComponentFinder) WsTester(org.sonar.server.ws.WsTester) IssueIndex(org.sonar.server.issue.index.IssueIndex) AuthorizationTypeSupport(org.sonar.server.permission.index.AuthorizationTypeSupport) Before(org.junit.Before)

Example 12 with ComponentFinder

use of org.sonar.server.component.ComponentFinder in project sonarqube by SonarSource.

the class AppActionTest method setUp.

@Before
public void setUp() {
    insertMetrics();
    wsTester = new WsTester(new ComponentsWs(new AppAction(dbTester.getDbClient(), userSessionRule, new ComponentFinder(dbTester.getDbClient())), mock(SuggestionsAction.class)));
}
Also used : ComponentFinder(org.sonar.server.component.ComponentFinder) WsTester(org.sonar.server.ws.WsTester) Before(org.junit.Before)

Example 13 with ComponentFinder

use of org.sonar.server.component.ComponentFinder in project sonarqube by SonarSource.

the class TreeActionTest method setUp.

@Before
public void setUp() {
    ws = new WsActionTester(new TreeAction(dbClient, new ComponentFinder(dbClient), resourceTypes, userSession, Mockito.mock(I18n.class)));
    resourceTypes.setChildrenQualifiers(Qualifiers.MODULE, Qualifiers.FILE, Qualifiers.DIRECTORY);
    resourceTypes.setLeavesQualifiers(Qualifiers.FILE, Qualifiers.UNIT_TEST_FILE);
}
Also used : ComponentFinder(org.sonar.server.component.ComponentFinder) WsActionTester(org.sonar.server.ws.WsActionTester) I18n(org.sonar.api.i18n.I18n) Before(org.junit.Before)

Example 14 with ComponentFinder

use of org.sonar.server.component.ComponentFinder in project sonarqube by SonarSource.

the class ShowActionTest method setUp.

@Before
public void setUp() {
    tester = new WsTester(new DuplicationsWs(new ShowAction(db.getDbClient(), parser, duplicationsJsonWriter, userSessionRule, new ComponentFinder(db.getDbClient()))));
    db.getDbClient().metricDao().insert(db.getSession(), dataMetric);
    db.commit();
}
Also used : ComponentFinder(org.sonar.server.component.ComponentFinder) WsTester(org.sonar.server.ws.WsTester) Before(org.junit.Before)

Example 15 with ComponentFinder

use of org.sonar.server.component.ComponentFinder in project sonarqube by SonarSource.

the class SearchActionTest method setUp.

@Before
public void setUp() {
    CustomMeasureJsonWriter customMeasureJsonWriter = new CustomMeasureJsonWriter(new UserJsonWriter(userSessionRule));
    ws = new WsTester(new CustomMeasuresWs(new SearchAction(dbClient, customMeasureJsonWriter, userSessionRule, new ComponentFinder(dbClient))));
    defaultProject = insertDefaultProject();
    userSessionRule.logIn().addProjectUuidPermissions(UserRole.ADMIN, defaultProject.uuid());
    db.getDbClient().userDao().insert(dbSession, new UserDto().setLogin("login").setName("Login").setEmail("login@login.com").setActive(true));
    dbSession.commit();
}
Also used : ComponentFinder(org.sonar.server.component.ComponentFinder) WsTester(org.sonar.server.ws.WsTester) UserJsonWriter(org.sonar.server.user.ws.UserJsonWriter) UserDto(org.sonar.db.user.UserDto) Before(org.junit.Before)

Aggregations

ComponentFinder (org.sonar.server.component.ComponentFinder)24 Before (org.junit.Before)23 WsActionTester (org.sonar.server.ws.WsActionTester)13 WsTester (org.sonar.server.ws.WsTester)11 NotificationChannel (org.sonar.api.notifications.NotificationChannel)2 UserDto (org.sonar.db.user.UserDto)2 NotificationCenter (org.sonar.server.notification.NotificationCenter)2 NotificationDispatcherMetadata (org.sonar.server.notification.NotificationDispatcherMetadata)2 NotificationUpdater (org.sonar.server.notification.NotificationUpdater)2 UserJsonWriter (org.sonar.server.user.ws.UserJsonWriter)2 Matchers.anyString (org.mockito.Matchers.anyString)1 InvocationOnMock (org.mockito.invocation.InvocationOnMock)1 I18n (org.sonar.api.i18n.I18n)1 Languages (org.sonar.api.resources.Languages)1 Page (org.sonar.api.web.page.Page)1 PluginRepository (org.sonar.core.platform.PluginRepository)1 DbClient (org.sonar.db.DbClient)1 ComponentDao (org.sonar.db.component.ComponentDao)1 IssueIndex (org.sonar.server.issue.index.IssueIndex)1 AuthorizationTypeSupport (org.sonar.server.permission.index.AuthorizationTypeSupport)1