RepositoryServiceImpl implements RepositoryService { @Override public Repository create(String name) throws Exception { return create(name, null); }  @Activate void activate(ComponentContext componentContext); @Deactivate void deactivate(ComponentContext componentContext); @Override Repository create(String name); @Override Repository create(String name, String location); @Override Repository create(String name, String location, String proxy); @Override Repository create(String name, String location, String proxy, boolean mirror); @Override Repository create(String name, String location, String url, String proxy, boolean mirror, String realm, String downloadRole, String uploadRole, String scheduling, String schedulingAction, int poolSize); @Override void changeLocation(String name, String location); @Override void changeUrl(String name, String url); @Override void changeProxy(String name, String proxy, boolean mirror); @Override void changeSecurity(String name, String realm, String downloadRole, String uploadRole); @Override void changeScheduling(String name, String scheduling, String schedulingAction); @Override void copy(String sourceRepositoryName, String destinationRepositoryName); @Override void remove(String name); @Override void remove(String name, boolean storageCleanup); @Override void purge(String name); @Override synchronized Collection<Repository> repositories(); @Override synchronized Repository repository(String name); @Override void addArtifact(String artifactUrl, String name); @Override void addArtifact(String artifactUrl, String groupId, String artifactId, String version, String type, String classifier, String name); @Override void deleteArtifact(String artifactUrl, String name); @Override void deleteArtifact(String groupId, String artifactId, String version, String type, String classifier, String name); @Override void updateBundleRepositoryDescriptor(String name);  }
@Test public void testCreateRepository() throws Exception { Repository repository = repositoryService.create("test"); Assert.assertEquals("test", repository.getName()); File file = new File("target/repositories/test"); Assert.assertEquals(file.getAbsolutePath(), repository.getLocation()); Assert.assertNull(repository.getProxy()); Assert.assertEquals("karaf", repository.getRealm()); Assert.assertNull(repository.getDownloadRole()); Assert.assertNull(repository.getUploadRole()); Assert.assertEquals(8, repository.getPoolSize()); Assert.assertNotNull(repository); Assert.assertTrue(Files.exists(Paths.get("target/repositories/test"))); Assert.assertTrue(Files.isDirectory(Paths.get("target/repositories/test"))); }