File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -98,14 +98,13 @@ public void testS3xLoginHelperWithDotInBucketName() throws Throwable {
98
98
@ Test
99
99
public void testBucketNameWithDotAndNumber () throws Exception {
100
100
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 );
105
107
}
106
- assertThat (bucket )
107
- .describedAs ("Bucket name should be extracted correctly" )
108
- .isEqualTo ("test-bucket-v1.1" );
109
108
}
110
109
111
110
@ Test
@@ -119,11 +118,11 @@ public void testFileSystemCacheForBucketWithDotAndNumber() throws Exception {
119
118
FileSystem fs2 = FileSystem .get (uri2 , config );
120
119
121
120
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" )
123
122
.isSameAs (fs1b );
124
123
125
124
assertThat (fs1a )
126
- .describedAs ("FileSystem.get should return different instance for different bucket" )
125
+ .describedAs ("The call should return different instance for different bucket" )
127
126
.isNotSameAs (fs2 );
128
127
}
129
128
You can’t perform that action at this time.
0 commit comments