String (TestSource testSource, TestSource parentSource) { if (testSource instanceof CompositeTestSource) { CompositeTestSource compositeTestSource = ((CompositeTestSource)testSource); for (TestSource sourceFromComposite : compositeTestSource.getSources()) { String locationHintValue = getLocationHintValue(sourceFromComposite, parentSource); if (!NO_LOCATION_HINT_VALUE.equals(locationHintValue)) { return locationHintValue; } } return NO_LOCATION_HINT_VALUE; } if (testSource instanceof FileSource) { FileSource fileSource = (FileSource)testSource; File file = fileSource.getFile(); String line = fileSource.getPosition() .map(position -> ":" + position.getLine()) .orElse(""); return "file://" + file.getAbsolutePath() + line; } if (testSource instanceof MethodSource) { MethodSource methodSource = (MethodSource)testSource; return javaLocation(methodSource.getClassName(), methodSource.getMethodName(), true); } if (testSource instanceof ClassSource) { String className = ((ClassSource)testSource).getClassName(); return javaLocation(className, null, false); } if (parentSource != null) { return getLocationHintValue(parentSource,null); } return NO_LOCATION_HINT_VALUE; }