Skip to content

Commit

Permalink
Replace the deprecated method getRootCause with rootCause method
Browse files Browse the repository at this point in the history
  • Loading branch information
krvikash authored and ebyhr committed Mar 17, 2023
1 parent fcd01ca commit 53b3d9f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
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 @@ -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

0 comments on commit 53b3d9f

Please sign in to comment.