1 /* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /*
3  *     Copyright 2018 Couchbase, Inc.
4  *
5  *   Licensed under the Apache License, Version 2.0 (the "License");
6  *   you may not use this file except in compliance with the License.
7  *   You may obtain a copy of the License at
8  *
9  *       http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *   Unless required by applicable law or agreed to in writing, software
12  *   distributed under the License is distributed on an "AS IS" BASIS,
13  *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *   See the License for the specific language governing permissions and
15  *   limitations under the License.
16  */
17 
18 #pragma once
19 
20 #include "ephemeral_bucket.h"
21 
22 /*
23  * Mock of the EphemeralBucket class.
24  */
25 class MockEphemeralBucket : public EphemeralBucket {
26 public:
MockEphemeralBucket(EventuallyPersistentEngine& theEngine)27     MockEphemeralBucket(EventuallyPersistentEngine& theEngine)
28         : EphemeralBucket(theEngine) {
29     }
30 
31     VBucketPtr makeVBucket(Vbid id,
32                            vbucket_state_t state,
33                            KVShard* shard,
34                            std::unique_ptr<FailoverTable> table,
35                            NewSeqnoCallback newSeqnoCb,
36                            std::unique_ptr<Collections::VB::Manifest> manifest,
37                            vbucket_state_t initState,
38                            int64_t lastSeqno,
39                            uint64_t lastSnapStart,
40                            uint64_t lastSnapEnd,
41                            uint64_t purgeSeqno,
42                            uint64_t maxCas,
43                            int64_t hlcEpochSeqno,
44                            bool mightContainXattrs,
45                            const nlohmann::json& replicationTopology,
46                            uint64_t maxVisibleSeqno) override;
47 
48     void setDurabilityCompletionTask(
49             std::shared_ptr<DurabilityCompletionTask> task);
50 };
51