1818package org .apache .hadoop .fs .viewfs ;
1919
2020
21- import static org .junit .Assert .assertEquals ;
22- import static org .junit .Assert .assertTrue ;
23- import static org .junit .Assert .fail ;
24-
2521import java .io .IOException ;
2622import java .net .URI ;
2723
3228import org .apache .hadoop .fs .FileSystem ;
3329import org .apache .hadoop .fs .Path ;
3430import 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+
3535import org .apache .hadoop .security .UserGroupInformation ;
3636
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+
4042import org .slf4j .Logger ;
4143import org .slf4j .LoggerFactory ;
4244
@@ -54,7 +56,7 @@ public class TestViewFileSystemLocalFileSystem extends ViewFileSystemBaseTest {
5456 LoggerFactory .getLogger (TestViewFileSystemLocalFileSystem .class );
5557
5658 @ Override
57- @ Before
59+ @ BeforeEach
5860 public void setUp () throws Exception {
5961 // create the test root on local_fs
6062 fsTarget = FileSystem .getLocal (new Configuration ());
@@ -96,10 +98,10 @@ public void testNflyWriteSimple() throws IOException {
9698 FileSystem lfs = FileSystem .getLocal (testConf );
9799 for (final URI testUri : testUris ) {
98100 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!" );
100102 final FSDataInputStream fsdis = lfs .open (testFile );
101103 try {
102- assertEquals ("Wrong file content" , testString , fsdis . readUTF () );
104+ assertEquals (fsdis . readUTF (), testString , "Wrong file content" );
103105 } finally {
104106 fsdis .close ();
105107 }
@@ -122,14 +124,14 @@ public void testNflyInvalidMinReplication() throws Exception {
122124 FileSystem .get (URI .create ("viewfs://mt/" ), conf );
123125 fail ("Expected bad minReplication exception." );
124126 } 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" );
127129 }
128130 }
129131
130132
131133 @ Override
132- @ After
134+ @ AfterEach
133135 public void tearDown () throws Exception {
134136 fsTarget .delete (fileSystemTestHelper .getTestRootPath (fsTarget ), true );
135137 super .tearDown ();
0 commit comments