7272import org .apache .hadoop .util .ToolRunner ;
7373import org .junit .jupiter .api .AfterAll ;
7474import org .junit .jupiter .api .BeforeAll ;
75- import org .junit .jupiter .api .Assertions ;
7675import org .slf4j .event .Level ;
7776
7877import static org .apache .hadoop .fs .CommonConfigurationKeysPublic .FS_TRASH_INTERVAL_KEY ;
8180import static org .apache .hadoop .fs .permission .AclEntryType .*;
8281import static org .apache .hadoop .fs .permission .FsAction .*;
8382import static org .apache .hadoop .hdfs .server .namenode .AclTestHelpers .aclEntry ;
84- import static org .junit .jupiter .api .Assertions .*;
8583import static org .assertj .core .api .Assertions .assertThat ;
84+ import static org .junit .jupiter .api .Assertions .assertEquals ;
85+ import static org .junit .jupiter .api .Assertions .assertArrayEquals ;
86+ import static org .junit .jupiter .api .Assertions .assertFalse ;
87+ import static org .junit .jupiter .api .Assertions .assertNotNull ;
88+ import static org .junit .jupiter .api .Assertions .assertThrows ;
89+ import static org .junit .jupiter .api .Assertions .assertTrue ;
90+ import static org .junit .jupiter .api .Assertions .fail ;
8691
8792/**
8893 * This class tests commands from DFSShell.
@@ -561,10 +566,10 @@ public void testPut() throws IOException {
561566 try (FSDataOutputStream out = dfs .create (dst , false )) {
562567 // It should fail to create a new client writing to the same file.
563568 try (DFSClient client = new DFSClient (dfs .getUri (), dfs .getConf ())) {
564- final RemoteException e = Assertions . assertThrows (RemoteException .class ,
569+ final RemoteException e = assertThrows (RemoteException .class ,
565570 () -> client .create (dst .toString (), false ));
566571 LOG .info ("GOOD" , e );
567- Assertions . assertEquals (e .getClassName (), AlreadyBeingCreatedException .class .getName ());
572+ assertEquals (e .getClassName (), AlreadyBeingCreatedException .class .getName ());
568573 }
569574 // It should succeed to continue writing to the file.
570575 out .writeUTF (hello );
@@ -1121,7 +1126,7 @@ public void testChecksum() throws Exception {
11211126 assertTrue (out .toString ().contains (StringUtils .byteToHexString (checksum .getBytes (),
11221127 0 , checksum .getLength ())));
11231128 } finally {
1124- Assertions . assertNotNull (printStream );
1129+ assertNotNull (printStream );
11251130 System .setOut (printStream );
11261131 }
11271132 }
@@ -1964,22 +1969,22 @@ public void testGet() throws IOException {
19641969 public String run (int exitcode , String ... options ) throws IOException {
19651970 String dst = new File (TEST_ROOT_DIR , fname + ++count )
19661971 .getAbsolutePath ();
1967- String [] args = new String [options .length + 3 ];
1968- args [0 ] = "-get" ;
1969- args [args .length - 2 ] = remotef .toString ();
1970- args [args .length - 1 ] = dst ;
1971- for (int i = 0 ; i < options .length ; i ++) {
1972- args [i + 1 ] = options [i ];
1973- }
1974- show ("args=" + Arrays .asList (args ));
1975-
1976- try {
1977- assertEquals (exitcode , shell .run (args ));
1978- } catch (Exception e ) {
1972+ String [] args = new String [options .length + 3 ];
1973+ args [0 ] = "-get" ;
1974+ args [args .length - 2 ] = remotef .toString ();
1975+ args [args .length - 1 ] = dst ;
1976+ for (int i = 0 ; i < options .length ; i ++) {
1977+ args [i + 1 ] = options [i ];
1978+ }
1979+ show ("args=" + Arrays .asList (args ));
1980+
1981+ try {
1982+ assertEquals (exitcode , shell .run (args ));
1983+ } catch (Exception e ) {
19791984 assertTrue (false , StringUtils .stringifyException (e ));
1980- }
1981- return exitcode == 0 ? DFSTestUtil .readFile (new File (dst )): null ;
1982- }
1985+ }
1986+ return exitcode == 0 ? DFSTestUtil .readFile (new File (dst )) : null ;
1987+ }
19831988 };
19841989
19851990 File localf = createLocalFile (new File (TEST_ROOT_DIR , fname ));
@@ -1988,7 +1993,7 @@ public String run(int exitcode, String... options) throws IOException {
19881993
19891994 try {
19901995 cluster = new MiniDFSCluster .Builder (conf ).numDataNodes (2 ).format (true )
1991- .build ();
1996+ .build ();
19921997 dfs = cluster .getFileSystem ();
19931998
19941999 mkdir (dfs , root );
@@ -2017,13 +2022,13 @@ public String run(int exitcode, String... options) throws IOException {
20172022
20182023 // Start the miniCluster again, but do not reformat, so prior files remain.
20192024 cluster = new MiniDFSCluster .Builder (conf ).numDataNodes (2 ).format (false )
2020- .build ();
2025+ .build ();
20212026 dfs = cluster .getFileSystem ();
20222027
20232028 assertEquals (null , runner .run (1 ));
20242029 String corruptedcontent = runner .run (0 , "-ignoreCrc" );
20252030 assertEquals (localfcontent .substring (1 ), corruptedcontent .substring (1 ));
2026- assertEquals (localfcontent .charAt (0 )+ 1 , corruptedcontent .charAt (0 ));
2031+ assertEquals (localfcontent .charAt (0 ) + 1 , corruptedcontent .charAt (0 ));
20272032 } finally {
20282033 if (null != dfs ) {
20292034 try {
0 commit comments