@@ -127,7 +127,7 @@ void testUserSpecifiedConfigName() throws Exception {
127127 System .setProperty ("loader.config.name" , "foo" );
128128 this .launcher = new PropertiesLauncher ();
129129 assertThat (this .launcher .getMainClass ()).isEqualTo ("my.Application" );
130- assertThat (ReflectionTestUtils . getField ( this . launcher , "paths" )).hasToString ( "[ etc/] " );
130+ assertThat (resolvedPaths ( )).containsExactly ( " etc/" );
131131 }
132132
133133 @ Test
@@ -141,14 +141,14 @@ void testRootOfClasspathFirst() throws Exception {
141141 void testUserSpecifiedDotPath () throws Exception {
142142 System .setProperty ("loader.path" , "." );
143143 this .launcher = new PropertiesLauncher ();
144- assertThat (ReflectionTestUtils . getField ( this . launcher , "paths" )).hasToString ( "[.] " );
144+ assertThat (resolvedPaths ( )).containsExactly ( ". " );
145145 }
146146
147147 @ Test
148148 void testUserSpecifiedSlashPath () throws Exception {
149149 System .setProperty ("loader.path" , "jars/" );
150150 this .launcher = new PropertiesLauncher ();
151- assertThat (ReflectionTestUtils . getField ( this . launcher , "paths" )).hasToString ( "[ jars/] " );
151+ assertThat (resolvedPaths ( )).containsExactly ( " jars/" );
152152 Set <URL > urls = this .launcher .getClassPathUrls ();
153153 assertThat (urls ).areExactly (1 , endingWith ("app.jar" ));
154154 }
@@ -158,7 +158,7 @@ void testUserSpecifiedWildcardPath() throws Exception {
158158 System .setProperty ("loader.path" , "jars/*" );
159159 System .setProperty ("loader.main" , "demo.Application" );
160160 this .launcher = new PropertiesLauncher ();
161- assertThat (ReflectionTestUtils . getField ( this . launcher , "paths" )).hasToString ( "[ jars/] " );
161+ assertThat (resolvedPaths ( )).containsExactly ( " jars/" );
162162 this .launcher .launch (new String [0 ]);
163163 waitFor ("Hello World" );
164164 }
@@ -168,7 +168,7 @@ void testUserSpecifiedJarPath() throws Exception {
168168 System .setProperty ("loader.path" , "jars/app.jar" );
169169 System .setProperty ("loader.main" , "demo.Application" );
170170 this .launcher = new PropertiesLauncher ();
171- assertThat (ReflectionTestUtils . getField ( this . launcher , "paths" )).hasToString ( "[ jars/app.jar] " );
171+ assertThat (resolvedPaths ( )).containsExactly ( " jars/app.jar" );
172172 this .launcher .launch (new String [0 ]);
173173 waitFor ("Hello World" );
174174 }
@@ -177,8 +177,7 @@ void testUserSpecifiedJarPath() throws Exception {
177177 void testUserSpecifiedRootOfJarPath () throws Exception {
178178 System .setProperty ("loader.path" , "jar:file:./src/test/resources/nested-jars/app.jar!/" );
179179 this .launcher = new PropertiesLauncher ();
180- assertThat (ReflectionTestUtils .getField (this .launcher , "paths" ))
181- .hasToString ("[jar:file:./src/test/resources/nested-jars/app.jar!/]" );
180+ assertThat (resolvedPaths ()).containsExactly ("jar:file:./src/test/resources/nested-jars/app.jar!/" );
182181 Set <URL > urls = this .launcher .getClassPathUrls ();
183182 assertThat (urls ).areExactly (1 , endingWith ("foo.jar!/" ));
184183 assertThat (urls ).areExactly (1 , endingWith ("app.jar!/" ));
@@ -216,8 +215,7 @@ void testUserSpecifiedNestedJarPath() throws Exception {
216215 System .setProperty ("loader.path" , "nested-jars/nested-jar-app.jar!/BOOT-INF/classes/" );
217216 System .setProperty ("loader.main" , "demo.Application" );
218217 this .launcher = new PropertiesLauncher ();
219- assertThat (ReflectionTestUtils .getField (this .launcher , "paths" ))
220- .hasToString ("[nested-jars/nested-jar-app.jar!/BOOT-INF/classes/]" );
218+ assertThat (resolvedPaths ()).containsExactly ("nested-jars/nested-jar-app.jar!/BOOT-INF/classes/" );
221219 this .launcher .launch (new String [0 ]);
222220 waitFor ("Hello World" );
223221 }
@@ -236,7 +234,7 @@ void testUserSpecifiedJarPathWithDot() throws Exception {
236234 System .setProperty ("loader.path" , "./jars/app.jar" );
237235 System .setProperty ("loader.main" , "demo.Application" );
238236 this .launcher = new PropertiesLauncher ();
239- assertThat (ReflectionTestUtils . getField ( this . launcher , "paths" )).hasToString ( "[ jars/app.jar] " );
237+ assertThat (resolvedPaths ( )).containsExactly ( " jars/app.jar" );
240238 this .launcher .launch (new String [0 ]);
241239 waitFor ("Hello World" );
242240 }
@@ -246,7 +244,7 @@ void testUserSpecifiedClassLoader() throws Exception {
246244 System .setProperty ("loader.path" , "jars/app.jar" );
247245 System .setProperty ("loader.classLoader" , URLClassLoader .class .getName ());
248246 this .launcher = new PropertiesLauncher ();
249- assertThat (ReflectionTestUtils . getField ( this . launcher , "paths" )).hasToString ( "[ jars/app.jar] " );
247+ assertThat (resolvedPaths ( )).containsExactly ( " jars/app.jar" );
250248 this .launcher .launch (new String [0 ]);
251249 waitFor ("Hello World" );
252250 }
@@ -256,8 +254,7 @@ void testUserSpecifiedClassPathOrder() throws Exception {
256254 System .setProperty ("loader.path" , "more-jars/app.jar,jars/app.jar" );
257255 System .setProperty ("loader.classLoader" , URLClassLoader .class .getName ());
258256 this .launcher = new PropertiesLauncher ();
259- assertThat (ReflectionTestUtils .getField (this .launcher , "paths" ))
260- .hasToString ("[more-jars/app.jar, jars/app.jar]" );
257+ assertThat (resolvedPaths ()).containsExactly ("more-jars/app.jar" , "jars/app.jar" );
261258 this .launcher .launch (new String [0 ]);
262259 waitFor ("Hello Other World" );
263260 }
@@ -309,7 +306,7 @@ void testSystemPropertiesSet() throws Exception {
309306 void testArgsEnhanced () throws Exception {
310307 System .setProperty ("loader.args" , "foo" );
311308 this .launcher = new PropertiesLauncher ();
312- assertThat (Arrays .asList (this .launcher .getArgs ("bar" ))).hasToString ( "[ foo, bar] " );
309+ assertThat (Arrays .asList (this .launcher .getArgs ("bar" ))).containsExactly ( " foo" , " bar" );
313310 }
314311
315312 @ Test
@@ -325,8 +322,7 @@ void testLoadPathCustomizedUsingManifest() throws Exception {
325322 manifest .write (manifestStream );
326323 }
327324 this .launcher = new PropertiesLauncher ();
328- assertThat ((List <String >) ReflectionTestUtils .getField (this .launcher , "paths" )).containsExactly ("/foo.jar" ,
329- "/bar/" );
325+ assertThat (resolvedPaths ()).containsExactly ("/foo.jar" , "/bar/" );
330326 }
331327
332328 @ Test
@@ -447,6 +443,10 @@ private List<File> getExpectedFilesWithExtraLibs(File parent) {
447443 return expected ;
448444 }
449445
446+ private List <String > resolvedPaths () {
447+ return ReflectionTestUtils .invokeMethod (this .launcher , "resolvePaths" );
448+ }
449+
450450 private Condition <URL > endingWith (String value ) {
451451 return new Condition <>() {
452452
0 commit comments