Skip to content

Commit 5014c32

Browse files
committed
Test changes
1 parent b564de2 commit 5014c32

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/TestBucketConfiguration.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,13 @@ public void testS3xLoginHelperWithDotInBucketName() throws Throwable {
9898
@Test
9999
public void testBucketNameWithDotAndNumber() throws Exception {
100100
Configuration config = new Configuration();
101-
URI uri = URI.create("s3a://test-bucket-v1.1");
102-
String bucket = uri.getHost();
103-
if (bucket == null) {
104-
bucket = uri.getAuthority();
101+
org.apache.hadoop.fs.Path path =
102+
new org.apache.hadoop.fs.Path("s3a://test-bucket-v1.1");
103+
try (FileSystem fs = path.getFileSystem(config)) {
104+
assertThat(fs)
105+
.describedAs("FileSystem should be S3AFileSystem instance")
106+
.isInstanceOf(S3AFileSystem.class);
105107
}
106-
assertThat(bucket)
107-
.describedAs("Bucket name should be extracted correctly")
108-
.isEqualTo("test-bucket-v1.1");
109108
}
110109

111110
@Test
@@ -119,11 +118,11 @@ public void testFileSystemCacheForBucketWithDotAndNumber() throws Exception {
119118
FileSystem fs2 = FileSystem.get(uri2, config);
120119

121120
assertThat(fs1a)
122-
.describedAs("FileSystem.get should return same cached instance for same URI")
121+
.describedAs("The call should return same cached instance for same URI")
123122
.isSameAs(fs1b);
124123

125124
assertThat(fs1a)
126-
.describedAs("FileSystem.get should return different instance for different bucket")
125+
.describedAs("The call should return different instance for different bucket")
127126
.isNotSameAs(fs2);
128127
}
129128

0 commit comments

Comments
 (0)