Skip to content

Commit 8fe9ab3

Browse files
committed
sr/test: Add no-op transport to utils
Signed-off-by: Oren Leiman <oren.leiman@redpanda.com>
1 parent 51b9d48 commit 8fe9ab3

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

src/v/pandaproxy/schema_registry/test/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ redpanda_test_cc_library(
201201
visibility = ["//visibility:public"],
202202
deps = [
203203
"//src/v/pandaproxy/schema_registry:core",
204+
"//src/v/pandaproxy/schema_registry:transport",
204205
],
205206
)
206207

src/v/pandaproxy/schema_registry/test/utils.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
#pragma once
1111
#include "pandaproxy/schema_registry/seq_writer.h"
12+
#include "pandaproxy/schema_registry/transport.h"
13+
14+
#include <stdexcept>
1215

1316
class sequence_state_checker_test
1417
: public pandaproxy::schema_registry::sequence_state_checker {
@@ -21,3 +24,34 @@ class sequence_state_checker_test
2124
private:
2225
writes_disabled_t _wd;
2326
};
27+
28+
/// No-op transport used in tests where seq_writer is only instantiated to
29+
/// receive consume_to_store offset updates.
30+
class noop_transport final : public pandaproxy::schema_registry::transport {
31+
public:
32+
ss::future<> stop() final { return ss::now(); }
33+
ss::future<pandaproxy::schema_registry::produce_result>
34+
produce(model::record_batch) override {
35+
throw std::runtime_error("noop_transport::produce not implemented");
36+
}
37+
ss::future<model::offset> get_high_watermark() override {
38+
throw std::runtime_error(
39+
"noop_transport::get_high_watermark not implemented");
40+
}
41+
ss::future<> consume_range(
42+
model::offset,
43+
model::offset,
44+
ss::noncopyable_function<ss::future<>(model::record_batch)>) override {
45+
throw std::runtime_error(
46+
"noop_transport::consume_range not implemented");
47+
}
48+
ss::future<cluster::errc> create_topic(
49+
model::topic_namespace_view,
50+
int32_t,
51+
cluster::topic_properties,
52+
std::optional<int16_t>) final {
53+
throw std::runtime_error(
54+
"noop_transport::create_topic not implemented");
55+
}
56+
bool has_ephemeral_credentials() const final { return false; }
57+
};

0 commit comments

Comments
 (0)