BundleIconServiceImpl implements BundleIconService { @Override public BundleIcon getBundleIconByName(String bundleName, String defaultIcon) { Bundle bundle = getBundleByName(bundleName); return getBundleIcon(bundle, defaultIcon); }  @Override BundleIcon getBundleIconById(long bundleId, String defaultIcon); @Override BundleIcon getBundleIconByName(String bundleName, String defaultIcon);  }
@Test public void shouldReturnIconWhenGivenBundleName() { setupBundleRetrieval(); when(bundle.getResource("icon.gif")).thenReturn(getDefaultIconUrl(DEFAULT_PATH + DEFAULT_ICON)); BundleIcon bundleIcon = bundleIconService.getBundleIconByName(BUNDLE_NAME, null); byte[] expectedIcon = readDefaultIcon(DEFAULT_PATH + DEFAULT_ICON); assertArrayEquals(expectedIcon, bundleIcon.getIcon()); assertEquals(ICON_MIME, bundleIcon.getMime()); }