@Test void storeShouldThrowWhenMessageIdIsNotCassandraType() { assertThatThrownBy(() -> testee.store(TestMessageId.of(1), MESSAGE_FAST_VIEW_PRECOMPUTED_PROPERTIES_1)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("MessageId type is required to be CassandraMessageId"); }
@Override public Mono<Void> store(MessageId messageId, MessageFastViewPrecomputedProperties precomputedProperties) { checkMessage(messageId); return cassandraAsyncExecutor.executeVoid(storeStatement.bind() .setUUID(MESSAGE_ID, ((CassandraMessageId) messageId).get()) .setString(PREVIEW, precomputedProperties.getPreview().getValue()) .setBool(HAS_ATTACHMENT, precomputedProperties.hasAttachment()) .setConsistencyLevel(ConsistencyLevel.ONE)); }
CassandraMessageFastViewProjection implements MessageFastViewProjection { @Override public Mono<Void> store(MessageId messageId, MessageFastViewPrecomputedProperties precomputedProperties) { checkMessage(messageId); return cassandraAsyncExecutor.executeVoid(storeStatement.bind() .setUUID(MESSAGE_ID, ((CassandraMessageId) messageId).get()) .setString(PREVIEW, precomputedProperties.getPreview().getValue()) .setBool(HAS_ATTACHMENT, precomputedProperties.hasAttachment()) .setConsistencyLevel(ConsistencyLevel.ONE)); } }
CassandraMessageFastViewProjection implements MessageFastViewProjection { @Override public Mono<Void> store(MessageId messageId, MessageFastViewPrecomputedProperties precomputedProperties) { checkMessage(messageId); return cassandraAsyncExecutor.executeVoid(storeStatement.bind() .setUUID(MESSAGE_ID, ((CassandraMessageId) messageId).get()) .setString(PREVIEW, precomputedProperties.getPreview().getValue()) .setBool(HAS_ATTACHMENT, precomputedProperties.hasAttachment()) .setConsistencyLevel(ConsistencyLevel.ONE)); } @Inject  CassandraMessageFastViewProjection(MetricFactory metricFactory, Session session); }
CassandraMessageFastViewProjection implements MessageFastViewProjection { @Override public Mono<Void> store(MessageId messageId, MessageFastViewPrecomputedProperties precomputedProperties) { checkMessage(messageId); return cassandraAsyncExecutor.executeVoid(storeStatement.bind() .setUUID(MESSAGE_ID, ((CassandraMessageId) messageId).get()) .setString(PREVIEW, precomputedProperties.getPreview().getValue()) .setBool(HAS_ATTACHMENT, precomputedProperties.hasAttachment()) .setConsistencyLevel(ConsistencyLevel.ONE)); } @Inject  CassandraMessageFastViewProjection(MetricFactory metricFactory, Session session); @Override Mono<Void> store(MessageId messageId, MessageFastViewPrecomputedProperties precomputedProperties); @Override Mono<MessageFastViewPrecomputedProperties> retrieve(MessageId messageId); @Override Mono<Void> delete(MessageId messageId); @Override Mono<Void> clear(); }
CassandraMessageFastViewProjection implements MessageFastViewProjection { @Override public Mono<Void> store(MessageId messageId, MessageFastViewPrecomputedProperties precomputedProperties) { checkMessage(messageId); return cassandraAsyncExecutor.executeVoid(storeStatement.bind() .setUUID(MESSAGE_ID, ((CassandraMessageId) messageId).get()) .setString(PREVIEW, precomputedProperties.getPreview().getValue()) .setBool(HAS_ATTACHMENT, precomputedProperties.hasAttachment()) .setConsistencyLevel(ConsistencyLevel.ONE)); } @Inject  CassandraMessageFastViewProjection(MetricFactory metricFactory, Session session); @Override Mono<Void> store(MessageId messageId, MessageFastViewPrecomputedProperties precomputedProperties); @Override Mono<MessageFastViewPrecomputedProperties> retrieve(MessageId messageId); @Override Mono<Void> delete(MessageId messageId); @Override Mono<Void> clear(); static final Logger LOGGER; }