@@ -51,18 +51,19 @@ public void testMissingWritePermission() throws IOException {
5151 Settings build = Settings .builder ()
5252 .put (Environment .PATH_HOME_SETTING .getKey (), createTempDir ().toAbsolutePath ().toString ())
5353 .putList (Environment .PATH_DATA_SETTING .getKey (), tempPaths ).build ();
54- IOException exception = expectThrows (IOException .class , () -> {
54+ IllegalStateException exception = expectThrows (IllegalStateException .class , () -> {
5555 new NodeEnvironment (build , TestEnvironment .newEnvironment (build ));
5656 });
57- assertTrue (exception .getMessage (), exception .getMessage ().startsWith (path .toString ()));
57+ assertTrue (exception .getCause ().getCause ().getMessage (),
58+ exception .getCause ().getCause ().getMessage ().startsWith (path .toString ()));
5859 }
5960 }
6061
6162 public void testMissingWritePermissionOnIndex () throws IOException {
6263 assumeTrue ("posix filesystem" , isPosix );
6364 final String [] tempPaths = tmpPaths ();
6465 Path path = PathUtils .get (randomFrom (tempPaths ));
65- Path fooIndex = path .resolve ("nodes" ). resolve ( "0" ). resolve ( NodeEnvironment .INDICES_FOLDER )
66+ Path fooIndex = path .resolve (NodeEnvironment .INDICES_FOLDER )
6667 .resolve ("foo" );
6768 Files .createDirectories (fooIndex );
6869 try (PosixPermissionsResetter attr = new PosixPermissionsResetter (fooIndex )) {
@@ -82,7 +83,7 @@ public void testMissingWritePermissionOnShard() throws IOException {
8283 assumeTrue ("posix filesystem" , isPosix );
8384 final String [] tempPaths = tmpPaths ();
8485 Path path = PathUtils .get (randomFrom (tempPaths ));
85- Path fooIndex = path .resolve ("nodes" ). resolve ( "0" ). resolve ( NodeEnvironment .INDICES_FOLDER )
86+ Path fooIndex = path .resolve (NodeEnvironment .INDICES_FOLDER )
8687 .resolve ("foo" );
8788 Path fooShard = fooIndex .resolve ("0" );
8889 Path fooShardIndex = fooShard .resolve ("index" );
0 commit comments