ATS-691: Make path to test files OS agnostic (#197)

* ATS-691: Make path to test files OS agnostic

* ATS-691: Decode URL object in the method's return
This commit is contained in:
Kristian Dimitrov 2020-04-01 16:13:56 +01:00 committed by GitHub
parent 111fcfcc0e
commit 5c6782a3aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,7 +44,9 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLDecoder;
import java.nio.channels.FileChannel;
import java.nio.file.Files;
import java.util.List;
@ -168,7 +170,7 @@ public abstract class AbstractTransformerControllerTest
throw new IOException("The test file " + testFilename +
" does not exist in the resources directory");
}
return testFileUrl == null ? null : new File(testFileUrl.getFile());
return testFileUrl == null ? null : new File(URLDecoder.decode(testFileUrl.getPath(), "UTF-8"));
}
protected MockHttpServletRequestBuilder mockMvcRequest(String url, MockMultipartFile sourceFile,