Home | History | Annotate | Download | only in test
      1 // Copyright 2015 The Weave Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef LIBWEAVE_INCLUDE_WEAVE_PROVIDER_TEST_MOCK_HTTP_CLIENT_H_
      6 #define LIBWEAVE_INCLUDE_WEAVE_PROVIDER_TEST_MOCK_HTTP_CLIENT_H_
      7 
      8 #include <weave/provider/http_client.h>
      9 
     10 #include <memory>
     11 #include <string>
     12 
     13 #include <gmock/gmock.h>
     14 
     15 namespace weave {
     16 namespace provider {
     17 namespace test {
     18 
     19 class MockHttpClientResponse : public HttpClient::Response {
     20  public:
     21   MOCK_CONST_METHOD0(GetStatusCode, int());
     22   MOCK_CONST_METHOD0(GetContentType, std::string());
     23   MOCK_CONST_METHOD0(GetData, std::string());
     24 };
     25 
     26 class MockHttpClient : public HttpClient {
     27  public:
     28   ~MockHttpClient() override = default;
     29 
     30   MOCK_METHOD5(SendRequest,
     31                void(Method,
     32                     const std::string&,
     33                     const Headers&,
     34                     const std::string&,
     35                     const SendRequestCallback&));
     36 };
     37 
     38 }  // namespace test
     39 }  // namespace provider
     40 }  // namespace weave
     41 
     42 #endif  // LIBWEAVE_INCLUDE_WEAVE_PROVIDER_TEST_MOCK_HTTP_CLIENT_H_
     43