Search in sources :

Example 1 with QProfileService

use of org.sonar.server.qualityprofile.QProfileService in project sonarqube by SonarSource.

the class QProfilesWsTest method setUp.

@Before
public void setUp() {
    QProfileService profileService = mock(QProfileService.class);
    I18n i18n = mock(I18n.class);
    DbClient dbClient = mock(DbClient.class);
    Languages languages = LanguageTesting.newLanguages(xoo1Key, xoo2Key);
    ProjectAssociationParameters projectAssociationParameters = new ProjectAssociationParameters(languages);
    ProfileImporter[] importers = createImporters(languages);
    controller = new WsTester(new QProfilesWs(new RuleActivationActions(profileService), new BulkRuleActivationActions(profileService, null), new AddProjectAction(projectAssociationParameters, null, null, dbClient), new RemoveProjectAction(projectAssociationParameters, null, null, dbClient), new CreateAction(null, null, null, languages, wsSupport, null, importers), new ImportersAction(importers), new RestoreBuiltInAction(null, languages, wsSupport), new SearchAction(null, languages), new SetDefaultAction(languages, null, null, wsSupport), new ProjectsAction(null, userSessionRule), new BackupAction(dbClient, null, null, languages), new RestoreAction(null, languages, wsSupport), new ChangelogAction(null, mock(QProfileFactory.class), languages, dbClient), new ChangeParentAction(dbClient, null, null, languages, wsSupport), new CompareAction(null, null, languages), new CopyAction(null, languages, wsSupport), new DeleteAction(languages, null, null, wsSupport), new ExportAction(null, null, mock(QProfileExporters.class), languages), new ExportersAction(), new InheritanceAction(null, null, null, null, languages), new RenameAction(null, wsSupport))).controller(QProfilesWs.API_ENDPOINT);
}
Also used : Languages(org.sonar.api.resources.Languages) WsTester(org.sonar.server.ws.WsTester) ProfileImporter(org.sonar.api.profiles.ProfileImporter) I18n(org.sonar.api.i18n.I18n) QProfileExporters(org.sonar.server.qualityprofile.QProfileExporters) QProfileFactory(org.sonar.server.qualityprofile.QProfileFactory) DbClient(org.sonar.db.DbClient) QProfileService(org.sonar.server.qualityprofile.QProfileService) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 I18n (org.sonar.api.i18n.I18n)1 ProfileImporter (org.sonar.api.profiles.ProfileImporter)1 Languages (org.sonar.api.resources.Languages)1 DbClient (org.sonar.db.DbClient)1 QProfileExporters (org.sonar.server.qualityprofile.QProfileExporters)1 QProfileFactory (org.sonar.server.qualityprofile.QProfileFactory)1 QProfileService (org.sonar.server.qualityprofile.QProfileService)1 WsTester (org.sonar.server.ws.WsTester)1