AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Namespaces | Functions | Variables
AuthorizationManagerTest.cpp File Reference
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <AVSCommon/SDKInterfaces/Storage/StubMiscStorage.h>
#include <AVSCommon/SDKInterfaces/MockAuthObserver.h>
#include <AVSCommon/Utils/WaitEvent.h>
#include <acsdkAuthorization/AuthorizationManager.h>
#include <acsdkAuthorizationInterfaces/AuthorizationAdapterInterface.h>
#include <RegistrationManager/RegistrationManagerInterface.h>
#include <RegistrationManager/MockCustomerDataManager.h>
Include dependency graph for AuthorizationManagerTest.cpp:

Classes

class  alexaClientSDK::acsdkAuthorization::test::StubAuthorization
 Class to implement AuthorizationInterface, which is used to retrieve the id. More...
 
class  alexaClientSDK::acsdkAuthorization::test::MockRegistrationManager
 Mock class implementing RegistrationManagerInterface. More...
 
class  alexaClientSDK::acsdkAuthorization::test::MockAuthorizationAdapter
 Mock class implementing the adapter. More...
 
class  alexaClientSDK::acsdkAuthorization::test::AuthorizationManagerTest
 

Namespaces

 alexaClientSDK
 Whether or not curl logs should be emitted.
 
 alexaClientSDK::acsdkAuthorization
 
 alexaClientSDK::acsdkAuthorization::test
 

Functions

 alexaClientSDK::acsdkAuthorization::test::TEST_F (AuthorizationManagerTest, test_create_Succeeds)
 Test that create succeeds. More...
 
 alexaClientSDK::acsdkAuthorization::test::TEST_F (AuthorizationManagerTest, test_createNullParam_Fails)
 Test that create with null param results in nullptr. More...
 
 alexaClientSDK::acsdkAuthorization::test::TEST_F (AuthorizationManagerTest, test_authorizingState_DoesNotPersist)
 Test that in the AUTHORIZING state, auth and user id are not persisted. More...
 
 alexaClientSDK::acsdkAuthorization::test::TEST_F (AuthorizationManagerTest, test_authorizingState_NoToken)
 Test that in the AUTHORIZING state, the getToken calls no-op. More...
 
 alexaClientSDK::acsdkAuthorization::test::TEST_F (AuthorizationManagerTest, test_refreshedState_Persisted)
 Check that in the REFRESHED state, the token is now valid as well as adapter id and user id are persisted. More...
 
 alexaClientSDK::acsdkAuthorization::test::TEST_F (AuthorizationManagerTest, test_unrecoverableError_Success)
 Check the behavior if AuthorizationManager is in the UNRECOVERABLE_ERROR state. More...
 
 alexaClientSDK::acsdkAuthorization::test::TEST_F (AuthorizationManagerTest, test_invalidStateTransition_NoNotification)
 Check invalid transitions. More...
 
 alexaClientSDK::acsdkAuthorization::test::TEST_F (AuthorizationManagerTest, test_getState)
 Check that getState returns the correct thing. More...
 
 alexaClientSDK::acsdkAuthorization::test::TEST_F (AuthorizationManagerTest, test_activeAuthorization_Success)
 Check that the active authorization returns the correct id. More...
 
 alexaClientSDK::acsdkAuthorization::test::TEST_F (AuthorizationManagerTest, test_logout)
 Check that logout succeeds. More...
 
 alexaClientSDK::acsdkAuthorization::test::INSTANTIATE_TEST_CASE_P (Parameterized, AuthorizationManagerTest, ::testing::Values(std::pair< std::string, std::string >(ADAPTER_ID, USER_ID_2), std::pair< std::string, std::string >(ADAPTER_ID_2, USER_ID), std::pair< std::string, std::string >(ADAPTER_ID_2, USER_ID_2)))
 Parameterized Tests to test combinations of mismatched adapter and user ids. More...
 
 alexaClientSDK::acsdkAuthorization::test::TEST_P (AuthorizationManagerTest, test_mismatchingIdRefreshed_AuthorizingRequest_ImplictLogout)
 Check the implict logout behavior if AuthorizationManager is in the REFRESHED state. More...
 
 alexaClientSDK::acsdkAuthorization::test::TEST_P (AuthorizationManagerTest, test_mismatchingIdAuthorizing_AuthorizingRequest_ImplictLogout)
 
 alexaClientSDK::acsdkAuthorization::test::TEST_P (AuthorizationManagerTest, test_mismatchingId_RefreshingRequest_Logout)
 

Variables

std::chrono::milliseconds alexaClientSDK::acsdkAuthorization::test::TIMEOUT {2000}
 Timeout for test cases that require synchronization. More...
 
static const std::string alexaClientSDK::acsdkAuthorization::test::ADAPTER_ID = "test-adapter"
 
static const std::string alexaClientSDK::acsdkAuthorization::test::USER_ID = "test-user-id"
 
static const std::string alexaClientSDK::acsdkAuthorization::test::AUTH_TOKEN = "supersecureauthotoken"
 
static const std::string alexaClientSDK::acsdkAuthorization::test::ADAPTER_ID_2 = ADAPTER_ID + "2"
 
static const std::string alexaClientSDK::acsdkAuthorization::test::USER_ID_2 = USER_ID + "2"
 
static const std::string alexaClientSDK::acsdkAuthorization::test::AUTH_TOKEN_2 = AUTH_TOKEN + "2"
 
static const std::string alexaClientSDK::acsdkAuthorization::test::MISC_TABLE_COMPONENT_NAME = "AuthorizationManager"
 
static const std::string alexaClientSDK::acsdkAuthorization::test::MISC_TABLE_TABLE_NAME = "authorizationState"
 
static const std::string alexaClientSDK::acsdkAuthorization::test::MISC_TABLE_ADAPTER_ID_KEY = "authAdapterId"
 
static const std::string alexaClientSDK::acsdkAuthorization::test::MISC_TABLE_USER_ID_KEY = "userId"
 

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