userver: userver/server/handlers/tests_control.hpp Source File
Loading...
Searching...
No Matches
tests_control.hpp
Go to the documentation of this file.
1#pragma once
2
5
6#include <memory>
7
10
11USERVER_NAMESPACE_BEGIN
12
13namespace testsuite::impl::actions {
14class BaseTestsuiteAction;
15}
16
17namespace server::handlers {
18
19// clang-format off
20
63
64// clang-format on
65class TestsControl final : public HttpHandlerJsonBase {
66public:
67 TestsControl(const components::ComponentConfig& config, const components::ComponentContext& component_context);
68 ~TestsControl() override;
69
72 static constexpr std::string_view kName = "tests-control";
73
74 formats::json::Value HandleRequestJsonThrow(
76 const formats::json::Value& request_body,
78 ) const override;
79
81
82private:
83 formats::json::Value PerformAction(const std::string& action_name, const formats::json::Value& request_body) const;
84
85 std::unique_ptr<testsuite::TestpointClientBase> testpoint_client_;
86 std::unordered_map<std::string, std::unique_ptr<testsuite::impl::actions::BaseTestsuiteAction>> actions_;
87};
88
89} // namespace server::handlers
90
91USERVER_NAMESPACE_END