LadyForest commented on code in PR #24390: URL: https://github.com/apache/flink/pull/24390#discussion_r1521195360
########## flink-connectors/flink-connector-files/src/test/java/org/apache/flink/connector/file/table/FileSystemOutputFormatTest.java: ########## @@ -37,24 +39,44 @@ import java.io.File; import java.io.IOException; import java.nio.file.Files; +import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; -import java.util.TreeMap; -import java.util.concurrent.atomic.AtomicReference; +import java.util.UUID; +import java.util.function.Supplier; +import java.util.stream.Collectors; import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.entry; +import static org.assertj.core.api.Assertions.assertThatThrownBy; /** Test for {@link FileSystemOutputFormat}. */ class FileSystemOutputFormatTest { - @TempDir private java.nio.file.Path tmpPath; @TempDir private java.nio.file.Path outputPath; + @TempDir private java.nio.file.Path stagingBaseDir; + + private java.nio.file.Path stagingPath; Review Comment: The reason to introduce both`stagingBaseDir` and `stagingPath` is that 1. We cannot directly use `@TempDir` to annotate `stagingPath`. Junit5 will automatically create a temp directory, and thus the test will fail at `Preconditions.checkState`. 2. The reason to introduce `@TempDir stagingBaseDir`(rather than reuse `outputPath`) is to decouple the test logic. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org