Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ public void testQuery()
public void testInvalidQuery()
{
assertThatThrownBy(() -> newFileBasedSystemAccessControl("query-invalid.json"))
.getRootCause().hasMessage("A valid query rule cannot combine an queryOwner condition with access mode 'execute'");
.rootCause().hasMessage("A valid query rule cannot combine an queryOwner condition with access mode 'execute'");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ protected void verifyConcurrentUpdateFailurePermissible(Exception e)
{
assertThat(e)
.hasMessage("Failed to write Delta Lake transaction log entry")
.getCause()
.cause()
.hasMessageMatching(
"Transaction log locked.*" +
"|.*/_delta_log/\\d+.json already exists" +
Expand All @@ -154,7 +154,7 @@ protected void verifyConcurrentInsertFailurePermissible(Exception e)
{
assertThat(e)
.hasMessage("Failed to write Delta Lake transaction log entry")
.getCause()
.cause()
.hasMessageMatching(
"Transaction log locked.*" +
"|.*/_delta_log/\\d+.json already exists" +
Expand All @@ -168,7 +168,7 @@ protected void verifyConcurrentAddColumnFailurePermissible(Exception e)
{
assertThat(e)
.hasMessageMatching("Unable to add '.*' column for: .*")
.getCause()
.cause()
.hasMessageMatching(
"Transaction log locked.*" +
"|.*/_delta_log/\\d+.json already exists" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ public void testUpdateRowConcurrently()
// TODO (https://github.com/trinodb/trino/issues/10518) test this with a TestHiveConnectorTest version that creates ACID tables by default, or in some other way
assertThatThrownBy(super::testUpdateRowConcurrently)
.hasMessage("Unexpected concurrent update failure")
.getCause()
.cause()
.hasMessage(MODIFYING_NON_TRANSACTIONAL_TABLE_MESSAGE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void testS3WrongRegionSelection()
String tableName = "s3_region_test_" + randomNameSuffix();
queryRunner.execute("CREATE TABLE default." + tableName + " (a int) WITH (external_location = 's3://" + bucketName + "/" + tableName + "')");
assertThatThrownBy(() -> queryRunner.execute("SELECT * FROM default." + tableName))
.getRootCause()
.rootCause()
.hasMessageContaining("Status Code: 400")
.hasMessageContaining("Error Code: AuthorizationHeaderMalformed"); // That is how Minio reacts to bad region
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ protected void verifyConcurrentAddColumnFailurePermissible(Exception e)
{
assertThat(e)
.hasMessageStartingWith("Failed to add column: Failed to replace table due to concurrent updates")
.getRootCause()
.rootCause()
.hasMessageContaining("Cannot update Iceberg table: supplied previous location does not match current location");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ public void testDowngradingV2TableToV1Fails()
assertEquals(loadTable(tableName).operations().current().formatVersion(), 2);
assertThatThrownBy(() -> query("ALTER TABLE " + tableName + " SET PROPERTIES format_version = 1"))
.hasMessage("Failed to set new property values")
.getRootCause()
.rootCause()
.hasMessage("Cannot downgrade v2 table to v1");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public void testCreateTableWithCommaPropertyColumn()
String tableWithQuote = "create_table_with_unsupported_quote_column";
String tableDefinitionWithQuote = "(`a\"b` bigint primary key, c varchar)";
assertThatThrownBy(() -> onRemoteDatabase().execute("CREATE TABLE " + tableWithQuote + tableDefinitionWithQuote))
.getRootCause()
.rootCause()
.hasMessageContaining("Failed to parse query");

// Test the property column with comma
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public void testUnsupportedBigint()
private void assertIgniteQueryFailsWithColumnValueOutRange(@Language("SQL") String sql)
{
assertThatThrownBy(() -> igniteServer.execute(sql))
.getCause()
.cause()
.hasMessageContaining("Value conversion failed");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ private DataSetup mysqlCreateAndInsert(String tableNamePrefix)
private void assertMySqlQueryFails(@Language("SQL") String sql, String expectedMessage)
{
assertThatThrownBy(() -> mySqlServer.execute(sql))
.getCause()
.cause()
.hasMessageContaining(expectedMessage);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ private Session sessionWithDecimalMappingStrict(UnsupportedTypeHandling unsuppor
private void assertPhoenixQueryFails(@Language("SQL") String sql, String expectedMessage)
{
assertThatThrownBy(() -> new PhoenixSqlExecutor(phoenixServer.getJdbcUrl()).execute(sql))
.getCause()
.cause()
.hasMessageContaining(expectedMessage);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1917,7 +1917,7 @@ private static void checkIsDoubled(ZoneId zone, LocalDateTime dateTime)
private void assertPostgreSqlQueryFails(@Language("SQL") String sql, String expectedMessage)
{
assertThatThrownBy(() -> postgreSqlServer.execute(sql))
.getCause()
.cause()
.hasMessageContaining(expectedMessage);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ protected void verifyConcurrentAddColumnFailurePermissible(Exception e)
{
assertThat(e)
.hasMessageContaining("Failed to perform metadata operation")
.getCause()
.cause()
.hasMessageMatching(
"(?s).*SQLIntegrityConstraintViolationException.*" +
"|.*Unique index or primary key violation.*" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public void checkUnicodeCharInRedshift()
try (TestTable table = testTable("check_multibyte_char", "(c char(32))")) {
assertThatThrownBy(() -> getRedshiftExecutor()
.execute(format("INSERT INTO %s VALUES ('\u968a')", table.getName())))
.getCause()
.cause()
.isInstanceOf(SQLException.class)
.hasMessageContaining("CHAR string contains invalid ASCII character");
}
Expand Down Expand Up @@ -842,7 +842,7 @@ private static void assertRedshiftCreateFails(String tableNamePrefix, String tab
try {
assertThatThrownBy(() -> getRedshiftExecutor()
.execute(format("CREATE TABLE %s %s", tableName, tableBody)))
.getCause()
.cause()
.as("Redshift create fails for %s %s", tableName, tableBody)
.isInstanceOf(SQLException.class)
.hasMessage(message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ private static void checkIsGap(ZoneId zone, LocalDateTime dateTime)
private void assertSqlServerQueryFails(@Language("SQL") String sql, String expectedMessage)
{
assertThatThrownBy(() -> onRemoteDatabase().execute(sql))
.getCause()
.cause()
.hasMessageContaining(expectedMessage);
}

Expand Down