File tree 2 files changed +13
-2
lines changed
core/src/test/java/org/elasticsearch/plugins
qa/no-bootstrap-tests/src/test/java/org/elasticsearch/bootstrap
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 30
30
import java .io .IOException ;
31
31
import java .nio .file .FileSystemException ;
32
32
import java .nio .file .Files ;
33
+ import java .nio .file .NoSuchFileException ;
33
34
import java .nio .file .Path ;
34
35
import java .util .Arrays ;
35
36
import java .util .Collection ;
@@ -145,7 +146,11 @@ public void testDesktopServicesStoreFiles() throws IOException {
145
146
assertThat (e , hasToString (containsString ("Could not load plugin descriptor for existing plugin [.DS_Store]" )));
146
147
assertNotNull (e .getCause ());
147
148
assertThat (e .getCause (), instanceOf (FileSystemException .class ));
148
- assertThat (e .getCause (), hasToString (containsString ("Not a directory" )));
149
+ if (Constants .WINDOWS ) {
150
+ assertThat (e .getCause (), instanceOf (NoSuchFileException .class ));
151
+ } else {
152
+ assertThat (e .getCause (), hasToString (containsString ("Not a directory" )));
153
+ }
149
154
}
150
155
}
151
156
Original file line number Diff line number Diff line change 33
33
import java .nio .charset .StandardCharsets ;
34
34
import java .nio .file .FileSystemException ;
35
35
import java .nio .file .Files ;
36
+ import java .nio .file .NoSuchFileException ;
36
37
import java .nio .file .Path ;
37
38
import java .nio .file .attribute .PosixFileAttributeView ;
38
39
import java .nio .file .attribute .PosixFilePermission ;
45
46
import static org .hamcrest .Matchers .equalTo ;
46
47
import static org .hamcrest .Matchers .hasSize ;
47
48
import static org .hamcrest .Matchers .hasToString ;
49
+ import static org .hamcrest .Matchers .instanceOf ;
48
50
49
51
/**
50
52
* Create a simple "daemon controller", put it in the right place and check that it runs.
@@ -211,7 +213,11 @@ public void testSpawnerHandlingOfDesktopServicesStoreFiles() throws IOException
211
213
// we do not ignore these files on non-macOS systems
212
214
final FileSystemException e =
213
215
expectThrows (FileSystemException .class , () -> spawner .spawnNativePluginControllers (environment ));
214
- assertThat (e , hasToString (containsString ("Not a directory" )));
216
+ if (Constants .WINDOWS ) {
217
+ assertThat (e , instanceOf (NoSuchFileException .class ));
218
+ } else {
219
+ assertThat (e , hasToString (containsString ("Not a directory" )));
220
+ }
215
221
}
216
222
}
217
223
You can’t perform that action at this time.
0 commit comments