From f9e21889540d809d6a7183407c949750b48f5ec5 Mon Sep 17 00:00:00 2001 From: Miles Yucht Date: Mon, 28 Aug 2023 14:25:22 +0200 Subject: [PATCH] test getStatus as well --- .../test/java/com/databricks/sdk/integration/FilesIT.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/databricks-sdk-java/src/test/java/com/databricks/sdk/integration/FilesIT.java b/databricks-sdk-java/src/test/java/com/databricks/sdk/integration/FilesIT.java index acbcdb1e6..afc0d05d6 100644 --- a/databricks-sdk-java/src/test/java/com/databricks/sdk/integration/FilesIT.java +++ b/databricks-sdk-java/src/test/java/com/databricks/sdk/integration/FilesIT.java @@ -8,6 +8,8 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; + +import com.databricks.sdk.service.files.FileInfo; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -45,6 +47,10 @@ private void writeFileAndReadFileInner( // Write the file to DBFS. workspace.files().upload(fileName, inputStream); + // Read file status + FileInfo fileStatus = workspace.files().getStatus(fileName); + Assertions.assertEquals(fileStatus.getPath(), fileName); + // Read the file back from DBFS. try (InputStream readContents = workspace.files().download(fileName).getContents()) { byte[] result = new byte[fileContents.length];