File: mock_consistent_store.h

package info (click to toggle)
golang-github-google-certificate-transparency 0.0~git20160709.0.0f6e3d1~ds1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster
  • size: 5,676 kB
  • sloc: cpp: 35,278; python: 11,838; java: 1,911; sh: 1,885; makefile: 950; xml: 520; ansic: 225
file content (61 lines) | stat: -rw-r--r-- 1,969 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef CERT_TRANS_LOG_MOCK_CONSISTENT_STORE_H_
#define CERT_TRANS_LOG_MOCK_CONSISTENT_STORE_H_

#include <gmock/gmock.h>

#include "log/consistent_store.h"

namespace cert_trans {

class MockConsistentStore : public ConsistentStore {
 public:
  MOCK_CONST_METHOD0_T(NextAvailableSequenceNumber, util::StatusOr<int64_t>());

  MOCK_METHOD1_T(SetServingSTH, util::Status(const ct::SignedTreeHead&));

  MOCK_CONST_METHOD0_T(GetServingSTH, util::StatusOr<ct::SignedTreeHead>());

  MOCK_METHOD1_T(AddPendingEntry, util::Status(LoggedEntry* entry));

  MOCK_CONST_METHOD2_T(GetPendingEntryForHash,
                       util::Status(const std::string& hash,
                                    EntryHandle<LoggedEntry>* entry));

  MOCK_CONST_METHOD1_T(
      GetPendingEntries,
      util::Status(std::vector<EntryHandle<LoggedEntry>>* entries));

  MOCK_CONST_METHOD1_T(
      GetSequenceMapping,
      util::Status(EntryHandle<ct::SequenceMapping>* mapping));

  MOCK_METHOD1_T(UpdateSequenceMapping,
                 util::Status(EntryHandle<ct::SequenceMapping>* mapping));

  MOCK_CONST_METHOD0_T(GetClusterNodeState,
                       util::StatusOr<ct::ClusterNodeState>());

  MOCK_METHOD1_T(SetClusterNodeState,
                 util::Status(const ct::ClusterNodeState& state));

  MOCK_METHOD2_T(WatchServingSTH,
                 void(const ConsistentStore::ServingSTHCallback& cb,
                      util::Task* task));

  MOCK_METHOD2_T(WatchClusterNodeStates,
                 void(const ConsistentStore::ClusterNodeStateCallback& cb,
                      util::Task* task));

  MOCK_METHOD2_T(WatchClusterConfig,
                 void(const ConsistentStore::ClusterConfigCallback& cb,
                      util::Task* task));

  MOCK_METHOD1(SetClusterConfig, util::Status(const ct::ClusterConfig&));

  MOCK_METHOD0(CleanupOldEntries, util::StatusOr<int64_t>());
};

}  // namespace cert_log


#endif  // CERT_TRANS_LOG_MOCK_CONSISTENT_STORE_H_