@@ -168,25 +168,27 @@ public static Path getTestClassesLocation(Class<?> testClass) {
168
168
* @return directory or JAR containing the application being tested by the test class
169
169
*/
170
170
public static Path getAppClassLocation (Class <?> testClass ) {
171
- return getAppClassLocationForTestLocation (getTestClassesLocation (testClass ). toString () );
171
+ return getAppClassLocationForTestLocation (getTestClassesLocation (testClass ));
172
172
}
173
173
174
174
/**
175
175
* Resolves the directory or the JAR file containing the application being tested by a test from the given location.
176
176
*
177
- * @param testClassLocation the test class location
177
+ * @param testClassLocationPath the test class location
178
178
* @return directory or JAR containing the application being tested by a test from the given location
179
179
*/
180
- public static Path getAppClassLocationForTestLocation (String testClassLocation ) {
181
- if (testClassLocation .endsWith (".jar" )) {
182
- if (testClassLocation .endsWith ("-tests.jar" )) {
180
+ public static Path getAppClassLocationForTestLocation (Path testClassLocationPath ) {
181
+ if (testClassLocationPath .endsWith (".jar" )) {
182
+ if (testClassLocationPath .endsWith ("-tests.jar" )) {
183
+ String testClassLocation = testClassLocationPath .toString ();
183
184
return Paths .get (new StringBuilder ()
184
185
.append (testClassLocation , 0 , testClassLocation .length () - "-tests.jar" .length ())
185
186
.append (".jar" )
186
187
.toString ());
187
188
}
188
- return Path . of ( testClassLocation ) ;
189
+ return testClassLocationPath ;
189
190
}
191
+ String testClassLocation = testClassLocationPath .toString ();
190
192
Optional <Path > mainClassesDir = TEST_TO_MAIN_DIR_FRAGMENTS .entrySet ().stream ()
191
193
.filter (e -> testClassLocation .contains (e .getKey ()))
192
194
.map (e -> {
0 commit comments