AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
MockContextManager.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_AVSCOMMON_SDKINTERFACES_TEST_AVSCOMMON_SDKINTERFACES_MOCKCONTEXTMANAGER_H_
17 #define ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_TEST_AVSCOMMON_SDKINTERFACES_MOCKCONTEXTMANAGER_H_
18 
20 #include <gmock/gmock.h>
21 
22 namespace alexaClientSDK {
23 namespace avsCommon {
24 namespace sdkInterfaces {
25 namespace test {
26 
29 public:
30  MOCK_METHOD0(doShutdown, void());
33  void(const avs::CapabilityTag& namespaceAndName, std::shared_ptr<StateProviderInterface> stateProvider));
35  setState,
37  const avs::CapabilityTag& namespaceAndName,
38  const std::string& jsonState,
39  const avs::StateRefreshPolicy& refreshPolicy,
40  const unsigned int stateRequestToken));
42  getContext,
44  std::shared_ptr<ContextRequesterInterface>,
45  const std::string&,
46  const std::chrono::milliseconds&));
50  std::shared_ptr<ContextRequesterInterface>,
51  const std::string&,
52  const std::chrono::milliseconds&));
55  void(
56  const avs::CapabilityTag& capabilityIdentifier,
57  const avs::CapabilityState& capabilityState,
61  void(
62  const avsCommon::avs::CapabilityTag& capabilityIdentifier,
63  const avsCommon::avs::CapabilityState& capabilityState,
64  const unsigned int stateRequestToken));
67  void(
68  const avsCommon::avs::CapabilityTag& capabilityIdentifier,
69  const unsigned int stateRequestToken,
70  bool isEndpointUnreachable));
71  MOCK_METHOD1(addContextManagerObserver, void(std::shared_ptr<ContextManagerObserverInterface> observer));
72  MOCK_METHOD1(removeContextManagerObserver, void(const std::shared_ptr<ContextManagerObserverInterface>& observer));
75  void(
76  const avsCommon::avs::CapabilityTag& capabilityIdentifier,
77  std::shared_ptr<avsCommon::sdkInterfaces::StateProviderInterface> stateProvider));
78  MOCK_METHOD1(removeStateProvider, void(const avs::CapabilityTag& capabilityIdentifier));
79 };
80 
81 } // namespace test
82 } // namespace sdkInterfaces
83 } // namespace avsCommon
84 } // namespace alexaClientSDK
85 
86 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_SDKINTERFACES_TEST_AVSCOMMON_SDKINTERFACES_MOCKCONTEXTMANAGER_H_
MOCK_METHOD3(getContext, ContextRequestToken(std::shared_ptr< ContextRequesterInterface >, const std::string &, const std::chrono::milliseconds &))
virtual void provideStateUnavailableResponse(const avs::CapabilityTag &capabilityIdentifier, ContextRequestToken stateRequestToken, bool isEndpointUnreachable)=0
virtual void setStateProvider(const avs::CapabilityTag &capabilityIdentifier, std::shared_ptr< StateProviderInterface > stateProvider)=0
virtual void provideStateResponse(const avs::CapabilityTag &capabilityIdentifier, const avs::CapabilityState &capabilityState, ContextRequestToken stateRequestToken)=0
SetStateResult
Definition: ContextManagerInterface.h:39
Definition: CapabilityTag.h:32
virtual ContextRequestToken getContext(std::shared_ptr< ContextRequesterInterface > contextRequester, const std::string &endpointId="", const std::chrono::milliseconds &timeout=std::chrono::seconds(2))=0
Definition: AmdMetricWrapperTest.cpp:24
::std::string string
Definition: gtest-port.h:1097
virtual ContextRequestToken getContextWithoutReportableStateProperties(std::shared_ptr< ContextRequesterInterface > contextRequester, const std::string &endpointId="", const std::chrono::milliseconds &timeout=std::chrono::seconds(2))=0
StateRefreshPolicy
Definition: StateRefreshPolicy.h:31
unsigned int ContextRequestToken
Alias for the token used to identify a context request.
Definition: ContextRequestToken.h:23
AlexaStateChangeCauseType
Definition: AlexaStateChangeCauseType.h:28
virtual void addStateProvider(const avsCommon::avs::CapabilityTag &capabilityIdentifier, std::shared_ptr< avsCommon::sdkInterfaces::StateProviderInterface > stateProvider)=0
virtual void reportStateChange(const avs::CapabilityTag &capabilityIdentifier, const avs::CapabilityState &capabilityState, AlexaStateChangeCauseType cause)=0
virtual void removeStateProvider(const avs::CapabilityTag &capabilityIdentifier)=0
virtual void removeContextManagerObserver(const std::shared_ptr< ContextManagerObserverInterface > &observer)=0
MOCK_METHOD4(setState, SetStateResult(const avs::CapabilityTag &namespaceAndName, const std::string &jsonState, const avs::StateRefreshPolicy &refreshPolicy, const unsigned int stateRequestToken))
Definition: CapabilityState.h:31
MOCK_METHOD1(addContextManagerObserver, void(std::shared_ptr< ContextManagerObserverInterface > observer))
virtual SetStateResult setState(const avs::CapabilityTag &capabilityIdentifier, const std::string &jsonState, const avs::StateRefreshPolicy &refreshPolicy, const ContextRequestToken stateRequestToken=0)=0
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
Mock class that implements the ContextManager.
Definition: MockContextManager.h:28
MOCK_METHOD2(setStateProvider, void(const avs::CapabilityTag &namespaceAndName, std::shared_ptr< StateProviderInterface > stateProvider))
virtual void addContextManagerObserver(std::shared_ptr< ContextManagerObserverInterface > observer)=0

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