@Test void findShouldReturnCorrectElementsWhenChunking() throws Exception { CassandraMessageId.Factory messageIdFactory = new CassandraMessageId.Factory(); CassandraMailboxSessionMapperFactory mapperFactory = TestCassandraMailboxSessionMapperFactory.forTests( cassandraCluster.getCassandraCluster(), messageIdFactory, CassandraConfiguration.builder() .messageReadChunkSize(3) .build()); saveMessages(); List<MailboxMessage> messages = mapperFactory.getMessageIdMapper(MAILBOX_SESSION) .find( ImmutableList.of(message1.getMessageId(), message2.getMessageId(), message3.getMessageId(), message4.getMessageId()), MessageMapper.FetchType.Metadata); assertThat(messages) .containsOnly(message1, message2, message3, message4); }
@Override public List<MailboxMessage> find(Collection<MessageId> messageIds, FetchType fetchType) { return findReactive(messageIds, fetchType) .collectList() .block(); }
CassandraMessageIdMapper implements MessageIdMapper { @Override public List<MailboxMessage> find(Collection<MessageId> messageIds, FetchType fetchType) { return findReactive(messageIds, fetchType) .collectList() .block(); } }
CassandraMessageIdMapper implements MessageIdMapper { @Override public List<MailboxMessage> find(Collection<MessageId> messageIds, FetchType fetchType) { return findReactive(messageIds, fetchType) .collectList() .block(); } CassandraMessageIdMapper(MailboxMapper mailboxMapper, CassandraMailboxDAO mailboxDAO, CassandraAttachmentMapper attachmentMapper,
                                    CassandraMessageIdToImapUidDAO imapUidDAO, CassandraMessageIdDAO messageIdDAO,
                                    CassandraMessageDAO messageDAO, CassandraIndexTableHandler indexTableHandler,
                                    ModSeqProvider modSeqProvider, CassandraConfiguration cassandraConfiguration); }
CassandraMessageIdMapper implements MessageIdMapper { @Override public List<MailboxMessage> find(Collection<MessageId> messageIds, FetchType fetchType) { return findReactive(messageIds, fetchType) .collectList() .block(); } CassandraMessageIdMapper(MailboxMapper mailboxMapper, CassandraMailboxDAO mailboxDAO, CassandraAttachmentMapper attachmentMapper,
                                    CassandraMessageIdToImapUidDAO imapUidDAO, CassandraMessageIdDAO messageIdDAO,
                                    CassandraMessageDAO messageDAO, CassandraIndexTableHandler indexTableHandler,
                                    ModSeqProvider modSeqProvider, CassandraConfiguration cassandraConfiguration); @Override List<MailboxMessage> find(Collection<MessageId> messageIds, FetchType fetchType); @Override Flux<MailboxMessage> findReactive(Collection<MessageId> messageIds, FetchType fetchType); @Override List<MailboxId> findMailboxes(MessageId messageId); @Override void save(MailboxMessage mailboxMessage); @Override void copyInMailbox(MailboxMessage mailboxMessage, Mailbox mailbox); @Override void delete(MessageId messageId, Collection<MailboxId> mailboxIds); @Override Mono<Void> deleteReactive(MessageId messageId, Collection<MailboxId> mailboxIds); @Override void delete(Multimap<MessageId, MailboxId> ids); @Override void delete(MessageId messageId); @Override Multimap<MailboxId, UpdatedFlags> setFlags(MessageId messageId, List<MailboxId> mailboxIds, Flags newState, MessageManager.FlagsUpdateMode updateMode); }
CassandraMessageIdMapper implements MessageIdMapper { @Override public List<MailboxMessage> find(Collection<MessageId> messageIds, FetchType fetchType) { return findReactive(messageIds, fetchType) .collectList() .block(); } CassandraMessageIdMapper(MailboxMapper mailboxMapper, CassandraMailboxDAO mailboxDAO, CassandraAttachmentMapper attachmentMapper,
                                    CassandraMessageIdToImapUidDAO imapUidDAO, CassandraMessageIdDAO messageIdDAO,
                                    CassandraMessageDAO messageDAO, CassandraIndexTableHandler indexTableHandler,
                                    ModSeqProvider modSeqProvider, CassandraConfiguration cassandraConfiguration); @Override List<MailboxMessage> find(Collection<MessageId> messageIds, FetchType fetchType); @Override Flux<MailboxMessage> findReactive(Collection<MessageId> messageIds, FetchType fetchType); @Override List<MailboxId> findMailboxes(MessageId messageId); @Override void save(MailboxMessage mailboxMessage); @Override void copyInMailbox(MailboxMessage mailboxMessage, Mailbox mailbox); @Override void delete(MessageId messageId, Collection<MailboxId> mailboxIds); @Override Mono<Void> deleteReactive(MessageId messageId, Collection<MailboxId> mailboxIds); @Override void delete(Multimap<MessageId, MailboxId> ids); @Override void delete(MessageId messageId); @Override Multimap<MailboxId, UpdatedFlags> setFlags(MessageId messageId, List<MailboxId> mailboxIds, Flags newState, MessageManager.FlagsUpdateMode updateMode);  }