/proc/self/cwd/test/mocks/upstream/typed_load_balancer_factory.h
Line | Count | Source (jump to first uncovered line) |
1 | | #pragma once |
2 | | |
3 | | #include "envoy/upstream/load_balancer.h" |
4 | | |
5 | | #include "source/common/upstream/load_balancer_factory_base.h" |
6 | | |
7 | | #include "gmock/gmock.h" |
8 | | #include "gtest/gtest.h" |
9 | | |
10 | | namespace Envoy { |
11 | | namespace Upstream { |
12 | | class MockTypedLoadBalancerFactory : public TypedLoadBalancerFactory { |
13 | | public: |
14 | | class EmptyLoadBalancerConfig : public LoadBalancerConfig { |
15 | | public: |
16 | 0 | EmptyLoadBalancerConfig() = default; |
17 | | }; |
18 | | |
19 | | MockTypedLoadBalancerFactory(); |
20 | | ~MockTypedLoadBalancerFactory() override; |
21 | | |
22 | | // Upstream::TypedLoadBalancerFactory |
23 | | MOCK_METHOD(std::string, name, (), (const)); |
24 | | MOCK_METHOD(ThreadAwareLoadBalancerPtr, create, |
25 | | (OptRef<const LoadBalancerConfig> lb_config, const ClusterInfo& cluster_info, |
26 | | const PrioritySet& priority_set, Runtime::Loader& runtime, |
27 | | Random::RandomGenerator& random, TimeSource& time_source)); |
28 | | |
29 | | LoadBalancerConfigPtr loadConfig(const Protobuf::Message&, |
30 | 0 | ProtobufMessage::ValidationVisitor&) override { |
31 | 0 | return std::make_unique<EmptyLoadBalancerConfig>(); |
32 | 0 | } |
33 | | |
34 | 0 | ProtobufTypes::MessagePtr createEmptyConfigProto() override { |
35 | | // Using Struct instead of a custom per-filter empty config proto |
36 | | // This is only allowed in tests. |
37 | 0 | return ProtobufTypes::MessagePtr{new Envoy::ProtobufWkt::Struct()}; |
38 | 0 | } |
39 | | }; |
40 | | } // namespace Upstream |
41 | | } // namespace Envoy |