AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
alexaClientSDK::acsdkAuthorization::lwa::test::LWAAuthorizationAdapterTest Class Reference
Inheritance diagram for alexaClientSDK::acsdkAuthorization::lwa::test::LWAAuthorizationAdapterTest:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::acsdkAuthorization::lwa::test::LWAAuthorizationAdapterTest:
Collaboration graph
[legend]

Public Member Functions

void SetUp () override
 SetUp. More...
 
void setCBLExpectations (HTTPResponse customerProfileResponse)
 
void setCBLExpectations (HTTPResponse codePairResponse, HTTPResponse tokenExchangeResponse, HTTPResponse customerProfileResponse)
 
std::shared_ptr< avsCommon::utils::configuration::ConfigurationNodecreateConfig ()
 

Public Attributes

std::unique_ptr< LWAAuthorizationConfigurationm_lwaConfig
 Create an instance to retrieve constants. More...
 
std::shared_ptr< LWAAuthorizationAdapterm_lwa
 Object under test. More...
 
WaitEvent m_wait
 Used to synchronize in multi-thread test cases. More...
 
MockHttpPostm_httpPost
 
MockHttpGetm_httpGet
 
std::shared_ptr< avsCommon::utils::configuration::ConfigurationNodem_configuration
 
std::shared_ptr< avsCommon::utils::DeviceInfom_deviceInfo
 
std::shared_ptr< acsdkAuthorizationInterfaces::lwa::LWAAuthorizationStorageInterfacem_storage
 
std::shared_ptr< MockCBLObserverm_cblObserver
 
std::shared_ptr< MockAuthManagerm_manager
 

Static Public Attributes

static const HTTPResponse NULL_HTTP_RESPONSE {-1, ""}
 

Detailed Description

This class tests the internals of the LWAAuthorizationAdapter class. Due to the complicated nature of the the APIs, whitebox testing is done.

Member Function Documentation

◆ createConfig()

std::shared_ptr< avsCommon::utils::configuration::ConfigurationNode > alexaClientSDK::acsdkAuthorization::lwa::test::LWAAuthorizationAdapterTest::createConfig ( )

Initialize the configuration node object.

Returns
An initialized configuration node.

◆ setCBLExpectations() [1/2]

void alexaClientSDK::acsdkAuthorization::lwa::test::LWAAuthorizationAdapterTest::setCBLExpectations ( HTTPResponse  customerProfileResponse)

Set expectations against expected responses from LWA using CBL using the following default responses:

CODE_PAIR_RESPONSE TOKEN_EXCHANGE_RESPONSE

Parameters
customerProfileResponseThe customerProfileResponse to use.

◆ setCBLExpectations() [2/2]

void alexaClientSDK::acsdkAuthorization::lwa::test::LWAAuthorizationAdapterTest::setCBLExpectations ( HTTPResponse  codePairResponse,
HTTPResponse  tokenExchangeResponse,
HTTPResponse  customerProfileResponse 
)

Set expectations against expected responses from LWA using CBL with the provided responses. Passing in a value equal to NULL_HTTP_RESPONSE will cause the expectation to be omitted.

Parameters
codePairResponseResponse from a code pair operation.
tokenExchangeResponseResponse from a token exchange operation.
customerProfileResponseResponse form a customer profile operation.

◆ SetUp()

void alexaClientSDK::acsdkAuthorization::lwa::test::LWAAuthorizationAdapterTest::SetUp ( )
override

SetUp.

Member Data Documentation

◆ m_cblObserver

std::shared_ptr<MockCBLObserver> alexaClientSDK::acsdkAuthorization::lwa::test::LWAAuthorizationAdapterTest::m_cblObserver

Mock Objects

◆ m_configuration

std::shared_ptr<avsCommon::utils::configuration::ConfigurationNode> alexaClientSDK::acsdkAuthorization::lwa::test::LWAAuthorizationAdapterTest::m_configuration

Mock Objects

◆ m_deviceInfo

std::shared_ptr<avsCommon::utils::DeviceInfo> alexaClientSDK::acsdkAuthorization::lwa::test::LWAAuthorizationAdapterTest::m_deviceInfo

Mock Objects

◆ m_httpGet

MockHttpGet* alexaClientSDK::acsdkAuthorization::lwa::test::LWAAuthorizationAdapterTest::m_httpGet

Mock Objects

◆ m_httpPost

MockHttpPost* alexaClientSDK::acsdkAuthorization::lwa::test::LWAAuthorizationAdapterTest::m_httpPost

Mock Objects

◆ m_lwa

std::shared_ptr<LWAAuthorizationAdapter> alexaClientSDK::acsdkAuthorization::lwa::test::LWAAuthorizationAdapterTest::m_lwa

Object under test.

◆ m_lwaConfig

std::unique_ptr<LWAAuthorizationConfiguration> alexaClientSDK::acsdkAuthorization::lwa::test::LWAAuthorizationAdapterTest::m_lwaConfig

Create an instance to retrieve constants.

◆ m_manager

std::shared_ptr<MockAuthManager> alexaClientSDK::acsdkAuthorization::lwa::test::LWAAuthorizationAdapterTest::m_manager

Mock Objects

◆ m_storage

std::shared_ptr<acsdkAuthorizationInterfaces::lwa::LWAAuthorizationStorageInterface> alexaClientSDK::acsdkAuthorization::lwa::test::LWAAuthorizationAdapterTest::m_storage

Mock Objects

◆ m_wait

WaitEvent alexaClientSDK::acsdkAuthorization::lwa::test::LWAAuthorizationAdapterTest::m_wait

Used to synchronize in multi-thread test cases.

◆ NULL_HTTP_RESPONSE

const HTTPResponse alexaClientSDK::acsdkAuthorization::lwa::test::LWAAuthorizationAdapterTest::NULL_HTTP_RESPONSE {-1, ""}
static

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

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0