|
64 | 64 | import org.sonarqube.ws.client.WsClient;
|
65 | 65 | import org.sonarqube.ws.client.WsRequest;
|
66 | 66 | import org.sonarqube.ws.client.WsResponse;
|
67 |
| -import org.sonarqube.ws.client.permissions.RemoveGroupRequest; |
68 | 67 | import org.sonarqube.ws.client.qualityprofiles.ActivateRuleRequest;
|
69 | 68 | import org.sonarqube.ws.client.qualityprofiles.SearchRequest;
|
70 | 69 | import org.sonarqube.ws.client.settings.ResetRequest;
|
|
74 | 73 | import org.sonarsource.sonarlint.core.NodeJsHelper;
|
75 | 74 | import org.sonarsource.sonarlint.core.WsHelperImpl;
|
76 | 75 | import org.sonarsource.sonarlint.core.client.api.common.Language;
|
77 |
| -import org.sonarsource.sonarlint.core.client.api.common.analysis.AnalysisResults; |
78 | 76 | import org.sonarsource.sonarlint.core.client.api.common.TextRange;
|
| 77 | +import org.sonarsource.sonarlint.core.client.api.common.analysis.AnalysisResults; |
79 | 78 | import org.sonarsource.sonarlint.core.client.api.connected.ConnectedGlobalConfiguration;
|
80 | 79 | import org.sonarsource.sonarlint.core.client.api.connected.ConnectedSonarLintEngine;
|
81 | 80 | import org.sonarsource.sonarlint.core.client.api.connected.ConnectedSonarLintEngine.State;
|
@@ -119,6 +118,7 @@ private static String javaRuleKey(String key) {
|
119 | 118 |
|
120 | 119 | @ClassRule
|
121 | 120 | public static Orchestrator ORCHESTRATOR = Orchestrator.builderEnv()
|
| 121 | + .defaultForceAuthentication() |
122 | 122 | .setSonarVersion(SONAR_VERSION)
|
123 | 123 | .addPlugin(MavenLocation.of("org.sonarsource.java", "sonar-java-plugin", ItUtils.javaVersion))
|
124 | 124 | .addPlugin(MavenLocation.of("org.sonarsource.python", "sonar-python-plugin", ItUtils.pythonVersion))
|
@@ -310,8 +310,7 @@ public void updateNoAuth() {
|
310 | 310 | fail("Exception expected");
|
311 | 311 | } catch (Exception e) {
|
312 | 312 | assertThat(e).hasMessage("Not authorized. Please check server credentials.");
|
313 |
| - } |
314 |
| - finally { |
| 313 | + } finally { |
315 | 314 | adminWsClient.settings().set(new SetRequest().setKey("sonar.forceAuthentication").setValue("false"));
|
316 | 315 | }
|
317 | 316 | }
|
@@ -486,7 +485,8 @@ public void canFetchHotspot() throws InvalidProtocolBufferException {
|
486 | 485 | SonarLintWsClient slClient = new SonarLintWsClient(getServerConfig());
|
487 | 486 | SecurityHotspotsService securityHotspotsService = new SecurityHotspotsService(slClient);
|
488 | 487 |
|
489 |
| - Optional<RemoteHotspot> remoteHotspot = securityHotspotsService.fetch(new GetSecurityHotspotRequestParams(getFirstHotspotKey(slClient, PROJECT_KEY_JAVA_HOTSPOT), PROJECT_KEY_JAVA_HOTSPOT)); |
| 488 | + Optional<RemoteHotspot> remoteHotspot = securityHotspotsService |
| 489 | + .fetch(new GetSecurityHotspotRequestParams(getFirstHotspotKey(slClient, PROJECT_KEY_JAVA_HOTSPOT), PROJECT_KEY_JAVA_HOTSPOT)); |
490 | 490 |
|
491 | 491 | assertThat(remoteHotspot).isNotEmpty();
|
492 | 492 | RemoteHotspot actualHotspot = remoteHotspot.get();
|
@@ -826,16 +826,13 @@ private ServerConfiguration getServerConfig(boolean redirect) {
|
826 | 826 | .build();
|
827 | 827 | }
|
828 | 828 |
|
829 |
| - private static void removeGroupPermission(String groupName, String permission) { |
830 |
| - adminWsClient.permissions().removeGroup(new RemoveGroupRequest() |
831 |
| - .setGroupName(groupName) |
832 |
| - .setPermission(permission)); |
833 |
| - } |
834 |
| - |
835 | 829 | private static void analyzeMavenProject(String projectDirName) {
|
836 | 830 | Path projectDir = Paths.get("projects/" + projectDirName).toAbsolutePath();
|
837 | 831 | Path pom = projectDir.resolve("pom.xml");
|
838 |
| - ORCHESTRATOR.executeBuild(MavenBuild.create(pom.toFile()).setCleanPackageSonarGoals()); |
| 832 | + ORCHESTRATOR.executeBuild(MavenBuild.create(pom.toFile()) |
| 833 | + .setCleanPackageSonarGoals() |
| 834 | + .setProperty("sonar.login", com.sonar.orchestrator.container.Server.ADMIN_LOGIN) |
| 835 | + .setProperty("sonar.password", com.sonar.orchestrator.container.Server.ADMIN_PASSWORD)); |
839 | 836 | }
|
840 | 837 |
|
841 | 838 | }
|
0 commit comments