Coverage Report

Created: 2024-09-19 09:45

/proc/self/cwd/test/mocks/upstream/cluster.cc
Line
Count
Source (jump to first uncovered line)
1
#include "cluster.h"
2
3
#include "gmock/gmock.h"
4
#include "gtest/gtest.h"
5
6
namespace Envoy {
7
namespace Upstream {
8
using ::testing::_;
9
using ::testing::Invoke;
10
using ::testing::Return;
11
using ::testing::ReturnRef;
12
13
43.5k
MockCluster::MockCluster() {
14
43.5k
  ON_CALL(*this, info()).WillByDefault(Return(info_));
15
43.5k
  ON_CALL(*this, initialize(_))
16
43.5k
      .WillByDefault(Invoke([this](std::function<void()> callback) -> void {
17
0
        EXPECT_EQ(nullptr, initialize_callback_);
18
0
        initialize_callback_ = callback;
19
0
      }));
20
43.5k
  ON_CALL(*this, dropOverload()).WillByDefault(Return(drop_overload_));
21
43.5k
  ON_CALL(*this, dropCategory()).WillByDefault(ReturnRef(drop_category_));
22
43.5k
  ON_CALL(*this, setDropOverload(_)).WillByDefault(Invoke([this](UnitFloat drop_overload) -> void {
23
0
    drop_overload_ = drop_overload;
24
0
  }));
25
43.5k
  ON_CALL(*this, setDropCategory(_))
26
43.5k
      .WillByDefault(Invoke(
27
43.5k
          [this](absl::string_view drop_category) -> void { drop_category_ = drop_category; }));
28
43.5k
}
29
30
43.5k
MockCluster::~MockCluster() = default;
31
32
} // namespace Upstream
33
} // namespace Envoy