Add Sentinel configuration reading
[ric-plt/sdl.git] / include / private / tst / databaseconfigurationmock.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_DATABASECONFIGURATIONMOCK_HPP_
18 #define SHAREDDATALAYER_DATABASECONFIGURATIONMOCK_HPP_
19
20 #include "private/databaseconfiguration.hpp"
21
22 namespace shareddatalayer
23 {
24     namespace tst
25     {
26         class DatabaseConfigurationMock: public DatabaseConfiguration
27         {
28         public:
29             MOCK_METHOD1(checkAndApplyDbType, void(const std::string& type));
30             MOCK_METHOD1(checkAndApplyServerAddress, void(const std::string& address));
31             MOCK_METHOD1(checkAndApplySentinelAddress, void(const std::string& address));
32             MOCK_METHOD1(checkAndApplySentinelMasterName, void(const std::string& name));
33             MOCK_CONST_METHOD0(getDbType, DatabaseConfiguration::DbType());
34             MOCK_CONST_METHOD0(getServerAddresses, DatabaseConfiguration::Addresses());
35             MOCK_CONST_METHOD0(getDefaultServerAddresses, DatabaseConfiguration::Addresses());
36             MOCK_CONST_METHOD0(isEmpty, bool());
37             MOCK_CONST_METHOD0(getSentinelAddress, boost::optional<HostAndPort>());
38             MOCK_CONST_METHOD0(getSentinelMasterName, std::string());
39         };
40     }
41 }
42
43 #endif