10Duke Scale C++ Client
Loading...
Searching...
No Matches
OIDCSessionMock.h
1#ifndef TENDUKE_TEST_MOCKS_OIDCSESSIONMOCK_H
2#define TENDUKE_TEST_MOCKS_OIDCSESSIONMOCK_H
3
4#include "oidc/session/OIDCSession.h"
5
6#include "gmock/gmock.h"
7
8namespace tenduke { namespace test { namespace mocks {
9
11{
12public:
13 MOCK_METHOD(void, ensureValidSession, (), (override));
14 MOCK_METHOD(std::string, getAccessToken, (), (override));
15 MOCK_METHOD((std::shared_ptr<const tenduke::oidc::OIDCState>), getOIDCState, (), (override));
16 MOCK_METHOD(bool, heartbeat, (), (override));
17 MOCK_METHOD(void, invalidate, (), (override));
18 MOCK_METHOD(bool, isValid, (), (override));
19 MOCK_METHOD(void, refresh, (), (override));
20 MOCK_METHOD(void, reEstablish, (), (override));
21
22 static std::shared_ptr<OIDCSessionMock> createShared()
23 {
24 return std::make_shared<OIDCSessionMock>();
25 }
26};
27
28}}}
29
30
31
32#endif //TENDUKE_TEST_MOCKS_OIDCSESSIONMOCK_H
Stateful service to manage OIDC-session.
Definition OIDCSession.h:23
virtual void ensureValidSession()=0
Checks that the OIDC session is valid, but if it is NOT, either refreshes the access token or authent...
virtual bool heartbeat()=0
Executes a heartbeat with the backend, checking that the current access token really works.
virtual std::shared_ptr< const tenduke::oidc::OIDCState > getOIDCState()=0
Returns the current OIDC-state for inspection.
virtual void reEstablish()=0
Re-establishes the session: Tries first to refresh the state, if it fails, re-authenticates the user.
virtual void invalidate()=0
Invalidates the session.
virtual bool isValid()=0
Checks that local session is valid.
virtual std::string getAccessToken()=0
Returns access token of the session.
virtual void refresh()=0
Forces refresh of the session.
Definition OIDCSessionMock.h:11
Root for classes, functions and globals of 10Duke C++ Client.
Definition BackendConfiguration.h:7