2323import java .io .PrintStream ;
2424import java .util .ArrayList ;
2525import java .util .List ;
26- import java .util .Objects ;
2726
2827import org .apache .http .HttpStatus ;
2928import org .junit .Assert ;
@@ -59,9 +58,9 @@ public void testSecurityAdmin() throws Exception {
5958
6059 List <String > argsAsList = new ArrayList <>();
6160 argsAsList .add ("-ts" );
62- argsAsList .add (Objects . requireNonNull ( FileHelper .resolveStorePath (prefix + "truststore" ) ).toFile ().getAbsolutePath ());
61+ argsAsList .add (FileHelper .resolveStorePath (prefix + "truststore" ).toFile ().getAbsolutePath ());
6362 argsAsList .add ("-ks" );
64- argsAsList .add (Objects . requireNonNull ( FileHelper .resolveStorePath (prefix + "kirk-keystore" ) ).toFile ().getAbsolutePath ());
63+ argsAsList .add (FileHelper .resolveStorePath (prefix + "kirk-keystore" ).toFile ().getAbsolutePath ());
6564 argsAsList .add ("-p" );
6665 argsAsList .add (String .valueOf (clusterInfo .httpPort ));
6766 argsAsList .add ("-cn" );
@@ -95,17 +94,11 @@ public void testSecurityAdminHostnameVerificationEnforced() throws Exception {
9594
9695 List <String > argsAsList = new ArrayList <>();
9796 argsAsList .add ("-cacert" );
98- argsAsList .add (
99- Objects .requireNonNull (FileHelper .getAbsoluteFilePathFromClassPath (prefix + "root-ca.pem" )).toFile ().getAbsolutePath ()
100- );
97+ argsAsList .add (FileHelper .getAbsoluteFilePathFromClassPath (prefix + "root-ca.pem" ).toFile ().getAbsolutePath ());
10198 argsAsList .add ("-cert" );
102- argsAsList .add (
103- Objects .requireNonNull (FileHelper .getAbsoluteFilePathFromClassPath (prefix + "kirk.crt.pem" )).toFile ().getAbsolutePath ()
104- );
99+ argsAsList .add (FileHelper .getAbsoluteFilePathFromClassPath (prefix + "kirk.crt.pem" ).toFile ().getAbsolutePath ());
105100 argsAsList .add ("-key" );
106- argsAsList .add (
107- Objects .requireNonNull (FileHelper .getAbsoluteFilePathFromClassPath (prefix + "kirk.key.pem" )).toFile ().getAbsolutePath ()
108- );
101+ argsAsList .add (FileHelper .getAbsoluteFilePathFromClassPath (prefix + "kirk.key.pem" ).toFile ().getAbsolutePath ());
109102 argsAsList .add ("-p" );
110103 argsAsList .add (String .valueOf (clusterInfo .httpPort ));
111104 argsAsList .add ("-icl" );
@@ -138,17 +131,11 @@ public void testSecurityAdminHostnameVerificationNotEnforced() throws Exception
138131
139132 List <String > argsAsList = new ArrayList <>();
140133 argsAsList .add ("-cacert" );
141- argsAsList .add (
142- Objects .requireNonNull (FileHelper .getAbsoluteFilePathFromClassPath (prefix + "root-ca.pem" )).toFile ().getAbsolutePath ()
143- );
134+ argsAsList .add (FileHelper .getAbsoluteFilePathFromClassPath (prefix + "root-ca.pem" ).toFile ().getAbsolutePath ());
144135 argsAsList .add ("-cert" );
145- argsAsList .add (
146- Objects .requireNonNull (FileHelper .getAbsoluteFilePathFromClassPath (prefix + "kirk.crt.pem" )).toFile ().getAbsolutePath ()
147- );
136+ argsAsList .add (FileHelper .getAbsoluteFilePathFromClassPath (prefix + "kirk.crt.pem" ).toFile ().getAbsolutePath ());
148137 argsAsList .add ("-key" );
149- argsAsList .add (
150- Objects .requireNonNull (FileHelper .getAbsoluteFilePathFromClassPath (prefix + "kirk.key.pem" )).toFile ().getAbsolutePath ()
151- );
138+ argsAsList .add (FileHelper .getAbsoluteFilePathFromClassPath (prefix + "kirk.key.pem" ).toFile ().getAbsolutePath ());
152139 argsAsList .add ("-p" );
153140 argsAsList .add (String .valueOf (clusterInfo .httpPort ));
154141 argsAsList .add ("-icl" );
@@ -172,9 +159,9 @@ public void testSecurityAdminInvalidCert() throws Exception {
172159
173160 List <String > argsAsList = new ArrayList <>();
174161 argsAsList .add ("-ts" );
175- argsAsList .add (Objects . requireNonNull ( FileHelper .resolveStorePath (prefix + "truststore" ) ).toFile ().getAbsolutePath ());
162+ argsAsList .add (FileHelper .resolveStorePath (prefix + "truststore" ).toFile ().getAbsolutePath ());
176163 argsAsList .add ("-ks" );
177- argsAsList .add (Objects . requireNonNull ( FileHelper .resolveStorePath (prefix + "kirk-keystore" ) ).toFile ().getAbsolutePath ());
164+ argsAsList .add (FileHelper .resolveStorePath (prefix + "kirk-keystore" ).toFile ().getAbsolutePath ());
178165 argsAsList .add ("-p" );
179166 argsAsList .add (String .valueOf (clusterInfo .httpPort ));
180167 argsAsList .add ("-cn" );
@@ -191,9 +178,9 @@ public void testSecurityAdminInvalidCert() throws Exception {
191178
192179 argsAsList = new ArrayList <>();
193180 argsAsList .add ("-ts" );
194- argsAsList .add (Objects . requireNonNull ( FileHelper .resolveStorePath (prefix + "truststore" ) ).toFile ().getAbsolutePath ());
181+ argsAsList .add (FileHelper .resolveStorePath (prefix + "truststore" ).toFile ().getAbsolutePath ());
195182 argsAsList .add ("-ks" );
196- argsAsList .add (Objects . requireNonNull ( FileHelper .resolveStorePath (prefix + "spock-keystore" ) ).toFile ().getAbsolutePath ());
183+ argsAsList .add (FileHelper .resolveStorePath (prefix + "spock-keystore" ).toFile ().getAbsolutePath ());
197184 argsAsList .add ("-p" );
198185 argsAsList .add (String .valueOf (clusterInfo .httpPort ));
199186 argsAsList .add ("-cn" );
@@ -209,9 +196,9 @@ public void testSecurityAdminInvalidCert() throws Exception {
209196
210197 argsAsList = new ArrayList <>();
211198 argsAsList .add ("-ts" );
212- argsAsList .add (Objects . requireNonNull ( FileHelper .resolveStorePath (prefix + "truststore" ) ).toFile ().getAbsolutePath ());
199+ argsAsList .add (FileHelper .resolveStorePath (prefix + "truststore" ).toFile ().getAbsolutePath ());
213200 argsAsList .add ("-ks" );
214- argsAsList .add (Objects . requireNonNull ( FileHelper .resolveStorePath (prefix + "node-0-keystore" ) ).toFile ().getAbsolutePath ());
201+ argsAsList .add (FileHelper .resolveStorePath (prefix + "node-0-keystore" ).toFile ().getAbsolutePath ());
215202 argsAsList .add ("-p" );
216203 argsAsList .add (String .valueOf (clusterInfo .httpPort ));
217204 argsAsList .add ("-cn" );
@@ -238,9 +225,9 @@ public void testSecurityAdminRegularUpdate() throws Exception {
238225
239226 List <String > argsAsList = new ArrayList <>();
240227 argsAsList .add ("-ts" );
241- argsAsList .add (Objects . requireNonNull ( FileHelper .resolveStorePath (prefix + "truststore" ) ).toFile ().getAbsolutePath ());
228+ argsAsList .add (FileHelper .resolveStorePath (prefix + "truststore" ).toFile ().getAbsolutePath ());
242229 argsAsList .add ("-ks" );
243- argsAsList .add (Objects . requireNonNull ( FileHelper .resolveStorePath (prefix + "kirk-keystore" ) ).toFile ().getAbsolutePath ());
230+ argsAsList .add (FileHelper .resolveStorePath (prefix + "kirk-keystore" ).toFile ().getAbsolutePath ());
244231 argsAsList .add ("-p" );
245232 argsAsList .add (String .valueOf (clusterInfo .httpPort ));
246233 argsAsList .add ("-cn" );
@@ -273,9 +260,9 @@ public void testSecurityAdminSingularV7Updates() throws Exception {
273260
274261 List <String > argsAsList = new ArrayList <>();
275262 argsAsList .add ("-ts" );
276- argsAsList .add (Objects . requireNonNull ( FileHelper .resolveStorePath (prefix + "truststore" ) ).toFile ().getAbsolutePath ());
263+ argsAsList .add (FileHelper .resolveStorePath (prefix + "truststore" ).toFile ().getAbsolutePath ());
277264 argsAsList .add ("-ks" );
278- argsAsList .add (Objects . requireNonNull ( FileHelper .resolveStorePath (prefix + "kirk-keystore" ) ).toFile ().getAbsolutePath ());
265+ argsAsList .add (FileHelper .resolveStorePath (prefix + "kirk-keystore" ).toFile ().getAbsolutePath ());
279266 argsAsList .add ("-p" );
280267 argsAsList .add (String .valueOf (clusterInfo .httpPort ));
281268 argsAsList .add ("-cn" );
@@ -291,9 +278,9 @@ public void testSecurityAdminSingularV7Updates() throws Exception {
291278
292279 argsAsList = new ArrayList <>();
293280 argsAsList .add ("-ts" );
294- argsAsList .add (Objects . requireNonNull ( FileHelper .resolveStorePath (prefix + "truststore" ) ).toFile ().getAbsolutePath ());
281+ argsAsList .add (FileHelper .resolveStorePath (prefix + "truststore" ).toFile ().getAbsolutePath ());
295282 argsAsList .add ("-ks" );
296- argsAsList .add (Objects . requireNonNull ( FileHelper .resolveStorePath (prefix + "kirk-keystore" ) ).toFile ().getAbsolutePath ());
283+ argsAsList .add (FileHelper .resolveStorePath (prefix + "kirk-keystore" ).toFile ().getAbsolutePath ());
297284 argsAsList .add ("-p" );
298285 argsAsList .add (String .valueOf (clusterInfo .httpPort ));
299286 argsAsList .add ("-cn" );
@@ -309,9 +296,9 @@ public void testSecurityAdminSingularV7Updates() throws Exception {
309296
310297 argsAsList = new ArrayList <>();
311298 argsAsList .add ("-ts" );
312- argsAsList .add (Objects . requireNonNull ( FileHelper .resolveStorePath (prefix + "truststore" ) ).toFile ().getAbsolutePath ());
299+ argsAsList .add (FileHelper .resolveStorePath (prefix + "truststore" ).toFile ().getAbsolutePath ());
313300 argsAsList .add ("-ks" );
314- argsAsList .add (Objects . requireNonNull ( FileHelper .resolveStorePath (prefix + "kirk-keystore" ) ).toFile ().getAbsolutePath ());
301+ argsAsList .add (FileHelper .resolveStorePath (prefix + "kirk-keystore" ).toFile ().getAbsolutePath ());
315302 argsAsList .add ("-p" );
316303 argsAsList .add (String .valueOf (clusterInfo .httpPort ));
317304 argsAsList .add ("-cn" );
@@ -347,19 +334,15 @@ public void testSecurityAdminInvalidYml() throws Exception {
347334
348335 List <String > argsAsList = new ArrayList <>();
349336 argsAsList .add ("-ts" );
350- argsAsList .add (Objects . requireNonNull ( FileHelper .resolveStorePath (prefix + "truststore" ) ).toFile ().getAbsolutePath ());
337+ argsAsList .add (FileHelper .resolveStorePath (prefix + "truststore" ).toFile ().getAbsolutePath ());
351338 argsAsList .add ("-ks" );
352- argsAsList .add (Objects . requireNonNull ( FileHelper .resolveStorePath (prefix + "kirk-keystore" ) ).toFile ().getAbsolutePath ());
339+ argsAsList .add (FileHelper .resolveStorePath (prefix + "kirk-keystore" ).toFile ().getAbsolutePath ());
353340 argsAsList .add ("-p" );
354341 argsAsList .add (String .valueOf (clusterInfo .httpPort ));
355342 argsAsList .add ("-cn" );
356343 argsAsList .add (clusterInfo .clustername );
357344 argsAsList .add ("-f" );
358- argsAsList .add (
359- Objects .requireNonNull (FileHelper .getAbsoluteFilePathFromClassPath (prefix + "roles_invalidxcontent.yml" ))
360- .toFile ()
361- .getAbsolutePath ()
362- );
345+ argsAsList .add (FileHelper .getAbsoluteFilePathFromClassPath (prefix + "roles_invalidxcontent.yml" ).toFile ().getAbsolutePath ());
363346 argsAsList .add ("-t" );
364347 argsAsList .add ("roles" );
365348 argsAsList .add ("-nhnv" );
@@ -399,9 +382,9 @@ public void testSecurityAdminReloadInvalidConfig() throws Exception {
399382
400383 List <String > argsAsList = new ArrayList <>();
401384 argsAsList .add ("-ts" );
402- argsAsList .add (Objects . requireNonNull ( FileHelper .resolveStorePath (prefix + "truststore" ) ).toFile ().getAbsolutePath ());
385+ argsAsList .add (FileHelper .resolveStorePath (prefix + "truststore" ).toFile ().getAbsolutePath ());
403386 argsAsList .add ("-ks" );
404- argsAsList .add (Objects . requireNonNull ( FileHelper .resolveStorePath (prefix + "kirk-keystore" ) ).toFile ().getAbsolutePath ());
387+ argsAsList .add (FileHelper .resolveStorePath (prefix + "kirk-keystore" ).toFile ().getAbsolutePath ());
405388 argsAsList .add ("-p" );
406389 argsAsList .add (String .valueOf (clusterInfo .httpPort ));
407390 argsAsList .add ("-cn" );
@@ -503,9 +486,9 @@ public void testIsLegacySecurityIndexOnV7Index() throws Exception {
503486
504487 List <String > argsAsList = new ArrayList <>();
505488 argsAsList .add ("-ts" );
506- argsAsList .add (Objects . requireNonNull ( FileHelper .resolveStorePath (prefix + "truststore" ) ).toFile ().getAbsolutePath ());
489+ argsAsList .add (FileHelper .resolveStorePath (prefix + "truststore" ).toFile ().getAbsolutePath ());
507490 argsAsList .add ("-ks" );
508- argsAsList .add (Objects . requireNonNull ( FileHelper .resolveStorePath (prefix + "kirk-keystore" ) ).toFile ().getAbsolutePath ());
491+ argsAsList .add (FileHelper .resolveStorePath (prefix + "kirk-keystore" ).toFile ().getAbsolutePath ());
509492 argsAsList .add ("-p" );
510493 argsAsList .add (String .valueOf (clusterInfo .httpPort ));
511494 argsAsList .add ("-cn" );
0 commit comments