@Test void exportUserMailboxesDataShouldUpdateProgressWhenZipping() throws IOException { testee.zipMailboxesContent(progress, BOB); assertThat(progress.getStage()).isEqualTo(ExportService.Stage.ZIPPING); }
InputStream zipMailboxesContent(Progress progress, Username username) throws IOException { progress.setStage(Stage.ZIPPING); PipedOutputStream out = new PipedOutputStream(); PipedInputStream in = new PipedInputStream(out); writeUserMailboxesContent(username, out) .subscribeOn(Schedulers.elastic()) .subscribe(); return in; }
ExportService { InputStream zipMailboxesContent(Progress progress, Username username) throws IOException { progress.setStage(Stage.ZIPPING); PipedOutputStream out = new PipedOutputStream(); PipedInputStream in = new PipedInputStream(out); writeUserMailboxesContent(username, out) .subscribeOn(Schedulers.elastic()) .subscribe(); return in; } }
ExportService { InputStream zipMailboxesContent(Progress progress, Username username) throws IOException { progress.setStage(Stage.ZIPPING); PipedOutputStream out = new PipedOutputStream(); PipedInputStream in = new PipedInputStream(out); writeUserMailboxesContent(username, out) .subscribeOn(Schedulers.elastic()) .subscribe(); return in; } @Inject  ExportService(MailboxBackup mailboxBackup, BlobStore blobStore, BlobExportMechanism blobExport, UsersRepository usersRepository); }
ExportService { InputStream zipMailboxesContent(Progress progress, Username username) throws IOException { progress.setStage(Stage.ZIPPING); PipedOutputStream out = new PipedOutputStream(); PipedInputStream in = new PipedInputStream(out); writeUserMailboxesContent(username, out) .subscribeOn(Schedulers.elastic()) .subscribe(); return in; } @Inject  ExportService(MailboxBackup mailboxBackup, BlobStore blobStore, BlobExportMechanism blobExport, UsersRepository usersRepository); Mono<Task.Result> export(Progress progress, Username username); }
ExportService { InputStream zipMailboxesContent(Progress progress, Username username) throws IOException { progress.setStage(Stage.ZIPPING); PipedOutputStream out = new PipedOutputStream(); PipedInputStream in = new PipedInputStream(out); writeUserMailboxesContent(username, out) .subscribeOn(Schedulers.elastic()) .subscribe(); return in; } @Inject  ExportService(MailboxBackup mailboxBackup, BlobStore blobStore, BlobExportMechanism blobExport, UsersRepository usersRepository); Mono<Task.Result> export(Progress progress, Username username);  }