use of org.sonarsource.sonarlint.core.client.api.connected.StorageUpdateCheckResult in project sonarlint-core by SonarSource.
the class GlobalStorageUpdateCheckerTest method testNoChanges.
@Test
public void testNoChanges() {
StorageUpdateCheckResult result = checker.checkForUpdate(mock(ProgressWrapper.class));
assertThat(result.needUpdate()).isFalse();
assertThat(result.changelog()).isEmpty();
}
use of org.sonarsource.sonarlint.core.client.api.connected.StorageUpdateCheckResult in project sonarlint-core by SonarSource.
the class ModuleStorageUpdateCheckerTest method testNoChanges.
@Test
public void testNoChanges() {
StorageUpdateCheckResult result = checker.checkForUpdates(MODULE_KEY, new ProgressWrapper(null));
assertThat(result.needUpdate()).isFalse();
assertThat(result.changelog()).isEmpty();
}
use of org.sonarsource.sonarlint.core.client.api.connected.StorageUpdateCheckResult in project sonarlint-core by SonarSource.
the class ModuleStorageUpdateCheckerTest method changedQualityProfile.
@Test
public void changedQualityProfile() {
when(moduleConfigurationDownloader.fetchModuleConfiguration(eq(SERVER_VERSION), eq(MODULE_KEY), any(GlobalProperties.class), any(ProgressWrapper.class))).thenReturn(ModuleConfiguration.newBuilder().putQprofilePerLanguage("java", "sonar-way-456").build());
when(storageReader.readModuleConfig(MODULE_KEY)).thenReturn(ModuleConfiguration.newBuilder().putQprofilePerLanguage("java", "sonar-way-123").build());
StorageUpdateCheckResult result = checker.checkForUpdates(MODULE_KEY, new ProgressWrapper(null));
assertThat(result.needUpdate()).isTrue();
assertThat(result.changelog()).containsOnly("Quality profiles configuration changed");
assertThat(logTester.logs(LoggerLevel.DEBUG)).containsOnly("Quality profile for language 'java' changed from 'sonar-way-123' to 'sonar-way-456'");
}
use of org.sonarsource.sonarlint.core.client.api.connected.StorageUpdateCheckResult in project sonarlint-core by SonarSource.
the class ModuleStorageUpdateCheckerTest method addedProfile.
@Test
public void addedProfile() {
when(moduleConfigurationDownloader.fetchModuleConfiguration(eq(SERVER_VERSION), eq(MODULE_KEY), any(GlobalProperties.class), any(ProgressWrapper.class))).thenReturn(ModuleConfiguration.newBuilder().putQprofilePerLanguage("java", "sonar-way-123").build());
StorageUpdateCheckResult result = checker.checkForUpdates(MODULE_KEY, new ProgressWrapper(null));
assertThat(result.needUpdate()).isTrue();
assertThat(result.changelog()).containsOnly("Quality profiles configuration changed");
assertThat(logTester.logs(LoggerLevel.DEBUG)).containsOnly("Quality profile for language 'java' added with value 'sonar-way-123'");
}
use of org.sonarsource.sonarlint.core.client.api.connected.StorageUpdateCheckResult in project sonarlint-core by SonarSource.
the class ModuleStorageUpdateCheckerTest method ignoreRemovedProfile.
@Test
public void ignoreRemovedProfile() {
when(storageReader.readModuleConfig(MODULE_KEY)).thenReturn(ModuleConfiguration.newBuilder().putQprofilePerLanguage("java", "sonar-way-123").build());
StorageUpdateCheckResult result = checker.checkForUpdates(MODULE_KEY, new ProgressWrapper(null));
assertThat(result.needUpdate()).isFalse();
assertThat(logTester.logs(LoggerLevel.DEBUG)).containsOnly("Quality profile for language 'java' removed");
}
Aggregations