2020-03-15 20:48:45 +00:00
|
|
|
#ifndef WFD_MOCK_CONFIG_BUILDER_HPP
|
|
|
|
#define WFD_MOCK_CONFIG_BUILDER_HPP
|
|
|
|
|
|
|
|
#include <gmock/gmock.h>
|
|
|
|
#include "webfused/config/builder.h"
|
|
|
|
|
|
|
|
namespace webfused_test
|
|
|
|
{
|
|
|
|
|
|
|
|
class IConfigBuilder
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~IConfigBuilder() = default;
|
|
|
|
virtual void setServerVhostname(char const * vhostname) = 0;
|
|
|
|
virtual void setServerPort(int port) = 0;
|
|
|
|
virtual void setServerKey(char const * key_path) = 0;
|
|
|
|
virtual void setServerCert(char const * cert_path) = 0;
|
|
|
|
virtual void setServerDocumentRoot(char const * document_root) = 0;
|
2020-03-18 09:17:17 +00:00
|
|
|
virtual bool addAuthProvider(char const * provider, wfd_settings * settings) = 0;
|
2020-03-17 20:51:04 +00:00
|
|
|
virtual bool addFilesystem(char const * name, char const * mountpoint) = 0;
|
2020-03-18 16:33:31 +00:00
|
|
|
virtual bool setLogger(char const * provider, int level, wfd_settings * settings) = 0;
|
2020-03-19 11:42:47 +00:00
|
|
|
virtual void setUser(char const * user, char const * group) = 0;
|
2020-03-15 20:48:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class MockConfigBuilder: public IConfigBuilder
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
~MockConfigBuilder() override = default;
|
|
|
|
MOCK_METHOD1(setServerVhostname, void (char const * vhostname));
|
|
|
|
MOCK_METHOD1(setServerPort, void (int port));
|
|
|
|
MOCK_METHOD1(setServerKey, void (char const * key_path));
|
|
|
|
MOCK_METHOD1(setServerCert, void (char const * cert_path));
|
|
|
|
MOCK_METHOD1(setServerDocumentRoot, void (char const * document_root));
|
2020-03-18 09:17:17 +00:00
|
|
|
MOCK_METHOD2(addAuthProvider, bool (char const * provider, wfd_settings * settings));
|
2020-03-17 20:51:04 +00:00
|
|
|
MOCK_METHOD2(addFilesystem, bool (char const * name, char const * mountpoint));
|
2020-03-18 16:33:31 +00:00
|
|
|
MOCK_METHOD3(setLogger, bool (char const * provider, int level, wfd_settings * settings));
|
2020-03-19 11:42:47 +00:00
|
|
|
MOCK_METHOD2(setUser, void (char const * user, char const * group));
|
2020-03-15 20:48:45 +00:00
|
|
|
|
|
|
|
struct wfd_config_builder getBuilder();
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|