10Duke Scale C++ Client
Loading...
Searching...
No Matches
tenduke::test::mocks::OAuthTokenRequestFake Class Reference
Inheritance diagram for tenduke::test::mocks::OAuthTokenRequestFake:
tenduke::oauth::OAuthTokenRequest

Public Member Functions

 OAuthTokenRequestFake (const std::shared_ptr< tenduke::oauth::OAuthTokenResponse > &response)
 
std::unique_ptr< tenduke::oauth::OAuthTokenResponseexecute () const override
 Executes the token request.
 
- Public Member Functions inherited from tenduke::oauth::OAuthTokenRequest
 OAuthTokenRequest (std::unique_ptr< tenduke::http::HTTPCall > httpCall, const std::shared_ptr< const tenduke::json::JSONParser > &jsonParser, const std::shared_ptr< tenduke::time::Clock > &clock, const std::shared_ptr< const tenduke::http::HTTPResponseToException > &throwException)
 Constructs new instance.
 
 OAuthTokenRequest (std::unique_ptr< tenduke::http::HTTPCall > httpCall, const std::shared_ptr< const tenduke::json::JSONParser > &jsonParser, const std::shared_ptr< tenduke::time::Clock > &clock)
 Constructs new instance.
 

Public Attributes

std::shared_ptr< tenduke::oauth::OAuthTokenResponseresponse
 

Additional Inherited Members

- Static Public Member Functions inherited from tenduke::oauth::OAuthTokenRequest
static std::unique_ptr< OAuthTokenRequestcreate (const std::string &tokenEndpointUrl, const std::map< std::string, std::string > &parameters, const std::shared_ptr< const tenduke::http::HTTPClient > &httpClient, const std::shared_ptr< const tenduke::json::JSONParser > &jsonParser, const std::shared_ptr< tenduke::time::Clock > &clock)
 Factory method to create the request.
 
- Protected Member Functions inherited from tenduke::oauth::OAuthTokenRequest
virtual std::unique_ptr< tenduke::json::JSONObjectparseResponseBody (const std::string &responsePayload) const
 Parses the response body to JSON.
 
virtual std::unique_ptr< tenduke::oauth::OAuthTokenResponsetoResponse (const std::string &responsePayload) const
 Converts the response body to OAuthTokenResponse.
 

Member Function Documentation

◆ execute()

std::unique_ptr< tenduke::oauth::OAuthTokenResponse > tenduke::test::mocks::OAuthTokenRequestFake::execute ( ) const
inlineoverridevirtual

Executes the token request.

Exceptions
tenduke::oauth::OAuthServerErrorwhen the server responds with an error
tenduke::oauth::OAuthExceptionwhen the server response is not what we expected, e.g.
  • The response does not contain access_token
  • The response payload is not JSON-object
tenduke::json::JSONParsingExceptionwhen response is not valid JSON
tenduke::net::NetworkingException(or subclasses of it) when networking error occurred, e.g.
tenduke::http::HTTPException(or subclasses of it) when the server responds with HTTP error status code which does not indicate OAuth-error, e.g. 500 (internal server error) or 404 (not found = wrong endpoint configured).
std::nested_exceptionwhen the there is some nested cause

Reimplemented from tenduke::oauth::OAuthTokenRequest.


The documentation for this class was generated from the following file: