@@ -130,11 +130,10 @@ public void testNodeDoesNotRequireLocalStorage() {
130
130
final Settings settings =
131
131
Settings .builder ()
132
132
.put ("path.home" , pathHome )
133
- .put ("node.local_storage" , false )
134
133
.put ("node.master" , false )
135
134
.put ("node.data" , false )
136
135
.build ();
137
- final Environment environment = new Environment (settings , null );
136
+ final Environment environment = new Environment (settings , null , false );
138
137
assertThat (environment .dataFiles (), arrayWithSize (0 ));
139
138
}
140
139
@@ -145,19 +144,18 @@ public void testNodeDoesNotRequireLocalStorageButHasPathData() {
145
144
Settings .builder ()
146
145
.put ("path.home" , pathHome )
147
146
.put ("path.data" , pathData )
148
- .put ("node.local_storage" , false )
149
147
.put ("node.master" , false )
150
148
.put ("node.data" , false )
151
149
.build ();
152
- final IllegalStateException e = expectThrows (IllegalStateException .class , () -> new Environment (settings , null ));
150
+ final IllegalStateException e = expectThrows (IllegalStateException .class , () -> new Environment (settings , null , false ));
153
151
assertThat (e , hasToString (containsString ("node does not require local storage yet path.data is set to [" + pathData + "]" )));
154
152
}
155
153
156
154
public void testNonExistentTempPathValidation () {
157
155
Settings build = Settings .builder ()
158
156
.put (Environment .PATH_HOME_SETTING .getKey (), createTempDir ())
159
157
.build ();
160
- Environment environment = new Environment (build , null , createTempDir ().resolve ("this_does_not_exist" ));
158
+ Environment environment = new Environment (build , null , true , createTempDir ().resolve ("this_does_not_exist" ));
161
159
FileNotFoundException e = expectThrows (FileNotFoundException .class , environment ::validateTmpFile );
162
160
assertThat (e .getMessage (), startsWith ("Temporary file directory [" ));
163
161
assertThat (e .getMessage (), endsWith ("this_does_not_exist] does not exist or is not accessible" ));
@@ -167,7 +165,7 @@ public void testTempPathValidationWhenRegularFile() throws IOException {
167
165
Settings build = Settings .builder ()
168
166
.put (Environment .PATH_HOME_SETTING .getKey (), createTempDir ())
169
167
.build ();
170
- Environment environment = new Environment (build , null , createTempFile ("something" , ".test" ));
168
+ Environment environment = new Environment (build , null , true , createTempFile ("something" , ".test" ));
171
169
IOException e = expectThrows (IOException .class , environment ::validateTmpFile );
172
170
assertThat (e .getMessage (), startsWith ("Configured temporary file directory [" ));
173
171
assertThat (e .getMessage (), endsWith (".test] is not a directory" ));
@@ -194,7 +192,7 @@ public void testPathNormalization() throws IOException {
194
192
// the above paths will be treated as relative to the working directory
195
193
final Path workingDirectory = PathUtils .get (System .getProperty ("user.dir" ));
196
194
197
- final Environment environment = new Environment (settings , null , createTempDir ());
195
+ final Environment environment = new Environment (settings , null , true , createTempDir ());
198
196
final String homePath = Environment .PATH_HOME_SETTING .get (environment .settings ());
199
197
assertPath (homePath , workingDirectory .resolve ("home" ));
200
198
0 commit comments