6#include <initializer_list>
10#include <userver/dynamic_config/snapshot.hpp>
11#include <userver/dynamic_config/source.hpp>
12#include <userver/dynamic_config/value.hpp>
13#include <userver/formats/json/value.hpp>
15USERVER_NAMESPACE_BEGIN
17namespace dynamic_config {
21using IsJson = std::enable_if_t<std::is_same_v<T, formats::json::Value>>;
32 template <
typename Key>
37 template <
typename Key,
typename Json,
typename =
impl::
IsJson<
Json>>
39 : id_(impl::kConfigId<Key>),
43 impl::ConfigId
GetId()
const {
return id_; }
59class StorageMock
final {
66 StorageMock(std::initializer_list<KeyValue> config_variables);
69 explicit StorageMock(
const std::vector<KeyValue>& config_variables);
74 StorageMock(
const DocsMap& defaults,
const std::vector<KeyValue>& overrides);
76 StorageMock(StorageMock&&)
noexcept;
77 StorageMock& operator=(StorageMock&&)
noexcept;
81 void Extend(
const std::vector<KeyValue>& overrides);
83 Source GetSource()
const&;
84 Snapshot GetSnapshot()
const&;
87 Snapshot GetSource() && =
delete;
88 Snapshot GetSnapshot() && =
delete;
91 std::unique_ptr<impl::StorageData> storage_;