use of org.sonarqube.ws.client.settings.SetRequest in project sonarlint-core by SonarSource.
the class CommercialAnalyzerTest method prepare.
@BeforeClass
public static void prepare() throws Exception {
adminWsClient = newAdminWsClient(ORCHESTRATOR);
adminWsClient.settings().set(new SetRequest().setKey("sonar.forceAuthentication").setValue("true"));
sonarUserHome = temp.newFolder().toPath();
removeGroupPermission("anyone", "scan");
adminWsClient.users().create(new CreateRequest().setLogin(SONARLINT_USER).setPassword(SONARLINT_PWD).setName("SonarLint"));
ORCHESTRATOR.getServer().provisionProject(PROJECT_KEY_C, "Sample C");
ORCHESTRATOR.getServer().provisionProject(PROJECT_KEY_COBOL, "Sample Cobol");
ORCHESTRATOR.getServer().provisionProject(PROJECT_KEY_TSQL, "Sample TSQL");
ORCHESTRATOR.getServer().provisionProject(PROJECT_KEY_APEX, "Sample APEX");
ORCHESTRATOR.getServer().associateProjectToQualityProfile(PROJECT_KEY_C, "c", "SonarLint IT C");
ORCHESTRATOR.getServer().associateProjectToQualityProfile(PROJECT_KEY_COBOL, "cobol", "SonarLint IT Cobol");
ORCHESTRATOR.getServer().associateProjectToQualityProfile(PROJECT_KEY_TSQL, "tsql", "SonarLint IT TSQL");
ORCHESTRATOR.getServer().associateProjectToQualityProfile(PROJECT_KEY_APEX, "apex", "SonarLint IT APEX");
}
use of org.sonarqube.ws.client.settings.SetRequest in project sonarlint-core by SonarSource.
the class ConnectedModeTest method updateNoAuth.
@Test
public void updateNoAuth() {
adminWsClient.settings().set(new SetRequest().setKey("sonar.forceAuthentication").setValue("true"));
try {
engine.update(endpointParams(ORCHESTRATOR), sqHttpClientNoAuth(), null);
fail("Exception expected");
} catch (Exception e) {
assertThat(e).hasMessage("Not authorized. Please check server credentials.");
} finally {
adminWsClient.settings().set(new SetRequest().setKey("sonar.forceAuthentication").setValue("false"));
}
}
Aggregations