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