Search in sources :

Example 1 with I18n

use of org.sonar.api.i18n.I18n in project sonarqube by SonarSource.

the class PersistProjectLinksStepTest method setup.

@Before
public void setup() {
    I18n i18n = mock(I18n.class);
    when(i18n.message(Locale.ENGLISH, "project_links.homepage", null)).thenReturn("Home");
    when(i18n.message(Locale.ENGLISH, "project_links.scm", null)).thenReturn("Sources");
    when(i18n.message(Locale.ENGLISH, "project_links.scm_dev", null)).thenReturn("Developer connection");
    when(i18n.message(Locale.ENGLISH, "project_links.ci", null)).thenReturn("Continuous integration");
    when(i18n.message(Locale.ENGLISH, "project_links.issue", null)).thenReturn("Issues");
    step = new PersistProjectLinksStep(dbTester.getDbClient(), i18n, treeRootHolder, reportReader);
}
Also used : I18n(org.sonar.api.i18n.I18n) Before(org.junit.Before)

Example 2 with I18n

use of org.sonar.api.i18n.I18n 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)2 I18n (org.sonar.api.i18n.I18n)2 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