Use default values instantly for batch size/interval (#306)

This commit is contained in:
Antonio Andelic
2021-11-30 16:29:51 +01:00
committed by GitHub
parent 05d0aee494
commit d9bb4e2e46
19 changed files with 92 additions and 100 deletions

View File

@@ -21,6 +21,7 @@
#include <gtest/gtest.h>
#include <spdlog/common.h>
#include <spdlog/spdlog.h>
#include "integrations/kafka/consumer.hpp"
#include "integrations/kafka/exceptions.hpp"
#include "kafka_mock.hpp"
@@ -40,6 +41,10 @@ int SpanToInt(std::span<const char> span) {
std::memcpy(&result, span.data(), sizeof(int));
return result;
}
constexpr std::chrono::milliseconds kDefaultBatchInterval{100};
constexpr int64_t kDefaultBatchSize{1000};
} // namespace
struct ConsumerTest : public ::testing::Test {
@@ -52,8 +57,8 @@ struct ConsumerTest : public ::testing::Test {
.topics = {kTopicName},
.consumer_group = "ConsumerGroup " + test_name,
.bootstrap_servers = cluster.Bootstraps(),
.batch_interval = std::nullopt,
.batch_size = std::nullopt,
.batch_interval = kDefaultBatchInterval,
.batch_size = kDefaultBatchSize,
};
};