use of org.sonar.server.ui.PageRepository 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));
}
use of org.sonar.server.ui.PageRepository in project sonarqube by SonarSource.
the class SettingsActionTest 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);
}
} });
ws = new WsActionTester(new SettingsAction(pageRepository, settings, userSessionRule));
pageRepository.start();
}
use of org.sonar.server.ui.PageRepository 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)));
}
Aggregations