Search in sources :

Example 21 with ComponentFinder

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

the class IndexActionTest method setUp.

@Before
public void setUp() {
    when(dbClient.componentDao()).thenReturn(componentDao);
    when(dbClient.openSession(false)).thenReturn(session);
    tester = new WsTester(new SourcesWs(new IndexAction(dbClient, sourceService, userSessionRule, new ComponentFinder(dbClient))));
}
Also used : ComponentFinder(org.sonar.server.component.ComponentFinder) WsTester(org.sonar.server.ws.WsTester) Before(org.junit.Before)

Example 22 with ComponentFinder

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

the class RawActionTest method setUp.

@Before
public void setUp() {
    when(dbClient.componentDao()).thenReturn(componentDao);
    when(dbClient.openSession(false)).thenReturn(session);
    tester = new WsTester(new SourcesWs(new RawAction(dbClient, sourceService, userSessionRule, new ComponentFinder(dbClient))));
}
Also used : ComponentFinder(org.sonar.server.component.ComponentFinder) WsTester(org.sonar.server.ws.WsTester) Before(org.junit.Before)

Example 23 with ComponentFinder

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

the class ShowActionTest method setUp.

@Before
public void setUp() {
    when(dbClient.componentDao()).thenReturn(componentDao);
    when(dbClient.openSession(false)).thenReturn(session);
    tester = new WsTester(new SourcesWs(new ShowAction(sourceService, dbClient, userSessionRule, new ComponentFinder(dbClient))));
}
Also used : ComponentFinder(org.sonar.server.component.ComponentFinder) WsTester(org.sonar.server.ws.WsTester) Before(org.junit.Before)

Example 24 with ComponentFinder

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

the class ComponentActionTest method init.

private void init(Page... pages) {
    PluginRepository pluginRepository = mock(PluginRepository.class);
    when(pluginRepository.hasPlugin(anyString())).thenReturn(true);
    PageRepository pageRepository = new PageRepository(pluginRepository, new PageDefinition[] { context -> {
        for (Page page : pages) {
            context.addPage(page);
        }
    } });
    pageRepository.start();
    ws = new WsActionTester(new ComponentAction(dbClient, pageRepository, resourceTypes, userSession, new ComponentFinder(dbClient), new QualityGateFinder(dbClient)));
}
Also used : ComponentFinder(org.sonar.server.component.ComponentFinder) PluginRepository(org.sonar.core.platform.PluginRepository) PageRepository(org.sonar.server.ui.PageRepository) Page(org.sonar.api.web.page.Page) QualityGateFinder(org.sonar.server.qualitygate.QualityGateFinder) WsActionTester(org.sonar.server.ws.WsActionTester)

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