Search in sources :

Example 1 with SettingsDownloader

use of org.sonarsource.sonarlint.core.container.connected.update.SettingsDownloader in project sonarlint-core by SonarSource.

the class ModuleStorageUpdateCheckerTest method prepare.

@Before
public void prepare() {
    storageReader = mock(StorageReader.class);
    moduleConfigurationDownloader = mock(ModuleConfigurationDownloader.class);
    when(storageReader.readModuleConfig(MODULE_KEY)).thenReturn(ModuleConfiguration.newBuilder().build());
    when(storageReader.readServerInfos()).thenReturn(ServerInfos.newBuilder().setVersion(SERVER_VERSION).build());
    when(moduleConfigurationDownloader.fetchModuleConfiguration(eq(SERVER_VERSION), eq(MODULE_KEY), any(GlobalProperties.class), any(ProgressWrapper.class))).thenReturn(ModuleConfiguration.newBuilder().build());
    SettingsDownloader settingsDownloader = mock(SettingsDownloader.class);
    when(settingsDownloader.fetchGlobalSettings(SERVER_VERSION)).thenReturn(GlobalProperties.newBuilder().build());
    checker = new ModuleStorageUpdateChecker(storageReader, moduleConfigurationDownloader, settingsDownloader);
}
Also used : StorageReader(org.sonarsource.sonarlint.core.container.storage.StorageReader) ProgressWrapper(org.sonarsource.sonarlint.core.util.ProgressWrapper) GlobalProperties(org.sonarsource.sonarlint.core.proto.Sonarlint.GlobalProperties) SettingsDownloader(org.sonarsource.sonarlint.core.container.connected.update.SettingsDownloader) ModuleConfigurationDownloader(org.sonarsource.sonarlint.core.container.connected.update.ModuleConfigurationDownloader) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)1 ModuleConfigurationDownloader (org.sonarsource.sonarlint.core.container.connected.update.ModuleConfigurationDownloader)1 SettingsDownloader (org.sonarsource.sonarlint.core.container.connected.update.SettingsDownloader)1 StorageReader (org.sonarsource.sonarlint.core.container.storage.StorageReader)1 GlobalProperties (org.sonarsource.sonarlint.core.proto.Sonarlint.GlobalProperties)1 ProgressWrapper (org.sonarsource.sonarlint.core.util.ProgressWrapper)1