@@ -76,7 +76,8 @@ public class TestUtils {
7676 final public static DataKey <Collection <Extension >> LOAD_EXTENSIONS = LoadUnloadDataKeyAggregator .LOAD_EXTENSIONS ;
7777 final private static DataHolder EMPTY_OPTIONS = new DataSet ();
7878 final public static DataKey <BiFunction <String , String , DataHolder >> CUSTOM_OPTION = new DataKey <>("CUSTOM_OPTION" , (option , params ) -> EMPTY_OPTIONS );
79- final public static String FILE_PROTOCOL = ResourceUrlResolver .FILE_PROTOCOL ;
79+ final public static String FILE_PROTOCOL_SINGLE_SLASH = ResourceUrlResolver .FILE_PROTOCOL_SINGLE_SLASH ;
80+ final public static String FILE_PROTOCOL_DOUBLE_SLASH = ResourceUrlResolver .FILE_PROTOCOL_DOUBLE_SLASH ;
8081
8182 public static DataHolder processOption (@ NotNull Map <String , ? extends DataHolder > optionsMap , @ NotNull String option ) {
8283 DataHolder dataHolder = null ;
@@ -612,7 +613,13 @@ public static DataHolder[] dataHolders(@Nullable DataHolder other, @Nullable Dat
612613 public static String getTestResourceRootDirectoryForModule (@ NotNull Class <?> resourceClass , @ NotNull String moduleRootPackage ) {
613614 String fileUrl ;
614615 fileUrl = getSpecResourceFileUrl (resourceClass , wrapWith (moduleRootPackage , "/" , ".txt" ));
615- return removePrefix (removeSuffix (fileUrl , suffixWith (moduleRootPackage , ".txt" )), FILE_PROTOCOL );
616+ fileUrl = removeSuffix (fileUrl , suffixWith (moduleRootPackage , ".txt" ));
617+ if (fileUrl .startsWith (FILE_PROTOCOL_DOUBLE_SLASH )) {
618+ fileUrl = removePrefix (fileUrl , FILE_PROTOCOL_DOUBLE_SLASH );
619+ } else if (fileUrl .startsWith (FILE_PROTOCOL_SINGLE_SLASH )) {
620+ fileUrl = removePrefix (fileUrl , FILE_PROTOCOL_SINGLE_SLASH );
621+ }
622+ return fileUrl ;
616623 }
617624
618625 @ NotNull
@@ -623,7 +630,11 @@ public static String getRootDirectoryForModule(@NotNull Class<?> resourceClass,
623630 if (pos != -1 ) {
624631 fileUrl = fileUrl .substring (0 , pos );
625632 }
626- fileUrl = fileUrl .substring (FILE_PROTOCOL .length ());
633+ if (fileUrl .startsWith (FILE_PROTOCOL_DOUBLE_SLASH )) {
634+ fileUrl = fileUrl .substring (FILE_PROTOCOL_DOUBLE_SLASH .length ());
635+ } else if (fileUrl .startsWith (FILE_PROTOCOL_SINGLE_SLASH )) {
636+ fileUrl = fileUrl .substring (FILE_PROTOCOL_SINGLE_SLASH .length ());
637+ }
627638 return fileUrl ;
628639 }
629640
0 commit comments