Search in sources :

Example 1 with ResourceTypes

use of org.sonar.api.resources.ResourceTypes in project sonarqube by SonarSource.

the class GlobalActionTest method init.

private void init(org.sonar.api.web.page.Page[] pages, ResourceTypeTree[] resourceTypeTrees) {
    when(dbClient.getDatabase().getDialect()).thenReturn(new H2());
    when(server.getVersion()).thenReturn("6.42");
    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 GlobalAction(pageRepository, settings, new ResourceTypes(resourceTypeTrees), server, dbClient, organizationFlags));
}
Also used : ResourceTypes(org.sonar.api.resources.ResourceTypes) PluginRepository(org.sonar.core.platform.PluginRepository) PageRepository(org.sonar.server.ui.PageRepository) H2(org.sonar.db.dialect.H2) Page(org.sonar.api.web.page.Page) WsActionTester(org.sonar.server.ws.WsActionTester)

Aggregations

ResourceTypes (org.sonar.api.resources.ResourceTypes)1 Page (org.sonar.api.web.page.Page)1 PluginRepository (org.sonar.core.platform.PluginRepository)1 H2 (org.sonar.db.dialect.H2)1 PageRepository (org.sonar.server.ui.PageRepository)1 WsActionTester (org.sonar.server.ws.WsActionTester)1