AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
AuthDelegateTestContext.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ALEXA_CLIENT_SDK_INTEGRATION_INCLUDE_INTEGRATION_AUTHDELEGATETESTCONTEXT_H_
17 #define ALEXA_CLIENT_SDK_INTEGRATION_INCLUDE_INTEGRATION_AUTHDELEGATETESTCONTEXT_H_
18 
19 #include <memory>
20 #include <string>
21 
22 #include <gtest/gtest.h>
23 
27 #ifdef ACSDK_ACS_UTILS
28 #include <acsdkFFSAuthDelegate/FFSAuthRequesterInterface.h>
29 #else
31 #endif
34 
37 
38 namespace alexaClientSDK {
39 namespace integration {
40 namespace test {
41 
47 public:
62  static std::unique_ptr<AuthDelegateTestContext> create(
63  const std::string& filePath,
64  const std::string& overlay = "");
65 
70 
76  bool isValid() const;
77 
83  std::shared_ptr<avsCommon::sdkInterfaces::AuthDelegateInterface> getAuthDelegate() const;
84 
90  std::shared_ptr<registrationManager::CustomerDataManagerInterface> getCustomerDataManager() const;
91 
92 private:
93 #ifdef ACSDK_ACS_UTILS
94  class AuthRequester : public acsdkffsAuthDelegate::FFSAuthRequesterInterface {
95  public:
96  void onRequestFFS() override;
97  };
98 #else
99 
103  class AuthRequester : public authorization::cblAuthDelegate::CBLAuthRequesterInterface {
104  public:
107  void onRequestAuthorization(const std::string& url, const std::string& code) override;
108  void onCheckingForAuthorization() override;
110  };
111 #endif
112 
118  AuthDelegateTestContext(const std::string& filePath, const std::string& overlay = "");
119 
121  std::unique_ptr<SDKTestContext> m_sdkTestContext;
122 
124  std::shared_ptr<avsCommon::sdkInterfaces::AuthDelegateInterface> m_authDelegate;
125 
127  std::shared_ptr<registrationManager::CustomerDataManagerInterface> m_customerDataManager;
128 };
129 
130 } // namespace test
131 } // namespace integration
132 } // namespace alexaClientSDK
133 
134 #endif // ALEXA_CLIENT_SDK_INTEGRATION_INCLUDE_INTEGRATION_AUTHDELEGATETESTCONTEXT_H_
alexaClientSDK::integration::test::AuthDelegateTestContext::isValid
bool isValid() const
Definition: AuthDelegateTestContext.cpp:74
ContextManager.h
alexaClientSDK::authorization::cblAuthDelegate::CBLAuthRequesterInterface
Definition: CBLAuthRequesterInterface.h:28
CustomerDataManagerInterface.h
test
Definition: AmdMetricWrapperTest.cpp:24
ConnectionStatusObserver.h
MessageRouter.h
CBLAuthRequesterInterface.h
alexaClientSDK::integration::test::AuthDelegateTestContext
Definition: AuthDelegateTestContext.h:46
AttachmentManager.h
alexaClientSDK::integration::test::AuthDelegateTestContext::create
static std::unique_ptr< AuthDelegateTestContext > create(const std::string &filePath, const std::string &overlay="")
Definition: AuthDelegateTestContext.cpp:46
alexaClientSDK
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
AuthDelegateInterface.h
alexaClientSDK::integration::test::AuthDelegateTestContext::getAuthDelegate
std::shared_ptr< avsCommon::sdkInterfaces::AuthDelegateInterface > getAuthDelegate() const
Definition: AuthDelegateTestContext.cpp:78
alexaClientSDK::integration::test::AuthDelegateTestContext::getCustomerDataManager
std::shared_ptr< registrationManager::CustomerDataManagerInterface > getCustomerDataManager() const
Definition: AuthDelegateTestContext.cpp:82
alexaClientSDK::integration::test::AuthDelegateTestContext::~AuthDelegateTestContext
~AuthDelegateTestContext()
Definition: AuthDelegateTestContext.cpp:56
SDKTestContext.h

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