18
18
package org .apache .hadoop .fs .viewfs ;
19
19
20
20
21
- import static org .junit .Assert .assertEquals ;
22
- import static org .junit .Assert .assertTrue ;
23
- import static org .junit .Assert .fail ;
24
-
25
21
import java .io .IOException ;
26
22
import java .net .URI ;
27
23
32
28
import org .apache .hadoop .fs .FileSystem ;
33
29
import org .apache .hadoop .fs .Path ;
34
30
import static org .apache .hadoop .fs .FileSystem .TRASH_PREFIX ;
31
+ import static org .junit .jupiter .api .Assertions .assertEquals ;
32
+ import static org .junit .jupiter .api .Assertions .assertTrue ;
33
+ import static org .junit .jupiter .api .Assertions .fail ;
34
+
35
35
import org .apache .hadoop .security .UserGroupInformation ;
36
36
37
- import org .junit .After ;
38
- import org .junit .Before ;
39
- import org .junit .Test ;
37
+ import org .junit .jupiter .api .AfterEach ;
38
+ import org .junit .jupiter .api .BeforeEach ;
39
+ import org .junit .jupiter .api .Test ;
40
+
41
+
40
42
import org .slf4j .Logger ;
41
43
import org .slf4j .LoggerFactory ;
42
44
@@ -54,7 +56,7 @@ public class TestViewFileSystemLocalFileSystem extends ViewFileSystemBaseTest {
54
56
LoggerFactory .getLogger (TestViewFileSystemLocalFileSystem .class );
55
57
56
58
@ Override
57
- @ Before
59
+ @ BeforeEach
58
60
public void setUp () throws Exception {
59
61
// create the test root on local_fs
60
62
fsTarget = FileSystem .getLocal (new Configuration ());
@@ -96,10 +98,10 @@ public void testNflyWriteSimple() throws IOException {
96
98
FileSystem lfs = FileSystem .getLocal (testConf );
97
99
for (final URI testUri : testUris ) {
98
100
final Path testFile = new Path (new Path (testUri ), testFileName );
99
- assertTrue (testFile + " should exist!" , lfs . exists ( testFile ) );
101
+ assertTrue (lfs . exists ( testFile ), testFile + " should exist!" );
100
102
final FSDataInputStream fsdis = lfs .open (testFile );
101
103
try {
102
- assertEquals ("Wrong file content" , testString , fsdis . readUTF () );
104
+ assertEquals (fsdis . readUTF (), testString , "Wrong file content" );
103
105
} finally {
104
106
fsdis .close ();
105
107
}
@@ -122,14 +124,14 @@ public void testNflyInvalidMinReplication() throws Exception {
122
124
FileSystem .get (URI .create ("viewfs://mt/" ), conf );
123
125
fail ("Expected bad minReplication exception." );
124
126
} catch (IOException ioe ) {
125
- assertTrue ("No minReplication message" ,
126
- ioe . getMessage (). contains ( "Minimum replication" ) );
127
+ assertTrue (ioe . getMessage (). contains ( "Minimum replication" ) ,
128
+ "No minReplication message" );
127
129
}
128
130
}
129
131
130
132
131
133
@ Override
132
- @ After
134
+ @ AfterEach
133
135
public void tearDown () throws Exception {
134
136
fsTarget .delete (fileSystemTestHelper .getTestRootPath (fsTarget ), true );
135
137
super .tearDown ();
0 commit comments