@@ -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 (ReflectionTestUtils .< Object > invokeMethod (this .launcher , "getPaths " )).hasToString ("[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 (ReflectionTestUtils .< Object > invokeMethod (this .launcher , "getPaths " )).hasToString ("[.]" );
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 (ReflectionTestUtils .< Object > invokeMethod (this .launcher , "getPaths " )).hasToString ("[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 (ReflectionTestUtils .< Object > invokeMethod (this .launcher , "getPaths " )).hasToString ("[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 (ReflectionTestUtils .< Object > invokeMethod (this .launcher , "getPaths " )).hasToString ("[jars/app.jar]" );
172172 this .launcher .launch (new String [0 ]);
173173 waitFor ("Hello World" );
174174 }
@@ -177,7 +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 " ))
180+ assertThat (ReflectionTestUtils .< Object > invokeMethod (this .launcher , "getPaths " ))
181181 .hasToString ("[jar:file:./src/test/resources/nested-jars/app.jar!/]" );
182182 Set <URL > urls = this .launcher .getClassPathUrls ();
183183 assertThat (urls ).areExactly (1 , endingWith ("foo.jar!/" ));
@@ -216,7 +216,7 @@ void testUserSpecifiedNestedJarPath() throws Exception {
216216 System .setProperty ("loader.path" , "nested-jars/nested-jar-app.jar!/BOOT-INF/classes/" );
217217 System .setProperty ("loader.main" , "demo.Application" );
218218 this .launcher = new PropertiesLauncher ();
219- assertThat (ReflectionTestUtils .getField (this .launcher , "paths " ))
219+ assertThat (ReflectionTestUtils .< Object > invokeMethod (this .launcher , "getPaths " ))
220220 .hasToString ("[nested-jars/nested-jar-app.jar!/BOOT-INF/classes/]" );
221221 this .launcher .launch (new String [0 ]);
222222 waitFor ("Hello World" );
@@ -236,7 +236,7 @@ void testUserSpecifiedJarPathWithDot() throws Exception {
236236 System .setProperty ("loader.path" , "./jars/app.jar" );
237237 System .setProperty ("loader.main" , "demo.Application" );
238238 this .launcher = new PropertiesLauncher ();
239- assertThat (ReflectionTestUtils .getField (this .launcher , "paths " )).hasToString ("[jars/app.jar]" );
239+ assertThat (ReflectionTestUtils .< Object > invokeMethod (this .launcher , "getPaths " )).hasToString ("[jars/app.jar]" );
240240 this .launcher .launch (new String [0 ]);
241241 waitFor ("Hello World" );
242242 }
@@ -246,7 +246,7 @@ void testUserSpecifiedClassLoader() throws Exception {
246246 System .setProperty ("loader.path" , "jars/app.jar" );
247247 System .setProperty ("loader.classLoader" , URLClassLoader .class .getName ());
248248 this .launcher = new PropertiesLauncher ();
249- assertThat (ReflectionTestUtils .getField (this .launcher , "paths " )).hasToString ("[jars/app.jar]" );
249+ assertThat (ReflectionTestUtils .< Object > invokeMethod (this .launcher , "getPaths " )).hasToString ("[jars/app.jar]" );
250250 this .launcher .launch (new String [0 ]);
251251 waitFor ("Hello World" );
252252 }
@@ -256,7 +256,7 @@ void testUserSpecifiedClassPathOrder() throws Exception {
256256 System .setProperty ("loader.path" , "more-jars/app.jar,jars/app.jar" );
257257 System .setProperty ("loader.classLoader" , URLClassLoader .class .getName ());
258258 this .launcher = new PropertiesLauncher ();
259- assertThat (ReflectionTestUtils .getField (this .launcher , "paths " ))
259+ assertThat (ReflectionTestUtils .< Object > invokeMethod (this .launcher , "getPaths " ))
260260 .hasToString ("[more-jars/app.jar, jars/app.jar]" );
261261 this .launcher .launch (new String [0 ]);
262262 waitFor ("Hello Other World" );
@@ -325,8 +325,8 @@ void testLoadPathCustomizedUsingManifest() throws Exception {
325325 manifest .write (manifestStream );
326326 }
327327 this .launcher = new PropertiesLauncher ();
328- assertThat ((List <String >) ReflectionTestUtils .getField (this .launcher , "paths " )). containsExactly ( "/foo.jar" ,
329- "/bar/" );
328+ assertThat ((List <String >) ReflectionTestUtils .invokeMethod (this .launcher , "getPaths " ))
329+ . containsExactly ( "/foo.jar" , "/bar/" );
330330 }
331331
332332 @ Test
0 commit comments