diff --git a/client/trino-cli/pom.xml b/client/trino-cli/pom.xml
index 992bd6d8b3a4..7d9505ff0ed2 100644
--- a/client/trino-cli/pom.xml
+++ b/client/trino-cli/pom.xml
@@ -157,24 +157,6 @@
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
-
-
- org.apache.maven.surefire
- surefire-junit-platform
- ${dep.plugin.surefire.version}
-
-
- org.apache.maven.surefire
- surefire-testng
- ${dep.plugin.surefire.version}
-
-
-
-
org.apache.maven.plugins
maven-shade-plugin
diff --git a/lib/trino-hdfs/src/test/java/io/trino/hdfs/rubix/TestRubixCaching.java b/lib/trino-hdfs/src/test/java/io/trino/hdfs/rubix/TestRubixCaching.java
index 870acf1adf5c..8acfa153871c 100644
--- a/lib/trino-hdfs/src/test/java/io/trino/hdfs/rubix/TestRubixCaching.java
+++ b/lib/trino-hdfs/src/test/java/io/trino/hdfs/rubix/TestRubixCaching.java
@@ -49,11 +49,13 @@
import org.apache.hadoop.fs.FilterFileSystem;
import org.apache.hadoop.fs.Path;
import org.gaul.modernizer_maven_annotations.SuppressModernizer;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInstance;
+import org.junit.jupiter.api.parallel.Execution;
import javax.management.MBeanServer;
import javax.management.ObjectName;
@@ -91,9 +93,12 @@
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS;
+import static org.junit.jupiter.api.parallel.ExecutionMode.SAME_THREAD;
import static org.testng.Assert.assertEquals;
-@Test(singleThreaded = true)
+@TestInstance(PER_CLASS)
+@Execution(SAME_THREAD)
public class TestRubixCaching
{
private static final DataSize SMALL_FILE_SIZE = DataSize.of(1, MEGABYTE);
@@ -109,7 +114,7 @@ public class TestRubixCaching
private FileSystem nonCachingFileSystem;
private FileSystem cachingFileSystem;
- @BeforeClass
+ @BeforeAll
public void setup()
throws IOException
{
@@ -121,8 +126,8 @@ public void setup()
nonCachingFileSystem = getNonCachingFileSystem();
}
- @AfterMethod(alwaysRun = true)
- @BeforeMethod
+ @AfterEach
+ @BeforeEach
public void deinitializeRubix()
{
// revert static rubix initialization done by other tests
@@ -223,7 +228,7 @@ private FileSystem getCachingFileSystem(HdfsContext context, Path path)
return environment.getFileSystem(context, path);
}
- @AfterClass(alwaysRun = true)
+ @AfterAll
public void tearDown()
throws IOException
{
@@ -232,7 +237,7 @@ public void tearDown()
mBeanServer = null;
}
- @AfterMethod(alwaysRun = true)
+ @AfterEach
public void closeRubix()
throws IOException
{
diff --git a/lib/trino-matching/pom.xml b/lib/trino-matching/pom.xml
index b72955e2a4db..1eb145ae2dce 100644
--- a/lib/trino-matching/pom.xml
+++ b/lib/trino-matching/pom.xml
@@ -46,26 +46,4 @@
test
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
-
-
- org.apache.maven.surefire
- surefire-junit-platform
- ${dep.plugin.surefire.version}
-
-
- org.apache.maven.surefire
- surefire-testng
- ${dep.plugin.surefire.version}
-
-
-
-
-
diff --git a/lib/trino-memory-context/pom.xml b/lib/trino-memory-context/pom.xml
index 96dd54a2f224..699c27c1dbfe 100644
--- a/lib/trino-memory-context/pom.xml
+++ b/lib/trino-memory-context/pom.xml
@@ -63,33 +63,5 @@
junit-jupiter-engine
test
-
-
- org.testng
- testng
- test
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
-
-
- org.apache.maven.surefire
- surefire-junit-platform
- ${dep.plugin.surefire.version}
-
-
- org.apache.maven.surefire
- surefire-testng
- ${dep.plugin.surefire.version}
-
-
-
-
-
diff --git a/lib/trino-memory-context/src/test/java/io/trino/memory/context/TestMemoryContexts.java b/lib/trino-memory-context/src/test/java/io/trino/memory/context/TestMemoryContexts.java
index df080eecbe5e..97ae0f0af20f 100644
--- a/lib/trino-memory-context/src/test/java/io/trino/memory/context/TestMemoryContexts.java
+++ b/lib/trino-memory-context/src/test/java/io/trino/memory/context/TestMemoryContexts.java
@@ -22,11 +22,8 @@
import static io.airlift.units.DataSize.Unit.MEGABYTE;
import static io.trino.memory.context.AggregatedMemoryContext.newRootAggregatedMemoryContext;
import static io.trino.memory.context.AggregatedMemoryContext.newSimpleAggregatedMemoryContext;
+import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNotEquals;
-import static org.testng.Assert.assertTrue;
public class TestMemoryContexts
{
@@ -41,14 +38,14 @@ public void testLocalMemoryContextClose()
LocalMemoryContext localContext = aggregateContext.newLocalMemoryContext("test");
localContext.setBytes(100);
- assertEquals(localContext.getBytes(), 100);
- assertEquals(aggregateContext.getBytes(), 100);
- assertEquals(reservationHandler.getReservation(), 100);
+ assertThat(localContext.getBytes()).isEqualTo(100);
+ assertThat(aggregateContext.getBytes()).isEqualTo(100);
+ assertThat(reservationHandler.getReservation()).isEqualTo(100);
localContext.close();
- assertEquals(localContext.getBytes(), 0);
- assertEquals(aggregateContext.getBytes(), 0);
- assertEquals(reservationHandler.getReservation(), 0);
+ assertThat(localContext.getBytes()).isEqualTo(0);
+ assertThat(aggregateContext.getBytes()).isEqualTo(0);
+ assertThat(reservationHandler.getReservation()).isEqualTo(0);
}
@Test
@@ -58,22 +55,22 @@ public void testMemoryContexts()
AggregatedMemoryContext aggregateContext = newRootAggregatedMemoryContext(reservationHandler, GUARANTEED_MEMORY);
LocalMemoryContext localContext = aggregateContext.newLocalMemoryContext("test");
- assertEquals(localContext.setBytes(10), NOT_BLOCKED);
- assertEquals(localContext.getBytes(), 10);
- assertEquals(aggregateContext.getBytes(), 10);
- assertEquals(reservationHandler.getReservation(), aggregateContext.getBytes());
+ assertThat(localContext.setBytes(10)).isEqualTo(NOT_BLOCKED);
+ assertThat(localContext.getBytes()).isEqualTo(10);
+ assertThat(aggregateContext.getBytes()).isEqualTo(10);
+ assertThat(reservationHandler.getReservation()).isEqualTo(aggregateContext.getBytes());
LocalMemoryContext secondLocalContext = aggregateContext.newLocalMemoryContext("test");
- assertEquals(secondLocalContext.setBytes(20), NOT_BLOCKED);
- assertEquals(secondLocalContext.getBytes(), 20);
- assertEquals(aggregateContext.getBytes(), 30);
- assertEquals(localContext.getBytes(), 10);
- assertEquals(reservationHandler.getReservation(), aggregateContext.getBytes());
+ assertThat(secondLocalContext.setBytes(20)).isEqualTo(NOT_BLOCKED);
+ assertThat(secondLocalContext.getBytes()).isEqualTo(20);
+ assertThat(aggregateContext.getBytes()).isEqualTo(30);
+ assertThat(localContext.getBytes()).isEqualTo(10);
+ assertThat(reservationHandler.getReservation()).isEqualTo(aggregateContext.getBytes());
aggregateContext.close();
- assertEquals(aggregateContext.getBytes(), 0);
- assertEquals(reservationHandler.getReservation(), 0);
+ assertThat(aggregateContext.getBytes()).isEqualTo(0);
+ assertThat(reservationHandler.getReservation()).isEqualTo(0);
}
@Test
@@ -85,19 +82,19 @@ public void testTryReserve()
AggregatedMemoryContext aggregateContext2 = parentContext.newAggregatedMemoryContext();
LocalMemoryContext childContext1 = aggregateContext1.newLocalMemoryContext("test");
- assertTrue(childContext1.trySetBytes(500));
- assertTrue(childContext1.trySetBytes(1_000));
- assertFalse(childContext1.trySetBytes(1_001));
- assertEquals(reservationHandler.getReservation(), parentContext.getBytes());
+ assertThat(childContext1.trySetBytes(500)).isTrue();
+ assertThat(childContext1.trySetBytes(1_000)).isTrue();
+ assertThat(childContext1.trySetBytes(1_001)).isFalse();
+ assertThat(reservationHandler.getReservation()).isEqualTo(parentContext.getBytes());
aggregateContext1.close();
aggregateContext2.close();
parentContext.close();
- assertEquals(aggregateContext1.getBytes(), 0);
- assertEquals(aggregateContext2.getBytes(), 0);
- assertEquals(parentContext.getBytes(), 0);
- assertEquals(reservationHandler.getReservation(), 0);
+ assertThat(aggregateContext1.getBytes()).isEqualTo(0);
+ assertThat(aggregateContext2.getBytes()).isEqualTo(0);
+ assertThat(parentContext.getBytes()).isEqualTo(0);
+ assertThat(reservationHandler.getReservation()).isEqualTo(0);
}
@Test
@@ -110,13 +107,13 @@ public void testHierarchicalMemoryContexts()
LocalMemoryContext childContext1 = aggregateContext1.newLocalMemoryContext("test");
LocalMemoryContext childContext2 = aggregateContext2.newLocalMemoryContext("test");
- assertEquals(childContext1.setBytes(1), NOT_BLOCKED);
- assertEquals(childContext2.setBytes(1), NOT_BLOCKED);
+ assertThat(childContext1.setBytes(1)).isEqualTo(NOT_BLOCKED);
+ assertThat(childContext2.setBytes(1)).isEqualTo(NOT_BLOCKED);
- assertEquals(aggregateContext1.getBytes(), 1);
- assertEquals(aggregateContext2.getBytes(), 1);
- assertEquals(parentContext.getBytes(), aggregateContext1.getBytes() + aggregateContext2.getBytes());
- assertEquals(reservationHandler.getReservation(), parentContext.getBytes());
+ assertThat(aggregateContext1.getBytes()).isEqualTo(1);
+ assertThat(aggregateContext2.getBytes()).isEqualTo(1);
+ assertThat(parentContext.getBytes()).isEqualTo(aggregateContext1.getBytes() + aggregateContext2.getBytes());
+ assertThat(reservationHandler.getReservation()).isEqualTo(parentContext.getBytes());
}
@Test
@@ -129,22 +126,23 @@ public void testGuaranteedMemoryDoesntBlock()
// exhaust the max memory available
reservationHandler.exhaustMemory();
- assertEquals(reservationHandler.getReservation(), maxMemory);
+ assertThat(reservationHandler.getReservation()).isEqualTo(maxMemory);
// even if the pool is exhausted we never block queries using a trivial amount of memory
- assertEquals(childContext.setBytes(1_000), NOT_BLOCKED);
- assertNotEquals(childContext.setBytes(GUARANTEED_MEMORY + 1), NOT_BLOCKED);
+ assertThat(childContext.setBytes(1_000)).isEqualTo(NOT_BLOCKED);
+ assertThat(childContext.setBytes(GUARANTEED_MEMORY + 1))
+ .isNotEqualTo(NOT_BLOCKED);
// at this point the memory contexts have reserved GUARANTEED_MEMORY + 1 bytes
childContext.close();
parentContext.close();
- assertEquals(childContext.getBytes(), 0);
- assertEquals(parentContext.getBytes(), 0);
+ assertThat(childContext.getBytes()).isEqualTo(0);
+ assertThat(parentContext.getBytes()).isEqualTo(0);
// since we have exhausted the memory above after the memory contexts are closed
// the pool must still be exhausted
- assertEquals(reservationHandler.getReservation(), maxMemory);
+ assertThat(reservationHandler.getReservation()).isEqualTo(maxMemory);
}
@Test
diff --git a/lib/trino-plugin-toolkit/pom.xml b/lib/trino-plugin-toolkit/pom.xml
index 67ab71419396..cbdc83dd8351 100644
--- a/lib/trino-plugin-toolkit/pom.xml
+++ b/lib/trino-plugin-toolkit/pom.xml
@@ -213,24 +213,5 @@
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
-
-
- org.apache.maven.surefire
- surefire-junit-platform
- ${dep.plugin.surefire.version}
-
-
- org.apache.maven.surefire
- surefire-testng
- ${dep.plugin.surefire.version}
-
-
-
-
diff --git a/lib/trino-record-decoder/pom.xml b/lib/trino-record-decoder/pom.xml
index 73e0fd62a3f8..96d06eb4caa6 100644
--- a/lib/trino-record-decoder/pom.xml
+++ b/lib/trino-record-decoder/pom.xml
@@ -195,24 +195,6 @@
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
-
-
- org.apache.maven.surefire
- surefire-junit-platform
- ${dep.plugin.surefire.version}
-
-
- org.apache.maven.surefire
- surefire-testng
- ${dep.plugin.surefire.version}
-
-
-
diff --git a/plugin/trino-accumulo/pom.xml b/plugin/trino-accumulo/pom.xml
index 1d96733b1626..8d4b56b7952c 100644
--- a/plugin/trino-accumulo/pom.xml
+++ b/plugin/trino-accumulo/pom.xml
@@ -324,24 +324,6 @@
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
-
-
- org.apache.maven.surefire
- surefire-junit-platform
- ${dep.plugin.surefire.version}
-
-
- org.apache.maven.surefire
- surefire-testng
- ${dep.plugin.surefire.version}
-
-
-
-
org.apache.maven.plugins
maven-dependency-plugin
diff --git a/plugin/trino-base-jdbc/pom.xml b/plugin/trino-base-jdbc/pom.xml
index 724676bc88c9..6210dac719e1 100644
--- a/plugin/trino-base-jdbc/pom.xml
+++ b/plugin/trino-base-jdbc/pom.xml
@@ -285,24 +285,6 @@
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
-
-
- org.apache.maven.surefire
- surefire-junit-platform
- ${dep.plugin.surefire.version}
-
-
- org.apache.maven.surefire
- surefire-testng
- ${dep.plugin.surefire.version}
-
-
-
-
org.antlr
antlr4-maven-plugin
diff --git a/plugin/trino-bigquery/pom.xml b/plugin/trino-bigquery/pom.xml
index a8f6083349a8..c0495fdf8d51 100644
--- a/plugin/trino-bigquery/pom.xml
+++ b/plugin/trino-bigquery/pom.xml
@@ -489,23 +489,6 @@
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
-
-
- org.apache.maven.surefire
- surefire-junit-platform
- ${dep.plugin.surefire.version}
-
-
- org.apache.maven.surefire
- surefire-testng
- ${dep.plugin.surefire.version}
-
-
-
org.basepom.maven
duplicate-finder-maven-plugin
diff --git a/plugin/trino-cassandra/pom.xml b/plugin/trino-cassandra/pom.xml
index 22c7d426e5f3..e125d36ecf2b 100644
--- a/plugin/trino-cassandra/pom.xml
+++ b/plugin/trino-cassandra/pom.xml
@@ -255,23 +255,6 @@
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
-
-
- org.apache.maven.surefire
- surefire-junit-platform
- ${dep.plugin.surefire.version}
-
-
- org.apache.maven.surefire
- surefire-testng
- ${dep.plugin.surefire.version}
-
-
-
org.basepom.maven
duplicate-finder-maven-plugin
diff --git a/plugin/trino-clickhouse/pom.xml b/plugin/trino-clickhouse/pom.xml
index 562f2bfb0cdd..d2b332a954fc 100644
--- a/plugin/trino-clickhouse/pom.xml
+++ b/plugin/trino-clickhouse/pom.xml
@@ -206,26 +206,4 @@
test
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
-
-
- org.apache.maven.surefire
- surefire-junit-platform
- ${dep.plugin.surefire.version}
-
-
- org.apache.maven.surefire
- surefire-testng
- ${dep.plugin.surefire.version}
-
-
-
-
-
diff --git a/plugin/trino-clickhouse/src/test/java/io/trino/plugin/clickhouse/TestClickHouseConnectorTest.java b/plugin/trino-clickhouse/src/test/java/io/trino/plugin/clickhouse/TestClickHouseConnectorTest.java
index 3a9f9b6ac94a..56f3ddde2ecf 100644
--- a/plugin/trino-clickhouse/src/test/java/io/trino/plugin/clickhouse/TestClickHouseConnectorTest.java
+++ b/plugin/trino-clickhouse/src/test/java/io/trino/plugin/clickhouse/TestClickHouseConnectorTest.java
@@ -50,10 +50,6 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.jupiter.api.Assumptions.abort;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.assertTrue;
public class TestClickHouseConnectorTest
extends BaseJdbcConnectorTest
@@ -135,7 +131,7 @@ public void testAddColumnWithCommentSpecialCharacter(String comment)
// Override because default storage engine doesn't support renaming columns
try (TestTable table = new TestTable(getQueryRunner()::execute, "test_add_column_", "(a_varchar varchar NOT NULL) WITH (engine = 'mergetree', order_by = ARRAY['a_varchar'])")) {
assertUpdate("ALTER TABLE " + table.getName() + " ADD COLUMN b_varchar varchar COMMENT " + varcharLiteral(comment));
- assertEquals(getColumnComment(table.getName(), "b_varchar"), comment);
+ assertThat(getColumnComment(table.getName(), "b_varchar")).isEqualTo(comment);
}
}
@@ -195,10 +191,10 @@ public void testDropColumn()
assertUpdate("DROP TABLE " + tableName);
- assertFalse(getQueryRunner().tableExists(getSession(), tableName));
+ assertThat(getQueryRunner().tableExists(getSession(), tableName)).isFalse();
assertUpdate("ALTER TABLE IF EXISTS " + tableName + " DROP COLUMN notExistColumn");
assertUpdate("ALTER TABLE IF EXISTS " + tableName + " DROP COLUMN IF EXISTS notExistColumn");
- assertFalse(getQueryRunner().tableExists(getSession(), tableName));
+ assertThat(getQueryRunner().tableExists(getSession(), tableName)).isFalse();
}
@Override
@@ -221,7 +217,7 @@ public void testAddNotNullColumnToEmptyTable()
String tableName = table.getName();
assertUpdate("ALTER TABLE " + tableName + " ADD COLUMN b_varchar varchar NOT NULL");
- assertFalse(columnIsNullable(tableName, "b_varchar"));
+ assertThat(columnIsNullable(tableName, "b_varchar")).isFalse();
assertUpdate("INSERT INTO " + tableName + " VALUES ('a', 'b')", 1);
assertThat(query("TABLE " + tableName))
.skippingTypesCheck()
@@ -237,13 +233,13 @@ public void testAddNotNullColumn()
String tableName = table.getName();
assertUpdate("ALTER TABLE " + tableName + " ADD COLUMN b_varchar varchar NOT NULL");
- assertFalse(columnIsNullable(tableName, "b_varchar"));
+ assertThat(columnIsNullable(tableName, "b_varchar")).isFalse();
assertUpdate("INSERT INTO " + tableName + " VALUES ('a', 'b')", 1);
// ClickHouse set an empty character as the default value
assertUpdate("ALTER TABLE " + tableName + " ADD COLUMN c_varchar varchar NOT NULL");
- assertFalse(columnIsNullable(tableName, "c_varchar"));
+ assertThat(columnIsNullable(tableName, "c_varchar")).isFalse();
assertQuery("SELECT c_varchar FROM " + tableName, "VALUES ''");
}
}
@@ -260,7 +256,7 @@ public void testAddColumnWithComment()
assertThat(getColumnComment(tableName, "b_varchar")).isEqualTo("test new column comment");
assertUpdate("ALTER TABLE " + tableName + " ADD COLUMN empty_comment varchar COMMENT ''");
- assertNull(getColumnComment(tableName, "empty_comment"));
+ assertThat(getColumnComment(tableName, "empty_comment")).isNull();
}
}
@@ -349,10 +345,10 @@ public void testDifferentEngine()
String tableName = "test_add_column_" + randomNameSuffix();
// MergeTree
assertUpdate("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR) WITH (engine = 'MergeTree', order_by = ARRAY['id'])");
- assertTrue(getQueryRunner().tableExists(getSession(), tableName));
+ assertThat(getQueryRunner().tableExists(getSession(), tableName)).isTrue();
assertUpdate("DROP TABLE " + tableName);
assertUpdate("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR) WITH (engine = 'mergetree', order_by = ARRAY['id'])");
- assertTrue(getQueryRunner().tableExists(getSession(), tableName));
+ assertThat(getQueryRunner().tableExists(getSession(), tableName)).isTrue();
assertUpdate("DROP TABLE " + tableName);
// MergeTree without order by
assertQueryFails("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR) WITH (engine = 'MergeTree')", "The property of order_by is required for table engine MergeTree\\(\\)");
@@ -360,7 +356,7 @@ public void testDifferentEngine()
// MergeTree with optional
assertUpdate("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR, logdate DATE NOT NULL) WITH " +
"(engine = 'MergeTree', order_by = ARRAY['id'], partition_by = ARRAY['logdate'])");
- assertTrue(getQueryRunner().tableExists(getSession(), tableName));
+ assertThat(getQueryRunner().tableExists(getSession(), tableName)).isTrue();
assertUpdate("DROP TABLE " + tableName);
//Log families
@@ -382,7 +378,7 @@ public void testTableProperty()
String tableName = "test_add_column_" + randomNameSuffix();
// no table property, it should create a table with default Log engine table
assertUpdate("CREATE TABLE " + tableName + " (id int NOT NULL, x VARCHAR)");
- assertTrue(getQueryRunner().tableExists(getSession(), tableName));
+ assertThat(getQueryRunner().tableExists(getSession(), tableName)).isTrue();
assertUpdate("DROP TABLE " + tableName);
// one required property
@@ -713,7 +709,7 @@ public void testCreateTableWithLongTableName()
String validTableName = baseTableName + "z".repeat(maxTableNameLength().orElseThrow() - baseTableName.length());
assertUpdate("CREATE TABLE " + validTableName + " (a bigint)");
- assertTrue(getQueryRunner().tableExists(getSession(), validTableName));
+ assertThat(getQueryRunner().tableExists(getSession(), validTableName)).isTrue();
assertThatThrownBy(() -> assertUpdate("DROP TABLE " + validTableName))
.hasMessageMatching("(?s).*(Bad path syntax|File name too long).*");
@@ -721,7 +717,7 @@ public void testCreateTableWithLongTableName()
assertThatThrownBy(() -> query("CREATE TABLE " + invalidTableName + " (a bigint)"))
.hasMessageMatching("(?s).*(Cannot open file|File name too long).*");
// ClickHouse lefts a table even if the above statement failed
- assertTrue(getQueryRunner().tableExists(getSession(), validTableName));
+ assertThat(getQueryRunner().tableExists(getSession(), validTableName)).isTrue();
}
@Test
@@ -775,7 +771,7 @@ public void testRenameTableToLongTableName()
String validTargetTableName = baseTableName + "z".repeat(255 - ".sql".length() - baseTableName.length());
assertUpdate("ALTER TABLE " + sourceTableName + " RENAME TO " + validTargetTableName);
- assertTrue(getQueryRunner().tableExists(getSession(), validTargetTableName));
+ assertThat(getQueryRunner().tableExists(getSession(), validTargetTableName)).isTrue();
assertQuery("SELECT x FROM " + validTargetTableName, "VALUES 123");
assertThatThrownBy(() -> assertUpdate("DROP TABLE " + validTargetTableName))
.hasMessageMatching("(?s).*(Bad path syntax|File name too long).*");
@@ -784,7 +780,7 @@ public void testRenameTableToLongTableName()
String invalidTargetTableName = validTargetTableName + "z";
assertThatThrownBy(() -> assertUpdate("ALTER TABLE " + sourceTableName + " RENAME TO " + invalidTargetTableName))
.hasMessageMatching("(?s).*(Cannot rename|File name too long).*");
- assertFalse(getQueryRunner().tableExists(getSession(), invalidTargetTableName));
+ assertThat(getQueryRunner().tableExists(getSession(), invalidTargetTableName)).isFalse();
}
@Test
diff --git a/plugin/trino-delta-lake/pom.xml b/plugin/trino-delta-lake/pom.xml
index 932f6a96b39e..3e6d398acbdb 100644
--- a/plugin/trino-delta-lake/pom.xml
+++ b/plugin/trino-delta-lake/pom.xml
@@ -15,15 +15,6 @@
${project.parent.basedir}
-
-
- instances
@@ -449,33 +440,10 @@
testcontainers
test
-
-
- org.testng
- testng
- test
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
-
-
- org.apache.maven.surefire
- surefire-junit-platform
- ${dep.plugin.surefire.version}
-
-
- org.apache.maven.surefire
- surefire-testng
- ${dep.plugin.surefire.version}
-
-
-
org.apache.maven.plugins
maven-dependency-plugin
diff --git a/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/BaseDeltaLakeConnectorSmokeTest.java b/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/BaseDeltaLakeConnectorSmokeTest.java
index ff7601c9b5a5..07a0eb065be3 100644
--- a/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/BaseDeltaLakeConnectorSmokeTest.java
+++ b/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/BaseDeltaLakeConnectorSmokeTest.java
@@ -43,7 +43,6 @@
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
-import org.testng.SkipException;
import java.util.List;
import java.util.Map;
@@ -84,10 +83,8 @@
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.junit.jupiter.api.Assumptions.abort;
import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertTrue;
@TestInstance(PER_CLASS)
public abstract class BaseDeltaLakeConnectorSmokeTest
@@ -457,9 +454,9 @@ public void testInputDataSize()
getLocationForTable(bucketName, "foo")));
MaterializedResultWithQueryId deltaResult = queryRunner.executeWithQueryId(broadcastJoinDistribution(true), "SELECT * FROM foo");
- assertEquals(deltaResult.getResult().getRowCount(), 2);
+ assertThat(deltaResult.getResult().getRowCount()).isEqualTo(2);
MaterializedResultWithQueryId hiveResult = queryRunner.executeWithQueryId(broadcastJoinDistribution(true), format("SELECT * FROM %s.%s.%s", "hive", SCHEMA, hiveTableName));
- assertEquals(hiveResult.getResult().getRowCount(), 2);
+ assertThat(hiveResult.getResult().getRowCount()).isEqualTo(2);
QueryManager queryManager = queryRunner.getCoordinator().getQueryManager();
assertThat(queryManager.getFullQueryInfo(deltaResult.getQueryId()).getQueryStats().getProcessedInputDataSize()).as("delta processed input data size")
@@ -485,7 +482,7 @@ public void testHiveViewsCannotBeAccessed()
String viewName = "dummy_view";
hiveHadoop.runOnHive("CREATE DATABASE " + schemaName);
hiveHadoop.runOnHive(format("CREATE VIEW %s.%s AS SELECT * FROM %s.customer", schemaName, viewName, SCHEMA));
- assertEquals(computeScalar(format("SHOW TABLES FROM %s LIKE '%s'", schemaName, viewName)), viewName);
+ assertThat(computeScalar(format("SHOW TABLES FROM %s LIKE '%s'", schemaName, viewName))).isEqualTo(viewName);
assertThatThrownBy(() -> computeActual("DESCRIBE " + schemaName + "." + viewName)).hasMessageContaining(format("%s.%s is not a Delta Lake table", schemaName, viewName));
hiveHadoop.runOnHive("DROP DATABASE " + schemaName + " CASCADE");
}
@@ -497,7 +494,7 @@ public void testNonDeltaTablesCannotBeAccessed()
String tableName = "hive_table";
hiveHadoop.runOnHive("CREATE DATABASE " + schemaName);
hiveHadoop.runOnHive(format("CREATE TABLE %s.%s (id BIGINT)", schemaName, tableName));
- assertEquals(computeScalar(format("SHOW TABLES FROM %s LIKE '%s'", schemaName, tableName)), tableName);
+ assertThat(computeScalar(format("SHOW TABLES FROM %s LIKE '%s'", schemaName, tableName))).isEqualTo(tableName);
assertThatThrownBy(() -> computeActual("DESCRIBE " + schemaName + "." + tableName)).hasMessageContaining(tableName + " is not a Delta Lake table");
hiveHadoop.runOnHive("DROP DATABASE " + schemaName + " CASCADE");
}
@@ -521,9 +518,9 @@ public void testDropOssDataLakeTable()
private void testDropTable(String tableName, String resourcePath)
{
registerTableFromResources(tableName, resourcePath, getQueryRunner());
- assertTrue(getQueryRunner().tableExists(getSession(), tableName));
+ assertThat(getQueryRunner().tableExists(getSession(), tableName)).isTrue();
assertUpdate("DROP TABLE " + tableName);
- assertFalse(getQueryRunner().tableExists(getSession(), tableName));
+ assertThat(getQueryRunner().tableExists(getSession(), tableName)).isFalse();
assertThat(getTableFiles(tableName)).hasSizeGreaterThan(1); // the data should not be deleted
}
@@ -856,7 +853,7 @@ public void testExternalTableFilesRetainedOnDrop()
"SELECT count(*) FROM nation");
int fileCount = getTableFiles(tableName).size();
assertUpdate(format("DROP TABLE %s.%s", schemaName, tableName));
- assertEquals(getTableFiles(tableName).size(), fileCount);
+ assertThat(getTableFiles(tableName).size()).isEqualTo(fileCount);
}
@Test
@@ -1919,7 +1916,7 @@ private void invalidateMetadataCache(String tableName)
private void testCountQuery(@Language("SQL") String sql, long expectedRowCount, long expectedSplitCount)
{
MaterializedResultWithQueryId result = getDistributedQueryRunner().executeWithQueryId(getSession(), sql);
- assertEquals(result.getResult().getOnlyColumnAsSet(), ImmutableSet.of(expectedRowCount));
+ assertThat(result.getResult().getOnlyColumnAsSet()).isEqualTo(ImmutableSet.of(expectedRowCount));
verifySplitCount(result.getQueryId(), expectedSplitCount);
}
@@ -1945,7 +1942,7 @@ private OperatorStats getOperatorStats(QueryId queryId)
public void testDelete()
{
if (!hasBehavior(SUPPORTS_DELETE)) {
- throw new SkipException("testDelete requires DELETE support");
+ abort("testDelete requires DELETE support");
}
String tableName = "test_delete_" + randomNameSuffix();
diff --git a/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/BaseDeltaLakeRegisterTableProcedureTest.java b/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/BaseDeltaLakeRegisterTableProcedureTest.java
index 94cbf68ea9cd..8de5cbe0da43 100644
--- a/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/BaseDeltaLakeRegisterTableProcedureTest.java
+++ b/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/BaseDeltaLakeRegisterTableProcedureTest.java
@@ -46,7 +46,6 @@
import static java.lang.String.format;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS;
-import static org.testng.Assert.assertFalse;
@TestInstance(PER_CLASS)
public abstract class BaseDeltaLakeRegisterTableProcedureTest
@@ -110,7 +109,7 @@ public void testRegisterTable()
// Drop table from metastore and use the table content to register a table
metastore.dropTable(SCHEMA, tableName, false);
// Verify that dropTableFromMetastore actually works
- assertFalse(getQueryRunner().tableExists(getSession(), tableName));
+ assertThat(getQueryRunner().tableExists(getSession(), tableName)).isFalse();
assertQuerySucceeds(format("CALL system.register_table('%s', '%s', '%s')", SCHEMA, tableName, tableLocation));
String showCreateTableNew = (String) computeScalar("SHOW CREATE TABLE " + tableName);
diff --git a/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/BaseDeltaLakeSharedMetastoreWithTableRedirectionsTest.java b/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/BaseDeltaLakeSharedMetastoreWithTableRedirectionsTest.java
index 69545aa2a536..1bc9f0cddcc5 100644
--- a/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/BaseDeltaLakeSharedMetastoreWithTableRedirectionsTest.java
+++ b/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/BaseDeltaLakeSharedMetastoreWithTableRedirectionsTest.java
@@ -20,7 +20,6 @@
import static io.trino.testing.TestingNames.randomNameSuffix;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS;
-import static org.testng.Assert.assertEquals;
@TestInstance(PER_CLASS)
public abstract class BaseDeltaLakeSharedMetastoreWithTableRedirectionsTest
@@ -85,13 +84,9 @@ public void testShowSchemas()
.containsAll("VALUES '" + schema + "'");
String showCreateHiveWithRedirectionsSchema = (String) computeActual("SHOW CREATE SCHEMA hive_with_redirections." + schema).getOnlyValue();
- assertEquals(
- showCreateHiveWithRedirectionsSchema,
- getExpectedHiveCreateSchema("hive_with_redirections"));
+ assertThat(showCreateHiveWithRedirectionsSchema).isEqualTo(getExpectedHiveCreateSchema("hive_with_redirections"));
String showCreateDeltaLakeWithRedirectionsSchema = (String) computeActual("SHOW CREATE SCHEMA delta_with_redirections." + schema).getOnlyValue();
- assertEquals(
- showCreateDeltaLakeWithRedirectionsSchema,
- getExpectedDeltaLakeCreateSchema("delta_with_redirections"));
+ assertThat(showCreateDeltaLakeWithRedirectionsSchema).isEqualTo(getExpectedDeltaLakeCreateSchema("delta_with_redirections"));
}
@Test
diff --git a/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/BaseDeltaLakeTableWithCustomLocation.java b/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/BaseDeltaLakeTableWithCustomLocation.java
index 025decd4a7bd..8c5f0130ad56 100644
--- a/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/BaseDeltaLakeTableWithCustomLocation.java
+++ b/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/BaseDeltaLakeTableWithCustomLocation.java
@@ -31,9 +31,6 @@
import static io.trino.testing.TestingNames.randomNameSuffix;
import static java.lang.String.format;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertTrue;
public abstract class BaseDeltaLakeTableWithCustomLocation
extends AbstractTestQueryFramework
@@ -49,7 +46,9 @@ public void testTableHasUuidSuffixInLocation()
String tableName = "table_with_uuid" + randomNameSuffix();
assertQuerySucceeds(format("CREATE TABLE %s AS SELECT 1 as val", tableName));
Optional table = metastore.getTable(SCHEMA, tableName);
- assertTrue(table.isPresent(), "Table should exists");
+ assertThat(table.isPresent())
+ .describedAs("Table should exists")
+ .isTrue();
String location = table.get().getStorage().getLocation();
assertThat(location).matches(format(".*%s-[0-9a-f]{32}", tableName));
}
@@ -65,14 +64,24 @@ public void testCreateAndDrop()
Location tableLocation = Location.of(table.getStorage().getLocation());
TrinoFileSystem fileSystem = HDFS_FILE_SYSTEM_FACTORY.create(getSession().toConnectorSession());
- assertTrue(fileSystem.listFiles(tableLocation).hasNext(), "The directory corresponding to the table storage location should exist");
+ assertThat(fileSystem.listFiles(tableLocation).hasNext())
+ .describedAs("The directory corresponding to the table storage location should exist")
+ .isTrue();
List materializedRows = computeActual("SELECT \"$path\" FROM " + tableName).getMaterializedRows();
- assertEquals(materializedRows.size(), 1);
+ assertThat(materializedRows.size()).isEqualTo(1);
Location filePath = Location.of((String) materializedRows.get(0).getField(0));
- assertTrue(fileSystem.listFiles(filePath).hasNext(), "The data file should exist");
+ assertThat(fileSystem.listFiles(filePath).hasNext())
+ .describedAs("The data file should exist")
+ .isTrue();
assertQuerySucceeds(format("DROP TABLE %s", tableName));
- assertFalse(metastore.getTable(SCHEMA, tableName).isPresent(), "Table should be dropped");
- assertFalse(fileSystem.listFiles(filePath).hasNext(), "The data file should have been removed");
- assertFalse(fileSystem.listFiles(tableLocation).hasNext(), "The directory corresponding to the dropped Delta Lake table should be removed");
+ assertThat(metastore.getTable(SCHEMA, tableName).isPresent())
+ .describedAs("Table should be dropped")
+ .isFalse();
+ assertThat(fileSystem.listFiles(filePath).hasNext())
+ .describedAs("The data file should have been removed")
+ .isFalse();
+ assertThat(fileSystem.listFiles(tableLocation).hasNext())
+ .describedAs("The directory corresponding to the dropped Delta Lake table should be removed")
+ .isFalse();
}
}
diff --git a/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/DeltaLakeQueryRunner.java b/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/DeltaLakeQueryRunner.java
index bcc59f61ac1f..552b30658d62 100644
--- a/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/DeltaLakeQueryRunner.java
+++ b/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/DeltaLakeQueryRunner.java
@@ -44,7 +44,7 @@
import static io.trino.testing.containers.Minio.MINIO_SECRET_KEY;
import static java.lang.String.format;
import static java.util.Objects.requireNonNull;
-import static org.testng.util.Strings.isNullOrEmpty;
+import static org.assertj.core.util.Strings.isNullOrEmpty;
public final class DeltaLakeQueryRunner
{
diff --git a/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeBasic.java b/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeBasic.java
index 6ce5295fd046..283721d845b4 100644
--- a/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeBasic.java
+++ b/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeBasic.java
@@ -82,7 +82,6 @@
import static org.assertj.core.api.Assertions.entry;
import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS;
import static org.junit.jupiter.api.parallel.ExecutionMode.SAME_THREAD;
-import static org.testng.Assert.assertFalse;
@TestInstance(PER_CLASS)
@Execution(SAME_THREAD)
@@ -980,7 +979,7 @@ private void testCorruptedTableLocation(String tableName, Path tableLocation, bo
// DROP TABLE should succeed so that users can remove their corrupted table
getQueryRunner().execute("DROP TABLE " + tableName);
- assertFalse(getQueryRunner().tableExists(getSession(), tableName));
+ assertThat(getQueryRunner().tableExists(getSession(), tableName)).isFalse();
if (isManaged) {
assertThat(tableLocation.toFile()).doesNotExist().as("Table location should not exist");
}
diff --git a/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeConnectorTest.java b/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeConnectorTest.java
index c11a54b0fec6..5a18909846b4 100644
--- a/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeConnectorTest.java
+++ b/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeConnectorTest.java
@@ -79,9 +79,6 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.jupiter.api.Assumptions.abort;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertTrue;
public class TestDeltaLakeConnectorTest
extends BaseConnectorTest
@@ -476,10 +473,10 @@ private void testDeltaRenameColumnWithComment(ColumnMappingMode mode)
"column_mapping_mode = '" + mode + "')");
assertUpdate("ALTER TABLE " + tableName + " RENAME COLUMN col TO new_col");
- assertEquals(getColumnComment(tableName, "new_col"), "test column comment");
+ assertThat(getColumnComment(tableName, "new_col")).isEqualTo("test column comment");
assertUpdate("ALTER TABLE " + tableName + " RENAME COLUMN part TO new_part");
- assertEquals(getColumnComment(tableName, "new_part"), "test partition comment");
+ assertThat(getColumnComment(tableName, "new_part")).isEqualTo("test partition comment");
assertUpdate("DROP TABLE " + tableName);
}
@@ -538,12 +535,12 @@ private void testTimestampPredicatePushdown(String value)
MaterializedResultWithQueryId queryResult = queryRunner.executeWithQueryId(
getSession(),
"SELECT * FROM " + tableName + " WHERE t < TIMESTAMP '" + value + "'");
- assertEquals(getQueryInfo(queryRunner, queryResult).getQueryStats().getProcessedInputDataSize().toBytes(), 0);
+ assertThat(getQueryInfo(queryRunner, queryResult).getQueryStats().getProcessedInputDataSize().toBytes()).isEqualTo(0);
queryResult = queryRunner.executeWithQueryId(
getSession(),
"SELECT * FROM " + tableName + " WHERE t > TIMESTAMP '" + value + "'");
- assertEquals(getQueryInfo(queryRunner, queryResult).getQueryStats().getProcessedInputDataSize().toBytes(), 0);
+ assertThat(getQueryInfo(queryRunner, queryResult).getQueryStats().getProcessedInputDataSize().toBytes()).isEqualTo(0);
assertQueryStats(
getSession(),
@@ -1110,12 +1107,12 @@ public void testUnsupportedCreateTableWithChangeDataFeed()
assertQueryFails(
"CREATE TABLE " + tableName + "(" + columnName + " int) WITH (change_data_feed_enabled = true)",
"\\QUnable to use [%s] when change data feed is enabled\\E".formatted(columnName));
- assertFalse(getQueryRunner().tableExists(getSession(), tableName));
+ assertThat(getQueryRunner().tableExists(getSession(), tableName)).isFalse();
assertQueryFails(
"CREATE TABLE " + tableName + " WITH (change_data_feed_enabled = true) AS SELECT 1 AS " + columnName,
"\\QUnable to use [%s] when change data feed is enabled\\E".formatted(columnName));
- assertFalse(getQueryRunner().tableExists(getSession(), tableName));
+ assertThat(getQueryRunner().tableExists(getSession(), tableName)).isFalse();
}
}
@@ -1826,7 +1823,7 @@ public void testCreateTableUnsupportedColumnMappingMode()
assertQueryFails("CREATE TABLE " + tableName + " WITH (column_mapping_mode = 'unknown') AS SELECT 1 a",
".* \\QInvalid value [unknown]. Valid values: [ID, NAME, NONE]");
- assertFalse(getQueryRunner().tableExists(getSession(), tableName));
+ assertThat(getQueryRunner().tableExists(getSession(), tableName)).isFalse();
}
@Test
@@ -2661,13 +2658,17 @@ private void testDeleteWithFilter(String createTableSql, String deleteFilter, bo
plan -> {
if (pushDownDelete) {
boolean tableDelete = searchFrom(plan.getRoot()).where(node -> node instanceof TableDeleteNode).matches();
- assertTrue(tableDelete, "A TableDeleteNode should be present");
+ assertThat(tableDelete)
+ .describedAs("A TableDeleteNode should be present")
+ .isTrue();
}
else {
TableFinishNode finishNode = searchFrom(plan.getRoot())
.where(TableFinishNode.class::isInstance)
.findOnlyElement();
- assertTrue(finishNode.getTarget() instanceof TableWriterNode.MergeTarget, "Delete operation should be performed through MERGE mechanism");
+ assertThat(finishNode.getTarget() instanceof TableWriterNode.MergeTarget)
+ .describedAs("Delete operation should be performed through MERGE mechanism")
+ .isTrue();
}
});
assertQuery("SELECT customer, purchases, address FROM " + table, "VALUES ('Mary', 10, 'Adelphi'), ('Aaron', 3, 'Dallas')");
diff --git a/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeCreateTableStatistics.java b/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeCreateTableStatistics.java
index d9d705864826..53f7d815609d 100644
--- a/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeCreateTableStatistics.java
+++ b/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeCreateTableStatistics.java
@@ -58,7 +58,6 @@
import static java.lang.Double.POSITIVE_INFINITY;
import static java.lang.String.format;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.testng.Assert.assertEquals;
@Isolated
public class TestDeltaLakeCreateTableStatistics
@@ -101,10 +100,10 @@ public void testComplexDataTypes()
DeltaLakeFileStatistics fileStatistics = entry.getStats().get();
DeltaLakeColumnHandle columnHandle = new DeltaLakeColumnHandle("d", createUnboundedVarcharType(), OptionalInt.empty(), "d", createUnboundedVarcharType(), REGULAR, Optional.empty());
- assertEquals(fileStatistics.getNumRecords(), Optional.of(2L));
- assertEquals(fileStatistics.getMinColumnValue(columnHandle), Optional.of(utf8Slice("foo")));
- assertEquals(fileStatistics.getMaxColumnValue(columnHandle), Optional.of(utf8Slice("moo")));
- assertEquals(fileStatistics.getNullCount("d"), Optional.of(0L));
+ assertThat(fileStatistics.getNumRecords()).isEqualTo(Optional.of(2L));
+ assertThat(fileStatistics.getMinColumnValue(columnHandle)).isEqualTo(Optional.of(utf8Slice("foo")));
+ assertThat(fileStatistics.getMaxColumnValue(columnHandle)).isEqualTo(Optional.of(utf8Slice("moo")));
+ assertThat(fileStatistics.getNullCount("d")).isEqualTo(Optional.of(0L));
for (String complexColumn : ImmutableList.of("a", "b", "c")) {
columnHandle = new DeltaLakeColumnHandle(complexColumn, createUnboundedVarcharType(), OptionalInt.empty(), complexColumn, createUnboundedVarcharType(), REGULAR, Optional.empty());
@@ -128,10 +127,10 @@ public void testDoubleTypesNaN()
assertThat(entry.getStats()).isPresent();
DeltaLakeFileStatistics fileStatistics = entry.getStats().get();
- assertEquals(fileStatistics.getNumRecords(), Optional.of(2L));
- assertEquals(fileStatistics.getMinColumnValue(columnHandle), Optional.empty());
- assertEquals(fileStatistics.getMaxColumnValue(columnHandle), Optional.empty());
- assertEquals(fileStatistics.getNullCount(columnName), Optional.empty());
+ assertThat(fileStatistics.getNumRecords()).isEqualTo(Optional.of(2L));
+ assertThat(fileStatistics.getMinColumnValue(columnHandle)).isEqualTo(Optional.empty());
+ assertThat(fileStatistics.getMaxColumnValue(columnHandle)).isEqualTo(Optional.empty());
+ assertThat(fileStatistics.getNullCount(columnName)).isEqualTo(Optional.empty());
}
}
}
@@ -152,10 +151,10 @@ public void testDoubleTypesInf()
assertThat(entry.getStats()).isPresent();
DeltaLakeFileStatistics fileStatistics = entry.getStats().get();
- assertEquals(fileStatistics.getNumRecords(), Optional.of(3L));
- assertEquals(fileStatistics.getMinColumnValue(columnHandle), Optional.of(NEGATIVE_INFINITY));
- assertEquals(fileStatistics.getMaxColumnValue(columnHandle), Optional.of(POSITIVE_INFINITY));
- assertEquals(fileStatistics.getNullCount(columnName), Optional.of(0L));
+ assertThat(fileStatistics.getNumRecords()).isEqualTo(Optional.of(3L));
+ assertThat(fileStatistics.getMinColumnValue(columnHandle)).isEqualTo(Optional.of(NEGATIVE_INFINITY));
+ assertThat(fileStatistics.getMaxColumnValue(columnHandle)).isEqualTo(Optional.of(POSITIVE_INFINITY));
+ assertThat(fileStatistics.getNullCount(columnName)).isEqualTo(Optional.of(0L));
}
}
}
@@ -176,10 +175,10 @@ public void testDoubleTypesInfAndNaN()
assertThat(entry.getStats()).isPresent();
DeltaLakeFileStatistics fileStatistics = entry.getStats().get();
- assertEquals(fileStatistics.getNumRecords(), Optional.of(4L));
- assertEquals(fileStatistics.getMinColumnValue(columnHandle), Optional.empty());
- assertEquals(fileStatistics.getMaxColumnValue(columnHandle), Optional.empty());
- assertEquals(fileStatistics.getNullCount(columnName), Optional.empty());
+ assertThat(fileStatistics.getNumRecords()).isEqualTo(Optional.of(4L));
+ assertThat(fileStatistics.getMinColumnValue(columnHandle)).isEqualTo(Optional.empty());
+ assertThat(fileStatistics.getMaxColumnValue(columnHandle)).isEqualTo(Optional.empty());
+ assertThat(fileStatistics.getNullCount(columnName)).isEqualTo(Optional.empty());
}
}
}
@@ -200,10 +199,10 @@ public void testDoubleTypesNaNPositive()
assertThat(entry.getStats()).isPresent();
DeltaLakeFileStatistics fileStatistics = entry.getStats().get();
- assertEquals(fileStatistics.getNumRecords(), Optional.of(4L));
- assertEquals(fileStatistics.getMinColumnValue(columnHandle), Optional.empty());
- assertEquals(fileStatistics.getMaxColumnValue(columnHandle), Optional.empty());
- assertEquals(fileStatistics.getNullCount(columnName), Optional.empty());
+ assertThat(fileStatistics.getNumRecords()).isEqualTo(Optional.of(4L));
+ assertThat(fileStatistics.getMinColumnValue(columnHandle)).isEqualTo(Optional.empty());
+ assertThat(fileStatistics.getMaxColumnValue(columnHandle)).isEqualTo(Optional.empty());
+ assertThat(fileStatistics.getNullCount(columnName)).isEqualTo(Optional.empty());
}
}
}
@@ -224,10 +223,10 @@ public void testDoubleTypesNaNNegative()
assertThat(entry.getStats()).isPresent();
DeltaLakeFileStatistics fileStatistics = entry.getStats().get();
- assertEquals(fileStatistics.getNumRecords(), Optional.of(4L));
- assertEquals(fileStatistics.getMinColumnValue(columnHandle), Optional.empty());
- assertEquals(fileStatistics.getMaxColumnValue(columnHandle), Optional.empty());
- assertEquals(fileStatistics.getNullCount(columnName), Optional.empty());
+ assertThat(fileStatistics.getNumRecords()).isEqualTo(Optional.of(4L));
+ assertThat(fileStatistics.getMinColumnValue(columnHandle)).isEqualTo(Optional.empty());
+ assertThat(fileStatistics.getMaxColumnValue(columnHandle)).isEqualTo(Optional.empty());
+ assertThat(fileStatistics.getNullCount(columnName)).isEqualTo(Optional.empty());
}
}
}
@@ -271,7 +270,7 @@ private void testDecimal(int precision, int scale)
assertThat(entry.getStats()).isPresent();
DeltaLakeFileStatistics fileStatistics = entry.getStats().get();
- assertEquals(fileStatistics.getNumRecords(), Optional.of(3L));
+ assertThat(fileStatistics.getNumRecords()).isEqualTo(Optional.of(3L));
Optional