From a461e309598a23a34b33e1f40c0193dc5583904d Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Thu, 5 Oct 2023 21:59:50 +0100 Subject: [PATCH] HADOOP-18917. Fix issue with broken unit test Co-authored-by: Ayush Saxena --- .../azurebfs/services/TestTextFileBasedIdentityHandler.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/TestTextFileBasedIdentityHandler.java b/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/TestTextFileBasedIdentityHandler.java index f9950faf944df..b0a72b2131cdd 100644 --- a/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/TestTextFileBasedIdentityHandler.java +++ b/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/TestTextFileBasedIdentityHandler.java @@ -19,9 +19,9 @@ package org.apache.hadoop.fs.azurebfs.services; import java.io.File; -import java.io.FileNotFoundException; import java.io.IOException; import java.nio.charset.Charset; +import java.nio.file.NoSuchFileException; import org.junit.Assert; import org.junit.BeforeClass; @@ -114,7 +114,7 @@ public void testLookupForUser() throws IOException { public void testLookupForUserFileNotFound() throws Exception { TextFileBasedIdentityHandler handler = new TextFileBasedIdentityHandler(userMappingFile.getPath() + ".test", groupMappingFile.getPath()); - intercept(FileNotFoundException.class, "FileNotFoundException", + intercept(NoSuchFileException.class, "NoSuchFileException", () -> handler.lookupForLocalUserIdentity(testUserDataLine3.split(":")[0])); } @@ -143,7 +143,7 @@ public void testLookupForGroup() throws IOException { public void testLookupForGroupFileNotFound() throws Exception { TextFileBasedIdentityHandler handler = new TextFileBasedIdentityHandler(userMappingFile.getPath(), groupMappingFile.getPath() + ".test"); - intercept(FileNotFoundException.class, "FileNotFoundException", + intercept(NoSuchFileException.class, "NoSuchFileException", () -> handler.lookupForLocalGroupIdentity(testGroupDataLine2.split(":")[0])); } }