2019-03-23 21:53:14 +00:00
|
|
|
#ifndef MOCK_AUTHENTICATOR_H
|
|
|
|
#define MOCK_AUTHENTICATOR_H
|
|
|
|
|
|
|
|
#include <gmock/gmock.h>
|
2019-03-26 22:04:53 +00:00
|
|
|
#include "webfuse/adapter/impl/authenticator.h"
|
2019-03-23 21:53:14 +00:00
|
|
|
|
2019-03-26 22:04:53 +00:00
|
|
|
namespace webfuse_test
|
2019-03-23 21:53:14 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
class Authenticator
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~Authenticator() { }
|
|
|
|
virtual bool authenticate(
|
2020-06-10 20:18:34 +00:00
|
|
|
struct wf_credentials const * credentials,
|
2019-03-23 21:53:14 +00:00
|
|
|
void * user_data) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
class MockAuthenticator: public Authenticator
|
|
|
|
{
|
|
|
|
public:
|
2020-06-10 20:18:34 +00:00
|
|
|
MOCK_METHOD2(authenticate, bool (struct wf_credentials const * credentials, void * user_data));
|
2019-03-23 21:53:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void set_authenticator(Authenticator * authenticator);
|
|
|
|
void set_authenticator(size_t index, Authenticator * authenticator);
|
|
|
|
|
2020-06-10 20:18:34 +00:00
|
|
|
bool authenticate(struct wf_credentials const * creds, void * user_data);
|
|
|
|
bool authenticate_1(struct wf_credentials const * creds, void * user_data);
|
|
|
|
bool authenticate_2(struct wf_credentials const * creds, void * user_data);
|
2019-03-23 21:53:14 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|