@Test void fromMessageIdsShouldReturnMessagesWithPreviews() throws Exception { List<MessageFastView> actual = messageFastViewFactory .fromMessageIds(ImmutableList.of( previewComputedMessage2.getMessageId(), previewComputedMessage3.getMessageId(), missingPreviewComputedMessage1.getMessageId(), previewComputedMessage1.getMessageId()), session).collectList().block(); assertThat(actual) .hasSize(4) .extracting(MessageFastView::getPreview) .containsOnly( PreviewDTO.of(PREVIEW_3_STRING), PreviewDTO.of(PREVIEW_4_STRING), PreviewDTO.of(DEFAULT_PREVIEW_STRING), PreviewDTO.of(PREVIEW_1_STRING)); }
@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);  }