/proc/self/cwd/test/mocks/server/config_tracker.h
Line | Count | Source |
1 | | #pragma once |
2 | | |
3 | | #include <string> |
4 | | |
5 | | #include "envoy/server/config_tracker.h" |
6 | | |
7 | | #include "absl/container/node_hash_map.h" |
8 | | #include "gmock/gmock.h" |
9 | | |
10 | | namespace Envoy { |
11 | | namespace Server { |
12 | | class MockConfigTracker : public ConfigTracker { |
13 | | public: |
14 | | MockConfigTracker(); |
15 | | ~MockConfigTracker() override; |
16 | | |
17 | | struct MockEntryOwner : public EntryOwner {}; |
18 | | |
19 | | MOCK_METHOD(EntryOwner*, add_, (std::string, Cb)); |
20 | | |
21 | | // Server::ConfigTracker |
22 | | MOCK_METHOD(const CbsMap&, getCallbacksMap, (), (const)); |
23 | 14.5k | EntryOwnerPtr add(const std::string& key, Cb callback) override { |
24 | 14.5k | return EntryOwnerPtr{add_(key, std::move(callback))}; |
25 | 14.5k | } |
26 | | |
27 | | absl::node_hash_map<std::string, Cb> config_tracker_callbacks_; |
28 | | }; |
29 | | } // namespace Server |
30 | | } // namespace Envoy |