use of com.thoughtworks.go.domain.VersionInfo in project gocd by gocd.
the class ServerVersionInfoManagerTest method shouldBeTrueIfVersionCheckEnabledOnProductionServer.
@Test
public void shouldBeTrueIfVersionCheckEnabledOnProductionServer() {
SystemEnvironment systemEnvironment = mock(SystemEnvironment.class);
when(builder.getServerVersionInfo()).thenReturn(new VersionInfo());
when(systemEnvironment.isGOUpdateCheckEnabled()).thenReturn(true);
when(systemEnvironment.isProductionMode()).thenReturn(true);
manager = new ServerVersionInfoManager(builder, versionInfoDao, new SystemTimeClock(), goCache, systemEnvironment);
manager.initialize();
assertTrue(manager.isUpdateCheckEnabled());
}
use of com.thoughtworks.go.domain.VersionInfo 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