This is an automated email from the ASF dual-hosted git repository. mthakur pushed a commit to branch branch-3.4 in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/branch-3.4 by this push: new 1ec46fc6925b HADOOP-19150: [ABFS] Fixing Test Code for ITestAbfsRestOperationException#testAuthFailException (#6756) 1ec46fc6925b is described below commit 1ec46fc6925bf4d34154d839a7919bb16a6a01eb Author: Anuj Modi <128447756+anujmodi2...@users.noreply.github.com> AuthorDate: Mon Apr 29 22:18:34 2024 +0530 HADOOP-19150: [ABFS] Fixing Test Code for ITestAbfsRestOperationException#testAuthFailException (#6756) Contributed by: Anuj Modi --- .../azurebfs/ITestAbfsRestOperationException.java | 31 ++++++++++------------ 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAbfsRestOperationException.java b/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAbfsRestOperationException.java index 2672b676f9b3..ca2ab9dabcf4 100644 --- a/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAbfsRestOperationException.java +++ b/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAbfsRestOperationException.java @@ -187,21 +187,18 @@ public class ITestAbfsRestOperationException extends AbstractAbfsIntegrationTest config.set(AZURE_CREATE_REMOTE_FILESYSTEM_DURING_INITIALIZATION, "false"); final AzureBlobFileSystem fs = getFileSystem(config); - try { - intercept(Exception.class, - () -> { - fs.getFileStatus(new Path("/")); - }); - } catch (AbfsRestOperationException e) { - String errorDesc = "Should throw RestOp exception on AAD failure"; - Assertions.assertThat(e.getStatusCode()) - .describedAs("Incorrect status code. " + errorDesc).isEqualTo(-1); - Assertions.assertThat(e.getErrorCode()) - .describedAs("Incorrect error code. " + errorDesc) - .isEqualTo(AzureServiceErrorCode.UNKNOWN); - Assertions.assertThat(e.getErrorMessage()) - .describedAs("Incorrect error message. " + errorDesc) - .contains("Auth failure: "); - } + AbfsRestOperationException e = intercept(AbfsRestOperationException.class, () -> { + fs.getFileStatus(new Path("/")); + }); + + String errorDesc = "Should throw RestOp exception on AAD failure"; + Assertions.assertThat(e.getStatusCode()) + .describedAs("Incorrect status code: " + errorDesc).isEqualTo(-1); + Assertions.assertThat(e.getErrorCode()) + .describedAs("Incorrect error code: " + errorDesc) + .isEqualTo(AzureServiceErrorCode.UNKNOWN); + Assertions.assertThat(e.getErrorMessage()) + .describedAs("Incorrect error message: " + errorDesc) + .contains("Auth failure: "); } -} \ No newline at end of file +} --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org