|
22 | 22 | import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; |
23 | 23 | import com.google.common.jimfs.Configuration; |
24 | 24 | import com.google.common.jimfs.Jimfs; |
| 25 | +import org.apache.lucene.util.IOUtils; |
25 | 26 | import org.apache.lucene.util.LuceneTestCase; |
26 | 27 | import org.elasticsearch.Version; |
27 | 28 | import org.elasticsearch.cli.ExitCodes; |
@@ -433,10 +434,12 @@ public void testMalformedUrlNotMaven() throws Exception { |
433 | 434 |
|
434 | 435 | public void testFileNotMaven() throws Exception { |
435 | 436 | Tuple<Path, Environment> env = createEnv(fs, temp); |
436 | | - // has two colons, so it appears similar to maven coordinates |
437 | | - FileNotFoundException e = expectThrows(FileNotFoundException.class, |
438 | | - () -> installPlugin("file:C:\\path\\to\\plugin\\does_not_exists.zip", env.v1())); |
439 | | - assertTrue(e.getMessage(), e.getMessage().startsWith("C:\\path\\to\\plugin\\does_not_exists.zip")); |
| 437 | + String dir = randomAlphaOfLength(10) + ":" + randomAlphaOfLength(5) + "\\" + randomAlphaOfLength(5); |
| 438 | + Exception e = expectThrows(Exception.class, |
| 439 | + // has two colons, so it appears similar to maven coordinates |
| 440 | + () -> installPlugin("file:" + dir, env.v1())); |
| 441 | + assertFalse(e.getMessage(), e.getMessage().contains("maven.org")); |
| 442 | + assertTrue(e.getMessage(), e.getMessage().contains(dir)); |
440 | 443 | } |
441 | 444 |
|
442 | 445 | public void testUnknownPlugin() throws Exception { |
|
0 commit comments