when(systemBundle.getBundleContext()).thenReturn(bundleContext);
bundleContext.addBundleListener((BundleListener) anyObject());
bundleContext.addServiceListener((ServiceListener) anyObject());
when(bundleContext.getBundles()).thenReturn(new Bundle[]{systemBundle});
RepositoryAdminImpl repoAdmin = new RepositoryAdminImpl(bundleContext, new Logger(bundleContext));
// force initialization && remove all initial repositories
org.apache.felix.bundlerepository.Repository[] repos = repoAdmin.listRepositories();
for (int i = 0; repos != null && i < repos.length; i++) {
repoAdmin.removeRepository(repos[i].getURI());