From 03ce0def9392c7ffc5c408138a428decdf355807 Mon Sep 17 00:00:00 2001 From: Ryan Skraba Date: Thu, 4 Jan 2024 16:46:59 +0100 Subject: [PATCH] Fix mistaken service class and simplify assertions --- .../services/org.junit.jupiter.api.extension.Extension | 1 - .../flink/formats/csv/CsvFormatStatisticsReportTest.java | 8 ++++---- .../apache/flink/orc/OrcFormatStatisticsReportTest.java | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/flink-clients/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension b/flink-clients/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension index fed96af27026b..0b74fd4603ce2 100644 --- a/flink-clients/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension +++ b/flink-clients/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension @@ -14,4 +14,3 @@ # limitations under the License. org.apache.flink.util.TestLoggerExtension -org.junit.jupiter.api.extension.Extension diff --git a/flink-formats/flink-csv/src/test/java/org/apache/flink/formats/csv/CsvFormatStatisticsReportTest.java b/flink-formats/flink-csv/src/test/java/org/apache/flink/formats/csv/CsvFormatStatisticsReportTest.java index 0ae2e6657e65d..ec0332e5caf31 100644 --- a/flink-formats/flink-csv/src/test/java/org/apache/flink/formats/csv/CsvFormatStatisticsReportTest.java +++ b/flink-formats/flink-csv/src/test/java/org/apache/flink/formats/csv/CsvFormatStatisticsReportTest.java @@ -66,9 +66,9 @@ void testCsvFormatStatsReportWithSingleFile() throws Exception { // insert data and get statistics. DataType dataType = tEnv.from("sourceTable").getResolvedSchema().toPhysicalRowDataType(); tEnv.fromValues(dataType, getData()).executeInsert("sourceTable").await(); - assertThat(folder.listFiles()).isNotNull().hasSize(1); + assertThat(folder.listFiles()).hasSize(1); File[] files = folder.listFiles(); - assert files != null; + assertThat(files).isNotNull(); TableStats tableStats = csvBulkDecodingFormat.reportStatistics( Collections.singletonList(new Path(files[0].toURI().toString())), null); @@ -81,10 +81,10 @@ void testCsvFormatStatsReportWithMultiFile() throws Exception { DataType dataType = tEnv.from("sourceTable").getResolvedSchema().toPhysicalRowDataType(); tEnv.fromValues(dataType, getData()).executeInsert("sourceTable").await(); tEnv.fromValues(dataType, getData()).executeInsert("sourceTable").await(); - assertThat(folder.listFiles()).isNotNull().hasSize(2); + assertThat(folder.listFiles()).hasSize(2); File[] files = folder.listFiles(); List paths = new ArrayList<>(); - assert files != null; + assertThat(files).isNotNull(); paths.add(new Path(files[0].toURI().toString())); paths.add(new Path(files[1].toURI().toString())); TableStats tableStats = csvBulkDecodingFormat.reportStatistics(paths, null); diff --git a/flink-formats/flink-orc/src/test/java/org/apache/flink/orc/OrcFormatStatisticsReportTest.java b/flink-formats/flink-orc/src/test/java/org/apache/flink/orc/OrcFormatStatisticsReportTest.java index 6262f22e714ca..f2d2bdaf65adc 100644 --- a/flink-formats/flink-orc/src/test/java/org/apache/flink/orc/OrcFormatStatisticsReportTest.java +++ b/flink-formats/flink-orc/src/test/java/org/apache/flink/orc/OrcFormatStatisticsReportTest.java @@ -69,9 +69,9 @@ public void testOrcFormatStatsReportWithSingleFile() throws Exception { // insert data and get statistics. DataType dataType = tEnv.from("sourceTable").getResolvedSchema().toPhysicalRowDataType(); tEnv.fromValues(dataType, getData()).executeInsert("sourceTable").await(); - assertThat(folder.listFiles()).isNotNull().hasSize(1); + assertThat(folder.listFiles()).hasSize(1); File[] files = folder.listFiles(); - assert files != null; + assertThat(files).isNotNull(); TableStats tableStats = orcBulkDecodingFormat.reportStatistics( Collections.singletonList(new Path(files[0].toURI().toString())), dataType);