This repository has been archived on 2026-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
powersync-remoteproxy/tests/mockauthenticator.h
2018-08-04 13:54:30 +02:00

31 lines
705 B
C++

#ifndef MOCKAUTHENTICATOR_H
#define MOCKAUTHENTICATOR_H
#include <QTimer>
#include <QObject>
#include "authentication/authenticator.h"
class MockAuthenticator : public Authenticator
{
Q_OBJECT
public:
explicit MockAuthenticator(QObject *parent = nullptr);
void setTimeoutDuration(int timeout);
void setExpectedAuthenticationError(Authenticator::AuthenticationError error);
private:
QTimer * m_timer = nullptr;
int m_timeoutDuration = 1000;
Authenticator::AuthenticationError m_expectedError;
private slots:
void onTimeout();
public slots:
AuthenticationReply *authenticate(const QUuid &clientId, const QString &token) override;
};
#endif // MOCKAUTHENTICATOR_H