use of org.sonar.updatecenter.common.Plugin in project sonarqube by SonarSource.
the class PluginDownloaderTest method download_from_file.
@Test
public void download_from_file() throws Exception {
Plugin test = Plugin.factory("test");
File file = testFolder.newFile("test-1.0.jar");
file.createNewFile();
Release test10 = new Release(test, "1.0").setDownloadUrl("file://" + separatorsToUnix(file.getCanonicalPath()));
test.addRelease(test10);
when(updateCenter.findInstallablePlugins("foo", create("1.0"))).thenReturn(newArrayList(test10));
pluginDownloader.start();
pluginDownloader.download("foo", create("1.0"));
verify(httpDownloader, never()).download(any(URI.class), any(File.class));
assertThat(pluginDownloader.hasDownloads()).isTrue();
}
Aggregations