use of org.sonarsource.sonarlint.core.client.api.connected.StorageUpdateCheckResult in project sonarlint-intellij by SonarSource.
the class UpdateCheckerTest method do_nothing_if_no_updates.
@Test
public void do_nothing_if_no_updates() {
StorageUpdateCheckResult result = mock(StorageUpdateCheckResult.class);
when(result.needUpdate()).thenReturn(false);
when(engine.checkIfModuleStorageNeedUpdate(any(ServerConfiguration.class), anyString(), isNull())).thenReturn(result);
when(engine.checkIfGlobalStorageNeedUpdate(any(ServerConfiguration.class), isNull())).thenReturn(result);
updateChecker.checkForUpdate();
verify(engine).checkIfGlobalStorageNeedUpdate(any(ServerConfiguration.class), isNull());
verify(engine).checkIfModuleStorageNeedUpdate(any(ServerConfiguration.class), anyString(), isNull());
verifyZeroInteractions(notifications);
}
use of org.sonarsource.sonarlint.core.client.api.connected.StorageUpdateCheckResult in project sonarlint-intellij by SonarSource.
the class UpdateCheckerTest method global_changes.
@Test
public void global_changes() {
StorageUpdateCheckResult result = mock(StorageUpdateCheckResult.class);
when(result.needUpdate()).thenReturn(true);
when(result.changelog()).thenReturn(Collections.singletonList("change1"));
when(engine.checkIfModuleStorageNeedUpdate(any(ServerConfiguration.class), anyString(), isNull())).thenReturn(result);
when(engine.checkIfGlobalStorageNeedUpdate(any(ServerConfiguration.class), isNull())).thenReturn(result);
updateChecker.checkForUpdate();
verify(engine).checkIfGlobalStorageNeedUpdate(any(ServerConfiguration.class), isNull());
verify(engine).checkIfModuleStorageNeedUpdate(any(ServerConfiguration.class), anyString(), isNull());
verify(notifications).notifyServerHasUpdates("serverId", engine, server, false);
verifyNoMoreInteractions(engine);
verifyZeroInteractions(notifications);
}
Aggregations