expect(bundleManager.installBundleIfNeeded(bundle1Uri, 0, null)).andReturn(new BundleInstallerResult(installedBundle1, true));
expect(bundleManager.installBundleIfNeeded(bundle2Uri, 0, null)).andReturn(new BundleInstallerResult(installedBundle2, true));
expect(bundleManager.installBundleIfNeeded("zfs:unknown", 0, null)).andThrow(new MalformedURLException());
replay(bundleManager);
FeaturesServiceImpl svc = new FeaturesServiceImpl(bundleManager);
svc.addRepository(uri);
try {
List<Feature> features = Arrays.asList(svc.listFeatures());
Collections.reverse(features);
svc.installFeatures(new CopyOnWriteArraySet<Feature>(features),
EnumSet.of(FeaturesService.Option.NoCleanIfFailure));
fail("Call should have thrown an exception");
} catch (MalformedURLException e) {
}
verify(bundleManager);