2 Copyright (c) 2018-2019 Nokia.
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
8 http://www.apache.org/licenses/LICENSE-2.0
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
17 #ifndef SHAREDDATALAYER_TST_HIREDISCLUSTERSYSTEMMOCK_HPP_
18 #define SHAREDDATALAYER_TST_HIREDISCLUSTERSYSTEMMOCK_HPP_
20 #include <gmock/gmock.h>
21 #include "private/redis/hiredisclustersystem.hpp"
23 namespace shareddatalayer
27 class HiredisClusterSystemMock: public redis::HiredisClusterSystem
30 MOCK_METHOD2(redisClusterAsyncConnect, redisClusterAsyncContext*(const char* addrs, int flags));
32 MOCK_METHOD2(redisClusterAsyncSetConnectCallback, int(redisClusterAsyncContext* acc,
33 redisClusterInstanceConnectCallback* fn));
35 MOCK_METHOD2(redisClusterAsyncSetDisconnectCallback, int(redisClusterAsyncContext* acc,
36 redisClusterInstanceDisconnectCallback* fn));
38 MOCK_METHOD6(redisClusterAsyncCommandArgv, int(redisClusterAsyncContext* acc, redisClusterCallbackFn* fn,
39 void* privdata, int argc, const char** argv,
40 const size_t* argvlen));
42 MOCK_METHOD8(redisClusterAsyncCommandArgvWithKey, int(redisClusterAsyncContext *acc,
43 redisClusterCallbackFn *fn,
44 void *privdata, const char *key, int keylen, int argc,
45 const char **argv, const size_t *argvlen));
47 MOCK_METHOD1(redisAsyncHandleRead, void(redisAsyncContext* ac));
49 MOCK_METHOD1(redisAsyncHandleWrite, void(redisAsyncContext* ac));
51 MOCK_METHOD1(redisClusterAsyncDisconnect, void(redisClusterAsyncContext* acc));
53 MOCK_METHOD1(redisClusterAsyncFree, void(redisClusterAsyncContext* acc));