expect(bundleManager.installBundleIfNeeded(eq(name), eq(0), eq((String)null))).andReturn(new BundleInstallerResult(installedBundle, true)).anyTimes();
replay(bundleManager);
FeaturesServiceImpl svc = new FeaturesServiceImpl(bundleManager);
svc.addRepository(uri);
Repository[] repositories = svc.listRepositories();
verify(bundleManager);
assertNotNull(repositories);
assertEquals(1, repositories.length);
assertNotNull(repositories[0]);