package sttp.client

import java.io.File

import org.scalatest.{FlatSpec, Matchers, Suite}
import sttp.client.internal.SttpFile

trait ToCurlConverterTestExtension { suit: Suite with FlatSpec with Matchers =>
  it should "render multipart form data if content is a file" in {
    basicRequest
      .multipartBody(multipartSttpFile("upload", SttpFile.fromPath(new File("myDataSet").toPath)))
      .post(uri"http://localhost")
      .toCurl should include(
      """--form 'upload=@myDataSet'"""
    )
  }
}

package sttp.client

import java.nio.file.Path

import org.scalatest.{FlatSpec, Matchers, Suite}
import sttp.client.internal.SttpFile

trait ToCurlConverterTestExtension { suit: Suite with FlatSpec with Matchers =>
  it should "render multipart form data if content is a file" in {
    basicRequest
      .multipartBody(multipartSttpFile("upload", SttpFile.fromPath(Path.of("myDataSet"))))
      .post(uri"http://localhost")
      .toCurl should include(
      """--form 'upload=@myDataSet'"""
    )
  }
}

--- 
+++ 
@@ -1,6 +1,6 @@
 package sttp.client
 
-import java.nio.file.Path
+import java.io.File
 
 import org.scalatest.{FlatSpec, Matchers, Suite}
 import sttp.client.internal.SttpFile
@@ -8,7 +8,7 @@
 trait ToCurlConverterTestExtension { suit: Suite with FlatSpec with Matchers =>
   it should "render multipart form data if content is a file" in {
     basicRequest
-      .multipartBody(multipartSttpFile("upload", SttpFile.fromPath(Path.of("myDataSet"))))
+      .multipartBody(multipartSttpFile("upload", SttpFile.fromPath(new File("myDataSet").toPath)))
       .post(uri"http://localhost")
       .toCurl should include(
       """--form 'upload=@myDataSet'"""
Replace Path.of with new File.toPath
