Search in sources :

Example 11 with GoCache

use of com.thoughtworks.go.server.cache.GoCache in project gocd by gocd.

the class ServerVersionInfoManagerTest method shouldGetGoUpdateFromCache.

@Test
public void shouldGetGoUpdateFromCache() {
    String newRelease = "15.0.1-123";
    GoCache goCache = mock(GoCache.class);
    when(goCache.get("GOUpdate")).thenReturn(newRelease);
    manager = new ServerVersionInfoManager(builder, versionInfoDao, new SystemTimeClock(), goCache, null);
    assertThat(manager.getGoUpdate(), is(newRelease));
}
Also used : SystemTimeClock(com.thoughtworks.go.util.SystemTimeClock) GoCache(com.thoughtworks.go.server.cache.GoCache) Test(org.junit.Test)

Aggregations

GoCache (com.thoughtworks.go.server.cache.GoCache)11 Test (org.junit.Test)7 Before (org.junit.Before)4 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)3 BasicCruiseConfig (com.thoughtworks.go.config.BasicCruiseConfig)2 CruiseConfig (com.thoughtworks.go.config.CruiseConfig)2 ServerSiteUrlConfig (com.thoughtworks.go.domain.ServerSiteUrlConfig)2 StubGoCache (com.thoughtworks.go.server.service.StubGoCache)2 TestTransactionSynchronizationManager (com.thoughtworks.go.server.transaction.TestTransactionSynchronizationManager)2 InvocationOnMock (org.mockito.invocation.InvocationOnMock)2 Answer (org.mockito.stubbing.Answer)2 Cache (com.opensymphony.oscache.base.Cache)1 Cloner (com.rits.cloning.Cloner)1 PipelineConfig (com.thoughtworks.go.config.PipelineConfig)1 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)1 HgMaterial (com.thoughtworks.go.config.materials.mercurial.HgMaterial)1 SvnMaterial (com.thoughtworks.go.config.materials.svn.SvnMaterial)1 ConfigElementImplementationRegistry (com.thoughtworks.go.config.registry.ConfigElementImplementationRegistry)1 PipelineDao (com.thoughtworks.go.server.dao.PipelineDao)1 StageDao (com.thoughtworks.go.server.dao.StageDao)1