use of com.hedera.mirror.grpc.domain.TopicMessageFilter in project hedera-mirror-node by hashgraph.
the class PollingTopicMessageRetrieverTest method limitEqualPageSize.
@ParameterizedTest
@ValueSource(booleans = { true, false })
void limitEqualPageSize(boolean throttle) {
int maxPageSize = overrideMaxPageSize(throttle, 2);
domainBuilder.topicMessages(4, Instant.now()).blockLast();
TopicMessageFilter filter = TopicMessageFilter.builder().startTime(Instant.EPOCH).limit(2L).topicId(TOPIC_ID).build();
pollingTopicMessageRetriever.retrieve(filter, throttle).map(TopicMessage::getSequenceNumber).as(StepVerifier::create).expectNext(1L, 2L).expectComplete().verify(Duration.ofMillis(500));
restoreMaxPageSize(throttle, maxPageSize);
}
use of com.hedera.mirror.grpc.domain.TopicMessageFilter in project hedera-mirror-node by hashgraph.
the class PollingTopicMessageRetrieverTest method startTimeBefore.
@ParameterizedTest
@ValueSource(booleans = { true, false })
void startTimeBefore(boolean throttle) {
domainBuilder.topicMessages(10, Instant.now()).blockLast();
TopicMessageFilter filter = TopicMessageFilter.builder().startTime(Instant.EPOCH).topicId(TOPIC_ID).build();
pollingTopicMessageRetriever.retrieve(filter, throttle).map(TopicMessage::getSequenceNumber).as(StepVerifier::create).expectNext(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L).thenCancel().verify(Duration.ofMillis(1000));
}
use of com.hedera.mirror.grpc.domain.TopicMessageFilter in project hedera-mirror-node by hashgraph.
the class PollingTopicMessageRetrieverTest method noMessages.
@ParameterizedTest
@ValueSource(booleans = { true, false })
void noMessages(boolean throttled) {
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));
}
use of com.hedera.mirror.grpc.domain.TopicMessageFilter in project hedera-mirror-node by hashgraph.
the class PollingTopicMessageRetrieverTest method greaterThanPageSize.
@ParameterizedTest
@ValueSource(booleans = { true, false })
void greaterThanPageSize(boolean throttle) {
int maxPageSize = overrideMaxPageSize(throttle, 2);
domainBuilder.topicMessage().block();
domainBuilder.topicMessage().block();
domainBuilder.topicMessage().block();
TopicMessageFilter filter = TopicMessageFilter.builder().startTime(Instant.EPOCH).topicId(TOPIC_ID).build();
pollingTopicMessageRetriever.retrieve(filter, throttle).map(TopicMessage::getSequenceNumber).as(StepVerifier::create).expectNext(1L, 2L, 3L).expectComplete().verify(Duration.ofMillis(500));
restoreMaxPageSize(throttle, maxPageSize);
}
use of com.hedera.mirror.grpc.domain.TopicMessageFilter in project hedera-mirror-node by hashgraph.
the class PollingTopicMessageRetrieverTest method startTimeEquals.
@ParameterizedTest
@ValueSource(booleans = { true, false })
void startTimeEquals(boolean throttle) {
Instant now = Instant.now();
domainBuilder.topicMessage(t -> t.consensusTimestamp(now)).block();
TopicMessageFilter filter = TopicMessageFilter.builder().startTime(now).topicId(TOPIC_ID).build();
pollingTopicMessageRetriever.retrieve(filter, throttle).map(TopicMessage::getSequenceNumber).as(StepVerifier::create).expectNext(1L).thenCancel().verify(Duration.ofMillis(500));
}
Aggregations