### Question:
LoadCommand implements AdminCommand { @Override public void execute( String[] args ) throws IncorrectUsage, CommandFailed { arguments.parse( args ); Path archive = arguments.getMandatoryPath( "from" ); String database = arguments.get( ARG_DATABASE ); boolean force = arguments.getBoolean( "force" ); Config config = buildConfig( database ); Path databaseDirectory = canonicalPath( getDatabaseDirectory( config ) ); Path transactionLogsDirectory = canonicalPath( getTransactionalLogsDirectory( config ) ); deleteIfNecessary( databaseDirectory, transactionLogsDirectory, force ); load( archive, database, databaseDirectory, transactionLogsDirectory ); } LoadCommand( Path homeDir, Path configDir, Loader loader ); @Override void execute( String[] args ); static Arguments arguments();  }### Answer:
@Test void shouldRespectTheStoreLock() throws IOException { Path databaseDirectory = homeDir.resolve( "data/databases/foo.db" ); Files.createDirectories( databaseDirectory ); StoreLayout storeLayout = DatabaseLayout.of( databaseDirectory.toFile() ).getStoreLayout(); try ( FileSystemAbstraction fileSystem = new DefaultFileSystemAbstraction(); StoreLocker locker = new StoreLocker( fileSystem, storeLayout ) ) { locker.checkLock(); CommandFailed commandFailed = assertThrows( CommandFailed.class, () -> execute( "foo.db", "--force" ) ); assertEquals( "the database is in use -- stop Neo4j and try again", commandFailed.getMessage() ); } }
@Test void shouldObjectIfTheArchiveArgumentIsMissing() { IllegalArgumentException exception = assertThrows( IllegalArgumentException.class, () -> new LoadCommand( homeDir, configDir, loader ).execute( new String[]{"--database=something"} ) ); assertEquals( "Missing argument 'from'", exception.getMessage() ); }