@Test public void testDownload(TestContext context) throws IOException { Async async = context.async(); SharedFileSystem fileSystem = Mockito.mock(SharedFileSystem.class); FileMetadataRegistry fileMetadataRegistry = Mockito.mock(FileMetadataRegistry.class); FileTransporter transporter = new FileTransporter(vertx, fileSystem, fileMetadataRegistry); File source = new File("src/test/resources", "1MiB.dat"); UUID id = UUID.randomUUID(); FileMetadata metadata = new FileMetadata(id, "1MiB.dat", MimeType.valueOf("text/plain"), 1024 * 1024, Instant.now()); doReturn(Single.just(source)).when(fileSystem).load(eq(id)); doReturn(Single.just(metadata)).when(fileMetadataRegistry).load(eq(id)); transporter.download(id).subscribe(v -> { Mockito.verify(fileSystem).load(eq(id)); Mockito.verify(fileMetadataRegistry).load(eq(id)); async.complete(); }); }
Single<Tuple2<FileMetadata, File>> download(UUID id) { return observableFileMetadataRegistry.load(id) .zipWith(observableFileSystem.load(id), Tuple2::apply); }
FileTransporter { Single<Tuple2<FileMetadata, File>> download(UUID id) { return observableFileMetadataRegistry.load(id) .zipWith(observableFileSystem.load(id), Tuple2::apply); } }
FileTransporter { Single<Tuple2<FileMetadata, File>> download(UUID id) { return observableFileMetadataRegistry.load(id) .zipWith(observableFileSystem.load(id), Tuple2::apply); }  }
FileTransporter { Single<Tuple2<FileMetadata, File>> download(UUID id) { return observableFileMetadataRegistry.load(id) .zipWith(observableFileSystem.load(id), Tuple2::apply); }   }
FileTransporter { Single<Tuple2<FileMetadata, File>> download(UUID id) { return observableFileMetadataRegistry.load(id) .zipWith(observableFileSystem.load(id), Tuple2::apply); }    }