### Question:
SetInitialPasswordCommand implements AdminCommand { @Override public void execute( String[] args ) throws IncorrectUsage, CommandFailed { try { setPassword( arguments.parse( args ).get( 0 ) ); } catch ( IncorrectUsage | CommandFailed e ) { throw e; } catch ( Throwable throwable ) { throw new CommandFailed( throwable.getMessage(), new RuntimeException( throwable ) ); } } SetInitialPasswordCommand( Path homeDir, Path configDir, OutsideWorld outsideWorld ); static Arguments arguments(); @Override void execute( String[] args );  }### Answer:
@Test public void shouldFailSetPasswordWithNoArguments() { assertException( () -> setPasswordCommand.execute( new String[0] ), IncorrectUsage.class, "not enough arguments" ); }
@Test public void shouldFailSetPasswordWithTooManyArguments() { String[] arguments = {"", "123", "321"}; assertException( () -> setPasswordCommand.execute( arguments ), IncorrectUsage.class, "unrecognized arguments: '123 321'" ); }
@Test public void shouldSetInitialPassword() throws Throwable { assertFalse( fileSystem.fileExists( authInitFile ) ); String[] arguments = {"123"}; setPasswordCommand.execute( arguments ); assertAuthIniFile( "123" ); }
@Test public void shouldOverwriteInitialPasswordFileIfExists() throws Throwable { fileSystem.mkdirs( authInitFile.getParentFile() ); fileSystem.create( authInitFile ); String[] arguments = {"123"}; setPasswordCommand.execute( arguments ); assertAuthIniFile( "123" ); }
@Test public void shouldWorkAlsoWithSamePassword() throws Throwable { String[] arguments = {"neo4j"}; setPasswordCommand.execute( arguments ); assertAuthIniFile( "neo4j" ); }