AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
DavsServiceMock.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 AVS_CAPABILITIES_DAVSCLIENT_ACSDKASSETSCOMMON_TEST_MOCKS_DAVSSERVICEMOCK_H_
17 #define AVS_CAPABILITIES_DAVSCLIENT_ACSDKASSETSCOMMON_TEST_MOCKS_DAVSSERVICEMOCK_H_
18 
19 #include <chrono>
20 #include <istream>
21 #include <map>
22 #include <set>
23 #include <string>
24 #include <unordered_map>
25 
27 
28 namespace alexaClientSDK {
29 namespace acsdkAssets {
30 namespace common {
31 
33 public:
35 
36  // Initializes empty service in /tmp/davs_service_mock
38 
39  // Cleans up files
40  virtual ~DavsServiceMock();
41 
76  const std::string& type,
77  const std::string& key,
78  const FilterMap& metadata,
79  const std::string& filePath,
80  std::chrono::milliseconds ttlDelta,
81  const std::string& id = "");
82 
83  // The same as above, except that the file is expected to be given as base64-encoded string. For convenience, we
84  // expect that the caller uses Base64Url helper class to encode.
86  const std::string& type,
87  const std::string& key,
88  const FilterMap& metadata,
89  const std::string& encodedBinary,
90  std::chrono::milliseconds ttlDelta,
91  const std::string& id = "");
92 
93  static std::string getId(const FilterMap& map);
94 
95 private:
96  void uploadArtifact(
97  const std::string& type,
98  const std::string& key,
99  const FilterMap& metadata,
100  const std::istream& input,
101  std::chrono::milliseconds ttlDelta,
102  const std::string& id = "");
103 };
104 
105 } // namespace common
106 } // namespace acsdkAssets
107 } // namespace alexaClientSDK
108 
109 #endif // AVS_CAPABILITIES_DAVSCLIENT_ACSDKASSETSCOMMON_TEST_MOCKS_DAVSSERVICEMOCK_H_
void uploadBinaryArtifact(const std::string &type, const std::string &key, const FilterMap &metadata, const std::string &filePath, std::chrono::milliseconds ttlDelta, const std::string &id="")
Definition: DavsServiceMock.cpp:51
static std::string getId(const FilterMap &map)
Definition: DavsServiceMock.cpp:108
::std::string string
Definition: gtest-port.h:1097
DavsServiceMock()
Definition: DavsServiceMock.cpp:42
virtual ~DavsServiceMock()
Definition: DavsServiceMock.cpp:46
commonInterfaces::DavsRequest::FilterMap FilterMap
Definition: DavsServiceMock.h:34
Definition: common.py:1
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
type
Definition: upload.py:443
void uploadBase64Artifact(const std::string &type, const std::string &key, const FilterMap &metadata, const std::string &encodedBinary, std::chrono::milliseconds ttlDelta, const std::string &id="")
Definition: DavsServiceMock.cpp:64
std::map< std::string, std::set< std::string > > FilterMap
Definition: DavsRequest.h:31
static const std::string key
The database key to be used by the protocol given the METADATA object.
Definition: SharedAVSSettingProtocolTest.cpp:58

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