Search in sources :

Example 26 with WsActionTester

use of org.sonar.server.ws.WsActionTester 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)

Example 27 with WsActionTester

use of org.sonar.server.ws.WsActionTester in project sonarqube by SonarSource.

the class UploadActionTest method setUp.

@Before
public void setUp() throws Exception {
    pluginDirectory = folder.newFolder();
    when(fileSystem.getDownloadedPluginsDir()).thenReturn(pluginDirectory);
    wsTester = new WsActionTester(new UploadAction(userSession, fileSystem));
}
Also used : WsActionTester(org.sonar.server.ws.WsActionTester) Before(org.junit.Before)

Aggregations

WsActionTester (org.sonar.server.ws.WsActionTester)27 Before (org.junit.Before)21 ComponentFinder (org.sonar.server.component.ComponentFinder)13 Page (org.sonar.api.web.page.Page)3 PluginRepository (org.sonar.core.platform.PluginRepository)3 NotificationCenter (org.sonar.server.notification.NotificationCenter)3 NotificationDispatcherMetadata (org.sonar.server.notification.NotificationDispatcherMetadata)3 NotificationUpdater (org.sonar.server.notification.NotificationUpdater)3 PageRepository (org.sonar.server.ui.PageRepository)3 Test (org.junit.Test)2 NotificationChannel (org.sonar.api.notifications.NotificationChannel)2 ComponentDto (org.sonar.db.component.ComponentDto)2 I18n (org.sonar.api.i18n.I18n)1 Languages (org.sonar.api.resources.Languages)1 ResourceTypes (org.sonar.api.resources.ResourceTypes)1 UuidFactory (org.sonar.core.util.UuidFactory)1 DbClient (org.sonar.db.DbClient)1 SnapshotDto (org.sonar.db.component.SnapshotDto)1 H2 (org.sonar.db.dialect.H2)1 IssueDto (org.sonar.db.issue.IssueDto)1