use of org.sonarsource.sonarlint.core.serverapi.ServerApi in project sonarlint-core by SonarSource.
the class PluginsSynchronizerTests method should_not_synchronize_plugins_with_unsupported_version.
@Test
void should_not_synchronize_plugins_with_unsupported_version(@TempDir Path dest) {
mockServer.addStringResponse("/api/plugins/installed", "{\"plugins\": [" + "{\"key\": \"java\", \"hash\": \"de5308f43260d357acc97712ce4c5475\", \"filename\": \"sonar-java-plugin-5.12.0.jar\", \"sonarLintSupported\": true}" + "]}");
underTest = new PluginsSynchronizer(Set.of(Language.JAVA), new PluginsStorage(dest), Set.of());
var anyPluginUpdated = underTest.synchronize(new ServerApi(mockServer.serverApiHelper()), new ProgressMonitor(null));
assertThat(dest.resolve("plugin_references.pb")).doesNotExist();
assertThat(dest.resolve("sonar-java-plugin-5.12.0.jar")).doesNotExist();
assertThat(anyPluginUpdated).isFalse();
}
use of org.sonarsource.sonarlint.core.serverapi.ServerApi in project sonarlint-core by SonarSource.
the class PluginsSynchronizerTests method should_not_synchronize_plugins_for_not_enabled_languages.
@Test
void should_not_synchronize_plugins_for_not_enabled_languages(@TempDir Path tmp) {
var dest = tmp.resolve("destDir");
mockServer.addStringResponse("/api/plugins/installed", "{\"plugins\": [" + "{\"key\": \"java\", \"hash\": \"de5308f43260d357acc97712ce4c5475\", \"filename\": \"sonar-java-plugin-5.13.1.18282.jar\", \"sonarLintSupported\": true}" + "]}");
underTest = new PluginsSynchronizer(Set.of(Language.JS), new PluginsStorage(dest), emptySet());
var anyPluginUpdated = underTest.synchronize(new ServerApi(mockServer.serverApiHelper()), new ProgressMonitor(null));
assertThat(dest.resolve("plugin_references.pb")).doesNotExist();
assertThat(dest.resolve("sonar-java-plugin-5.13.1.18282.jar")).doesNotExist();
assertThat(anyPluginUpdated).isFalse();
}
use of org.sonarsource.sonarlint.core.serverapi.ServerApi in project sonarlint-core by SonarSource.
the class PluginsSynchronizerTests method should_not_synchronize_embedded_plugins.
@Test
void should_not_synchronize_embedded_plugins(@TempDir Path dest) {
mockServer.addStringResponse("/api/plugins/installed", "{\"plugins\": [" + "{\"key\": \"java\", \"hash\": \"de5308f43260d357acc97712ce4c5475\", \"filename\": \"sonar-java-plugin-5.13.1.18282.jar\", \"sonarLintSupported\": true}" + "]}");
underTest = new PluginsSynchronizer(Set.of(Language.JAVA), new PluginsStorage(dest), Set.of("java"));
var anyPluginUpdated = underTest.synchronize(new ServerApi(mockServer.serverApiHelper()), new ProgressMonitor(null));
assertThat(dest.resolve("plugin_references.pb")).doesNotExist();
assertThat(dest.resolve("sonar-java-plugin-5.13.1.18282.jar")).doesNotExist();
assertThat(anyPluginUpdated).isFalse();
}
Aggregations