diff --git a/datafusion-java/build.gradle b/datafusion-java/build.gradle
index 95d8889..7209513 100644
--- a/datafusion-java/build.gradle
+++ b/datafusion-java/build.gradle
@@ -75,6 +75,10 @@ tasks.register('copyDevLibrary', Sync) {
     dependsOn cargoDevBuild
 }
 
+tasks.named("test") {
+    dependsOn copyDevLibrary
+}
+
 tasks.register('copyBuiltLibrary', Copy) {
     def extension = extensionMapping[osdetector.os]
     from "${rootDir}/datafusion-jni/target/release/libdatafusion_jni.$extension"