@Test public void testGetDifferentIcons() { Promise<String> promise1 = cache.getIcon(ICON_1); verify(resourceContentService).get(anyString(), any()); Assertions.assertThat(promise1).isNotNull(); Promise<String> promise2 = cache.getIcon(ICON_2); verify(resourceContentService, times(2)).get(anyString(), any()); Assertions.assertThat(promise2) .isNotNull() .isNotSameAs(promise1); }
@Override public Promise<String> getIcon(String iconPath) { return cachedIcons.computeIfAbsent(iconPath, this::lookupPromise); }
WorkItemIconCacheImpl implements WorkItemIconCache { @Override public Promise<String> getIcon(String iconPath) { return cachedIcons.computeIfAbsent(iconPath, this::lookupPromise); } }
WorkItemIconCacheImpl implements WorkItemIconCache { @Override public Promise<String> getIcon(String iconPath) { return cachedIcons.computeIfAbsent(iconPath, this::lookupPromise); } @Inject  WorkItemIconCacheImpl(final ResourceContentService resourceContentService); }
WorkItemIconCacheImpl implements WorkItemIconCache { @Override public Promise<String> getIcon(String iconPath) { return cachedIcons.computeIfAbsent(iconPath, this::lookupPromise); } @Inject  WorkItemIconCacheImpl(final ResourceContentService resourceContentService); @Override Promise<String> getIcon(String iconPath); }
WorkItemIconCacheImpl implements WorkItemIconCache { @Override public Promise<String> getIcon(String iconPath) { return cachedIcons.computeIfAbsent(iconPath, this::lookupPromise); } @Inject  WorkItemIconCacheImpl(final ResourceContentService resourceContentService); @Override Promise<String> getIcon(String iconPath);  }