### Question:
DefaultTransferManager extends Observable implements TransferManager { void upload(Upload upload) throws QblStorageException { try (Upload ignored = upload) { try { if (!upload.isValid()) { throw new TransferSkippedException("upload says it's invalid"); } executeUpload(upload); upload.toState(FINISHED); logger.trace("finished upload " + upload); } catch (TransferSkippedException e) { upload.toState(SKIPPED); logger.trace("skipped upload " + upload + " (" + e.getMessage() + ")"); } catch (Exception e) { upload.toState(FAILED); throw e; } } }  @Override List<Transaction> getTransactions(); @Override void addDownload(Download download); @Override List<Transaction> getHistory(); @Override void cleanup(); @Override void addUpload(Upload upload); @Override void run(); void next();  }### Answer:
@Test public void createsRootDirectory() throws QblStorageException { upload.source = tmpPath("/syncRoot"); upload.destination = syncRoot; upload.source.toFile().mkdirs(); upload.isDir = true; manager.upload(upload); List<BoxFolder> folders = nav().listFolders(); assertEquals(1, folders.size()); assertEquals("syncRoot", folders.get(0).getName()); }
@Test public void closesUpload() throws Exception { upload.source = tmpPath("/syncRoot"); upload.destination = syncRoot; upload.source.toFile().mkdir(); upload.isDir = true; manager.upload(upload); assertEquals(FINISHED, upload.state); assertTrue("upload was not closed", upload.closed); }