mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-09-27 14:02:38 +02:00
Change TestResources to use build dir instead of classpath
This should fix ReactExporterTest failing
This commit is contained in:
parent
3e0ad424b8
commit
9ea565f441
@ -16,8 +16,6 @@
|
||||
*/
|
||||
package utilities;
|
||||
|
||||
import com.djrapitops.plan.PlanPlugin;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
@ -60,7 +58,10 @@ public class TestResources {
|
||||
|
||||
private static void writeResourceToFile(File toFile, String resourcePath) {
|
||||
try (
|
||||
InputStream in = PlanPlugin.class.getResourceAsStream(resourcePath);
|
||||
// Gradle copied resources are not in the classpath during tests for some reason,
|
||||
// so they're taken from build dir where they're copied to.
|
||||
InputStream in = Files.newInputStream(new File("").toPath()
|
||||
.resolve("../common/build/resources/main" + resourcePath));
|
||||
OutputStream out = Files.newOutputStream(toFile.toPath())
|
||||
) {
|
||||
if (in == null) {
|
||||
|
Loading…
Reference in New Issue
Block a user