Add test for plugin install heuristic

This commit is contained in:
Ryan Ernst 2016-06-14 23:01:37 -07:00
parent 6db323164e
commit 1ecf14cee0
2 changed files with 6 additions and 3 deletions

View File

@ -134,9 +134,6 @@ class InstallPluginCommand extends SettingCommand {
}
}
// protocols allowed for direct url installation
private static final List<String> URL_PROTOCOLS = Arrays.asList("http", "https", "file");
private final OptionSpec<Void> batchOption;
private final OptionSpec<String> arguments;

View File

@ -307,6 +307,12 @@ public class InstallPluginCommandTests extends ESTestCase {
assertTrue(e.getMessage(), e.getMessage().contains("no protocol"));
}
public void testUnknownPlugin() throws Exception {
Tuple<Path, Environment> env = createEnv(fs, temp);
UserError e = expectThrows(UserError.class, () -> installPlugin("foo", env.v1()));
assertTrue(e.getMessage(), e.getMessage().contains("Unknown plugin foo"));
}
public void testPluginsDirMissing() throws Exception {
Tuple<Path, Environment> env = createEnv(fs, temp);
Files.delete(env.v2().pluginsFile());