@Test public void testDelete(TestContext context) { Async async = context.async(); UUID id = UUID.randomUUID(); Buffer buffer = Buffer.buffer("buffer"); fileSystem.store(id, buffer).flatMap(v -> { return fileSystem.delete(id); }).toObservable().flatMap(v -> { return fileSystem.load(id).toObservable(); }).subscribe(onNext -> { context.fail(); }, error -> { context.assertTrue(error instanceof IllegalArgumentException); async.complete(); }, () -> { context.fail(); }); }
@Override public Single<UUID> delete(UUID id) { String path = baseDir + "/" + Objects.requireNonNull(id); return rxJavaVertx.fileSystem().deleteObservable(path).toSingle() .map(v -> id); }
MountedFileSystem implements SharedFileSystem { @Override public Single<UUID> delete(UUID id) { String path = baseDir + "/" + Objects.requireNonNull(id); return rxJavaVertx.fileSystem().deleteObservable(path).toSingle() .map(v -> id); } }
MountedFileSystem implements SharedFileSystem { @Override public Single<UUID> delete(UUID id) { String path = baseDir + "/" + Objects.requireNonNull(id); return rxJavaVertx.fileSystem().deleteObservable(path).toSingle() .map(v -> id); } @Inject  MountedFileSystem(@Named("mountedDir") String baseDir, Vertx vertx); }
MountedFileSystem implements SharedFileSystem { @Override public Single<UUID> delete(UUID id) { String path = baseDir + "/" + Objects.requireNonNull(id); return rxJavaVertx.fileSystem().deleteObservable(path).toSingle() .map(v -> id); } @Inject  MountedFileSystem(@Named("mountedDir") String baseDir, Vertx vertx); @Override Single<File> load(UUID id); @Override Single<UUID> store(UUID id, Buffer buffer); @Override Single<UUID> delete(UUID id); }
MountedFileSystem implements SharedFileSystem { @Override public Single<UUID> delete(UUID id) { String path = baseDir + "/" + Objects.requireNonNull(id); return rxJavaVertx.fileSystem().deleteObservable(path).toSingle() .map(v -> id); } @Inject  MountedFileSystem(@Named("mountedDir") String baseDir, Vertx vertx); @Override Single<File> load(UUID id); @Override Single<UUID> store(UUID id, Buffer buffer); @Override Single<UUID> delete(UUID id);  }