Fix resource registration hints in the TestContext framework
Resource patterns registered for inclusion in a GraalVM native image must not start with a leading slash.
This commit is contained in:
@@ -114,8 +114,8 @@ class StandardTestRuntimeHints implements TestRuntimeHintsRegistrar {
|
||||
|
||||
private String cleanClasspathResource(String location) {
|
||||
location = location.substring(CLASSPATH_URL_PREFIX.length());
|
||||
if (!location.startsWith(SLASH)) {
|
||||
location = SLASH + location;
|
||||
if (location.startsWith(SLASH)) {
|
||||
location = location.substring(1);
|
||||
}
|
||||
return location;
|
||||
}
|
||||
|
||||
@@ -399,8 +399,8 @@ public class SqlScriptsTestExecutionListener extends AbstractTestExecutionListen
|
||||
|
||||
private String cleanClasspathResource(String location) {
|
||||
location = location.substring(CLASSPATH_URL_PREFIX.length());
|
||||
if (!location.startsWith(SLASH)) {
|
||||
location = SLASH + location;
|
||||
if (location.startsWith(SLASH)) {
|
||||
location = location.substring(1);
|
||||
}
|
||||
return location;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user