AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
MockMimeResponseSink.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_MOCKMIMERESPONSESINK_H_
17 #define ALEXA_CLIENT_SDK_ACL_TEST_TRANSPORT_MOCKMIMERESPONSESINK_H_
18 
19 #include <vector>
20 
21 #include <gmock/gmock.h>
22 #include <gtest/gtest.h>
23 
25 
26 namespace alexaClientSDK {
27 namespace acl {
28 namespace test {
29 
34 public:
39 
43  virtual ~MockMimeResponseSink() = default;
44 
47  bool onReceiveResponseCode(long responseCode) override;
48  bool onReceiveHeaderLine(const std::string& line) override;
49  bool onBeginMimePart(const std::multimap<std::string, std::string>& headers) override;
50  avsCommon::utils::http2::HTTP2ReceiveDataStatus onReceiveMimeData(const char* bytes, size_t size) override;
51  bool onEndMimePart() override;
52  avsCommon::utils::http2::HTTP2ReceiveDataStatus onReceiveNonMimeData(const char* bytes, size_t size) override;
55 
62  std::vector<char> getMimePart(unsigned part);
63 
69  unsigned getCountOfMimeParts();
70 
71 private:
73  std::vector<std::vector<char>> m_mimeContents;
74 
76  std::vector<char> m_mimeCurrentContent;
77 };
78 
79 } // namespace test
80 } // namespace acl
81 } // namespace alexaClientSDK
82 
83 #endif /* ALEXA_CLIENT_SDK_ACL_TEST_TRANSPORT_MOCKMIMERESPONSESINK_H_ */
void onResponseFinished(avsCommon::utils::http2::HTTP2ResponseFinishedStatus status) override
Definition: MockMimeResponseSink.cpp:59
bool onEndMimePart() override
Definition: MockMimeResponseSink.cpp:48
Definition: AmdMetricWrapperTest.cpp:24
avsCommon::utils::http2::HTTP2ReceiveDataStatus onReceiveNonMimeData(const char *bytes, size_t size) override
Definition: MockMimeResponseSink.cpp:53
avsCommon::utils::http2::HTTP2ReceiveDataStatus onReceiveMimeData(const char *bytes, size_t size) override
Definition: MockMimeResponseSink.cpp:39
Definition: MockMimeResponseSink.h:33
bool onReceiveHeaderLine(const std::string &line) override
Definition: MockMimeResponseSink.cpp:30
bool onReceiveResponseCode(long responseCode) override
Definition: MockMimeResponseSink.cpp:26
bool onBeginMimePart(const std::multimap< std::string, std::string > &headers) override
Definition: MockMimeResponseSink.cpp:34
std::vector< char > getMimePart(unsigned part)
Definition: MockMimeResponseSink.cpp:62
HTTP2ResponseFinishedStatus
Definition: HTTP2ResponseFinishedStatus.h:29
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
unsigned getCountOfMimeParts()
Definition: MockMimeResponseSink.cpp:66
MockMimeResponseSink()
Definition: MockMimeResponseSink.cpp:22
HTTP2ReceiveDataStatus
Definition: HTTP2ReceiveDataStatus.h:28

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