use of com.thoughtworks.go.domain.GoVersion in project gocd by gocd.
the class ServerVersionInfoManagerTest method shouldNotUpdateCacheIfLatestVersionIsLesserThanInstalledVersion.
@Test
public void shouldNotUpdateCacheIfLatestVersionIsLesserThanInstalledVersion() {
GoVersion currentVersion = new GoVersion("4.7.3-1");
GoVersion latestVersion = new GoVersion("2.3.4-2");
VersionInfo versionInfo = new VersionInfo("go_server", currentVersion, latestVersion, null);
when(builder.getServerVersionInfo()).thenReturn(versionInfo);
manager.initialize();
verify(builder).getServerVersionInfo();
verify(goCache, never()).put(anyString(), anyString());
}
use of com.thoughtworks.go.domain.GoVersion in project gocd by gocd.
the class ServerVersionInfoManagerTest method shouldUpdateCacheWithNewVersionIfLatestVersionIsGreaterThanInstalledVersion.
@Test
public void shouldUpdateCacheWithNewVersionIfLatestVersionIsGreaterThanInstalledVersion() {
SystemTimeClock systemTimeClock = mock(SystemTimeClock.class);
VersionInfo versionInfo = new VersionInfo("go_server", new GoVersion("1.2.3-1"), new GoVersion("1.2.3-1"), null);
Date now = new Date();
when(builder.getServerVersionInfo()).thenReturn(versionInfo);
when(systemTimeClock.currentTime()).thenReturn(now);
manager = new ServerVersionInfoManager(builder, versionInfoDao, systemTimeClock, goCache, systemEnvironment);
manager.initialize();
manager.updateLatestVersion("15.0.1-123");
verify(goCache).put("GOUpdate", "15.0.1-123");
}
Aggregations