use of org.mule.runtime.module.repository.api.RepositoryService in project mule by mulesoft.
the class RepositorySystemTestCase method existingResourceFromMaven.
@Test
public void existingResourceFromMaven() throws Exception {
executeTestWithDefaultRemoteRepo(() -> {
RepositoryService defaultRepositoryService = new RepositoryServiceFactory().createRepositoryService();
File bundleFile = defaultRepositoryService.lookupBundle(VALID_BUNDLE);
assertThat(bundleFile, notNullValue());
assertThat(bundleFile.exists(), is(true));
assertThat(bundleFile.getAbsolutePath().startsWith(temporaryFolder.getRoot().getAbsolutePath()), is(true));
});
}
use of org.mule.runtime.module.repository.api.RepositoryService in project mule by mulesoft.
the class RepositorySystemTestCase method noExistentResource.
@Test
public void noExistentResource() throws Exception {
executeTestWithDefaultRemoteRepo(() -> {
RepositoryService defaultRepositoryService = new RepositoryServiceFactory().createRepositoryService();
BundleDescriptor bundleDescriptor = new BundleDescriptor.Builder().setGroupId("no").setArtifactId("existent").setVersion("bundle").build();
expectedException.expect(BundleNotFoundException.class);
defaultRepositoryService.lookupBundle(new BundleDependency.Builder().setDescriptor(bundleDescriptor).build());
});
}
use of org.mule.runtime.module.repository.api.RepositoryService in project mule by mulesoft.
the class RepositorySystemTestCase method invalidExternalRepository.
@Test
public void invalidExternalRepository() throws Exception {
executeTestWithCustomRepoRepo("http://doesnotexists/repo", () -> {
RepositoryService defaultRepositoryService = new RepositoryServiceFactory().createRepositoryService();
expectedException.expect(RepositoryConnectionException.class);
defaultRepositoryService.lookupBundle(VALID_BUNDLE);
});
}
use of org.mule.runtime.module.repository.api.RepositoryService in project mule by mulesoft.
the class RepositorySystemTestCase method noRepositoryConfigured.
@Test
public void noRepositoryConfigured() throws Exception {
executeTestWithCustomRepoRepo(null, () -> {
RepositoryService defaultRepositoryService = new RepositoryServiceFactory().createRepositoryService();
expectedException.expect(RepositoryServiceDisabledException.class);
defaultRepositoryService.lookupBundle(VALID_BUNDLE);
});
}
Aggregations