AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
MockHTTP2Request.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_ACL_TEST_TRANSPORT_MOCKHTTP2REQUEST_H_
17 #define ALEXA_CLIENT_SDK_ACL_TEST_TRANSPORT_MOCKHTTP2REQUEST_H_
18 
19 #include <memory>
20 #include <string>
21 
22 #include <gmock/gmock.h>
23 #include <gtest/gtest.h>
24 
28 
29 #include "MockMimeResponseSink.h"
30 
31 namespace alexaClientSDK {
32 namespace avsCommon {
33 namespace utils {
34 namespace http2 {
35 namespace test {
36 
41 public:
43  MOCK_METHOD0(cancel, bool());
44  MOCK_CONST_METHOD0(getId, std::string());
45 
51  const std::string getUrl();
52 
58  std::shared_ptr<HTTP2RequestSourceInterface> getSource();
59 
65  std::shared_ptr<HTTP2ResponseSinkInterface> getSink();
66 
73 
79  std::shared_ptr<acl::test::MockMimeResponseSink> getMimeResponseSink();
80 
86  std::shared_ptr<HTTP2MimeResponseDecoder> getMimeDecoder();
87 
88 private:
90  const std::string m_url;
91 
93  std::shared_ptr<HTTP2RequestSourceInterface> m_source;
94 
96  std::shared_ptr<HTTP2ResponseSinkInterface> m_sink;
97 
99  HTTP2RequestType m_type;
100 
102  std::shared_ptr<acl::test::MockMimeResponseSink> m_mimeResponseSink;
103 
105  std::shared_ptr<HTTP2MimeResponseDecoder> m_mimeDecoder;
106 };
107 
108 } // namespace test
109 } // namespace http2
110 } // namespace utils
111 } // namespace avsCommon
112 } // namespace alexaClientSDK
113 
114 #endif /* ALEXA_CLIENT_SDK_ACL_TEST_TRANSPORT_MOCKHTTP2REQUEST_H_ */
alexaClientSDK::avsCommon::utils::http2::test::MockHTTP2Request::getRequestType
HTTP2RequestType getRequestType()
Definition: MockHTTP2Request.cpp:45
alexaClientSDK::avsCommon::utils::http2::HTTP2RequestType
HTTP2RequestType
Definition: HTTP2RequestType.h:29
alexaClientSDK::avsCommon::utils::http2::test::MockHTTP2Request
Definition: MockHTTP2Request.h:40
MockMimeResponseSink.h
alexaClientSDK::avsCommon::utils::http2::test::MockHTTP2Request::MOCK_CONST_METHOD0
MOCK_CONST_METHOD0(getId, std::string())
alexaClientSDK::avsCommon::utils::http2::HTTP2RequestInterface::getId
virtual std::string getId() const =0
alexaClientSDK::avsCommon::utils::http2::HTTP2RequestConfig
Definition: HTTP2RequestConfig.h:42
alexaClientSDK::avsCommon::utils::http2::test::MockHTTP2Request::getSink
std::shared_ptr< HTTP2ResponseSinkInterface > getSink()
Definition: MockHTTP2Request.cpp:41
alexaClientSDK::avsCommon::utils::http2::HTTP2RequestInterface
Definition: HTTP2RequestInterface.h:32
alexaClientSDK::avsCommon::utils::http2::test::MockHTTP2Request::getSource
std::shared_ptr< HTTP2RequestSourceInterface > getSource()
Definition: MockHTTP2Request.cpp:37
test
Definition: AmdMetricWrapperTest.cpp:24
HTTP2MimeResponseDecoder.h
alexaClientSDK::avsCommon::utils::http2::test::MockHTTP2Request::getMimeDecoder
std::shared_ptr< HTTP2MimeResponseDecoder > getMimeDecoder()
Definition: MockHTTP2Request.cpp:53
alexaClientSDK::avsCommon::utils::http2::test::MockHTTP2Request::getMimeResponseSink
std::shared_ptr< acl::test::MockMimeResponseSink > getMimeResponseSink()
Definition: MockHTTP2Request.cpp:49
HTTP2RequestInterface.h
alexaClientSDK::avsCommon::utils::http2::test::MockHTTP2Request::MOCK_METHOD0
MOCK_METHOD0(cancel, bool())
alexaClientSDK
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
alexaClientSDK::avsCommon::utils::http2::test::MockHTTP2Request::getUrl
const std::string getUrl()
Definition: MockHTTP2Request.cpp:33
alexaClientSDK::avsCommon::utils::http2::HTTP2RequestInterface::cancel
virtual bool cancel()=0
alexaClientSDK::avsCommon::utils::http2::test::MockHTTP2Request::MockHTTP2Request
MockHTTP2Request(const alexaClientSDK::avsCommon::utils::http2::HTTP2RequestConfig &config)
Definition: MockHTTP2Request.cpp:24
HTTP2RequestConfig.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