fix unit test

This commit is contained in:
Eduard Heimbuch
2020-09-24 12:25:36 +02:00
parent 2626bd118a
commit 0f7707d539

View File

@@ -71,9 +71,12 @@ class ReleaseVersionCheckerTest {
@Test
void shouldReturnUpdateInfoFromCache() {
String url = "releaseFeed";
when(scmConfiguration.getReleaseFeedUrl()).thenReturn(url);
UpdateInfo cachedUpdateInfo = new UpdateInfo("1.42.9", "download-link");
Cache<String, Optional<UpdateInfo>> cache = new MapCacheManager().getCache("sonia.cache.updateInfo");
cache.put("latestRelease", Optional.of(cachedUpdateInfo));
cache.put(url, Optional.of(cachedUpdateInfo));
checker.setCache(cache);
Optional<UpdateInfo> updateInfo = checker.checkForNewerVersion();