Search in sources :

Example 6 with ProfileImporter

use of org.sonar.api.profiles.ProfileImporter 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

ProfileImporter (org.sonar.api.profiles.ProfileImporter)6 RulesProfile (org.sonar.api.profiles.RulesProfile)2 ValidationMessages (org.sonar.api.utils.ValidationMessages)2 InputStream (java.io.InputStream)1 Reader (java.io.Reader)1 Before (org.junit.Before)1 I18n (org.sonar.api.i18n.I18n)1 Languages (org.sonar.api.resources.Languages)1 NewAction (org.sonar.api.server.ws.WebService.NewAction)1 JsonWriter (org.sonar.api.utils.text.JsonWriter)1 DbClient (org.sonar.db.DbClient)1 QualityProfileDto (org.sonar.db.qualityprofile.QualityProfileDto)1 QProfileExporters (org.sonar.server.qualityprofile.QProfileExporters)1 QProfileFactory (org.sonar.server.qualityprofile.QProfileFactory)1 QProfileResult (org.sonar.server.qualityprofile.QProfileResult)1 QProfileService (org.sonar.server.qualityprofile.QProfileService)1 WsTester (org.sonar.server.ws.WsTester)1