@Test void fromMessageIdsShouldKeepProcessingEvenWhenFetchingFail() { doReturn(Flux.error(new MailboxException("mock exception"))) .doCallRealMethod() .when(messageIdManager).getMessagesReactive(any(), any(), any()); List<MessageFastView> actual = messageFastViewFactory .fromMessageIds(ImmutableList.of( missingPreviewComputedMessage1.getMessageId(), previewComputedMessage1.getMessageId()), session) .collectList().block(); assertThat(actual) .hasSize(1) .extracting(MessageFastView::getId) .containsAnyOf(missingPreviewComputedMessage1.getMessageId(), previewComputedMessage1.getMessageId()); }
@Override public Flux<MessageFastView> fromMessageIds(List<MessageId> messageIds, MailboxSession mailboxSession) { ImmutableSet<MessageId> messageIdSet = ImmutableSet.copyOf(messageIds); return Mono.from(fastViewProjection.retrieve(messageIds)) .flatMapMany(fastProjections -> gatherMessageViews(messageIdSet, mailboxSession, fastProjections)); }
MessageFastViewFactory implements MessageViewFactory<MessageFastView> { @Override public Flux<MessageFastView> fromMessageIds(List<MessageId> messageIds, MailboxSession mailboxSession) { ImmutableSet<MessageId> messageIdSet = ImmutableSet.copyOf(messageIds); return Mono.from(fastViewProjection.retrieve(messageIds)) .flatMapMany(fastProjections -> gatherMessageViews(messageIdSet, mailboxSession, fastProjections)); } }
MessageFastViewFactory implements MessageViewFactory<MessageFastView> { @Override public Flux<MessageFastView> fromMessageIds(List<MessageId> messageIds, MailboxSession mailboxSession) { ImmutableSet<MessageId> messageIdSet = ImmutableSet.copyOf(messageIds); return Mono.from(fastViewProjection.retrieve(messageIds)) .flatMapMany(fastProjections -> gatherMessageViews(messageIdSet, mailboxSession, fastProjections)); } @Inject @VisibleForTesting  MessageFastViewFactory(BlobManager blobManager, MessageIdManager messageIdManager, MessageFastViewProjection fastViewProjection,
                                  MessageFullViewFactory messageFullViewFactory); }
MessageFastViewFactory implements MessageViewFactory<MessageFastView> { @Override public Flux<MessageFastView> fromMessageIds(List<MessageId> messageIds, MailboxSession mailboxSession) { ImmutableSet<MessageId> messageIdSet = ImmutableSet.copyOf(messageIds); return Mono.from(fastViewProjection.retrieve(messageIds)) .flatMapMany(fastProjections -> gatherMessageViews(messageIdSet, mailboxSession, fastProjections)); } @Inject @VisibleForTesting  MessageFastViewFactory(BlobManager blobManager, MessageIdManager messageIdManager, MessageFastViewProjection fastViewProjection,
                                  MessageFullViewFactory messageFullViewFactory); @Override Flux<MessageFastView> fromMessageIds(List<MessageId> messageIds, MailboxSession mailboxSession); }
MessageFastViewFactory implements MessageViewFactory<MessageFastView> { @Override public Flux<MessageFastView> fromMessageIds(List<MessageId> messageIds, MailboxSession mailboxSession) { ImmutableSet<MessageId> messageIdSet = ImmutableSet.copyOf(messageIds); return Mono.from(fastViewProjection.retrieve(messageIds)) .flatMapMany(fastProjections -> gatherMessageViews(messageIdSet, mailboxSession, fastProjections)); } @Inject @VisibleForTesting  MessageFastViewFactory(BlobManager blobManager, MessageIdManager messageIdManager, MessageFastViewProjection fastViewProjection,
                                  MessageFullViewFactory messageFullViewFactory); @Override Flux<MessageFastView> fromMessageIds(List<MessageId> messageIds, MailboxSession mailboxSession);  }