use of com.hedera.mirror.grpc.domain.TopicMessageFilter in project hedera-mirror-node by hashgraph.
the class TopicMessageRepositoryTest method findByFilterEmpty.
@Test
void findByFilterEmpty() {
TopicMessageFilter filter = TopicMessageFilter.builder().startTime(Instant.EPOCH).topicId(EntityId.of(100L, EntityType.TOPIC)).build();
assertThat(topicMessageRepository.findByFilter(filter)).isEmpty();
}
use of com.hedera.mirror.grpc.domain.TopicMessageFilter in project hedera-mirror-node by hashgraph.
the class TopicMessageRepositoryTest method findByFilterWithLimit.
@Test
void findByFilterWithLimit() {
TopicMessage topicMessage1 = domainBuilder.topicMessage().block();
TopicMessage topicMessage2 = domainBuilder.topicMessage().block();
TopicMessage topicMessage3 = domainBuilder.topicMessage().block();
TopicMessageFilter filter = TopicMessageFilter.builder().limit(1).startTime(topicMessage1.getConsensusTimestampInstant()).topicId(EntityId.of(topicMessage1.getTopicId(), EntityType.TOPIC)).build();
assertThat(topicMessageRepository.findByFilter(filter)).containsExactly(topicMessage1);
}
use of com.hedera.mirror.grpc.domain.TopicMessageFilter in project hedera-mirror-node by hashgraph.
the class TopicMessageRepositoryTest method findByFilterNoMatch.
@Test
void findByFilterNoMatch() {
TopicMessage topicMessage1 = domainBuilder.topicMessage().block();
TopicMessage topicMessage2 = domainBuilder.topicMessage().block();
TopicMessage topicMessage3 = domainBuilder.topicMessage().block();
TopicMessageFilter filter = TopicMessageFilter.builder().startTime(Instant.now().plusSeconds(10)).topicId(EntityId.of(topicMessage1.getTopicId(), EntityType.TOPIC)).build();
assertThat(topicMessageRepository.findByFilter(filter)).isEmpty();
}
use of com.hedera.mirror.grpc.domain.TopicMessageFilter in project hedera-mirror-node by hashgraph.
the class TopicMessageRepositoryTest method findByFilterWithEndTime.
@Test
void findByFilterWithEndTime() {
TopicMessage topicMessage1 = domainBuilder.topicMessage().block();
TopicMessage topicMessage2 = domainBuilder.topicMessage().block();
TopicMessage topicMessage3 = domainBuilder.topicMessage().block();
TopicMessageFilter filter = TopicMessageFilter.builder().startTime(topicMessage1.getConsensusTimestampInstant()).endTime(topicMessage3.getConsensusTimestampInstant()).topicId(EntityId.of(topicMessage1.getTopicId(), EntityType.TOPIC)).build();
assertThat(topicMessageRepository.findByFilter(filter)).containsExactly(topicMessage1, topicMessage2);
}
use of com.hedera.mirror.grpc.domain.TopicMessageFilter in project hedera-mirror-node by hashgraph.
the class PollingTopicMessageRetrieverTest method notEnabled.
@ParameterizedTest
@ValueSource(booleans = { true, false })
void notEnabled(boolean throttled) {
retrieverProperties.setEnabled(false);
domainBuilder.topicMessage().block();
TopicMessageFilter filter = TopicMessageFilter.builder().startTime(Instant.EPOCH).topicId(TOPIC_ID).build();
pollingTopicMessageRetriever.retrieve(filter, throttled).map(TopicMessage::getSequenceNumber).as(StepVerifier::create).expectNextCount(0L).expectComplete().verify(Duration.ofMillis(500));
retrieverProperties.setEnabled(true);
}
Aggregations