@Test public void shouldFailToSend() { given(mockMutinyMailClient.sendMail(any())).willReturn(Uni.createFrom().failure(new RuntimeException("test"))); Mono<MailResult> result = mailClient.send(new SimpleMailMessage()); StepVerifier.create(result) .expectNextCount(0) .expectErrorMessage("test") .verify(); }
@Override public Mono<MailResult> send(MailMessage message) { return mailMessageConverter .toVertxMailMessage(message) .flatMap(vertxMessage -> delegate.sendMail(vertxMessage) .convert() .with(UniReactorConverters.toMono())) .map(mailResultConverter::fromVertxMailResult); }
VertxMailClient implements MailClient { @Override public Mono<MailResult> send(MailMessage message) { return mailMessageConverter .toVertxMailMessage(message) .flatMap(vertxMessage -> delegate.sendMail(vertxMessage) .convert() .with(UniReactorConverters.toMono())) .map(mailResultConverter::fromVertxMailResult); } }
VertxMailClient implements MailClient { @Override public Mono<MailResult> send(MailMessage message) { return mailMessageConverter .toVertxMailMessage(message) .flatMap(vertxMessage -> delegate.sendMail(vertxMessage) .convert() .with(UniReactorConverters.toMono())) .map(mailResultConverter::fromVertxMailResult); } VertxMailClient(io.vertx.mutiny.ext.mail.MailClient delegate, MailMessageConverter mailMessageConverter,
        MailResultConverter mailResultConverter); }
VertxMailClient implements MailClient { @Override public Mono<MailResult> send(MailMessage message) { return mailMessageConverter .toVertxMailMessage(message) .flatMap(vertxMessage -> delegate.sendMail(vertxMessage) .convert() .with(UniReactorConverters.toMono())) .map(mailResultConverter::fromVertxMailResult); } VertxMailClient(io.vertx.mutiny.ext.mail.MailClient delegate, MailMessageConverter mailMessageConverter,
        MailResultConverter mailResultConverter); @Override Mono<MailResult> send(MailMessage message); }
VertxMailClient implements MailClient { @Override public Mono<MailResult> send(MailMessage message) { return mailMessageConverter .toVertxMailMessage(message) .flatMap(vertxMessage -> delegate.sendMail(vertxMessage) .convert() .with(UniReactorConverters.toMono())) .map(mailResultConverter::fromVertxMailResult); } VertxMailClient(io.vertx.mutiny.ext.mail.MailClient delegate, MailMessageConverter mailMessageConverter,
        MailResultConverter mailResultConverter); @Override Mono<MailResult> send(MailMessage message);  }