4fad0b9df50a973c853b8f7a594d2e7565a2498a
[ric-plt/sdl.git] / include / private / tst / hiredisclustersystemmock.hpp
1 /*
2    Copyright (c) 2018-2019 Nokia.
3
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
7
8        http://www.apache.org/licenses/LICENSE-2.0
9
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.
15 */
16
17 #ifndef SHAREDDATALAYER_TST_HIREDISCLUSTERSYSTEMMOCK_HPP_
18 #define SHAREDDATALAYER_TST_HIREDISCLUSTERSYSTEMMOCK_HPP_
19
20 #include <gmock/gmock.h>
21 #include "private/redis/hiredisclustersystem.hpp"
22
23 namespace shareddatalayer
24 {
25     namespace tst
26     {
27         class HiredisClusterSystemMock: public redis::HiredisClusterSystem
28         {
29         public:
30             MOCK_METHOD2(redisClusterAsyncConnect, redisClusterAsyncContext*(const char* addrs, int flags));
31
32             MOCK_METHOD2(redisClusterAsyncSetConnectCallback, int(redisClusterAsyncContext* acc,
33                                                                   redisClusterInstanceConnectCallback* fn));
34
35             MOCK_METHOD2(redisClusterAsyncSetDisconnectCallback, int(redisClusterAsyncContext* acc,
36                                                                      redisClusterInstanceDisconnectCallback* fn));
37
38             MOCK_METHOD6(redisClusterAsyncCommandArgv, int(redisClusterAsyncContext* acc, redisClusterCallbackFn* fn,
39                                                            void* privdata, int argc, const char** argv,
40                                                            const size_t* argvlen));
41
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));
46
47             MOCK_METHOD1(redisAsyncHandleRead, void(redisAsyncContext* ac));
48
49             MOCK_METHOD1(redisAsyncHandleWrite, void(redisAsyncContext* ac));
50
51             MOCK_METHOD1(redisClusterAsyncDisconnect, void(redisClusterAsyncContext* acc));
52
53             MOCK_METHOD1(redisClusterAsyncFree, void(redisClusterAsyncContext* acc));
54         };
55     }
56 }
57
58 #endif
59