aboutsummaryrefslogtreecommitdiff
path: root/include/weave/provider/test/mock_http_server.h
blob: e6b1f555a7cf154a89abea879af2884b9da8027f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright 2015 The Weave Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef LIBWEAVE_INCLUDE_WEAVE_PROVIDER_TEST_MOCK_HTTP_SERVER_H_
#define LIBWEAVE_INCLUDE_WEAVE_PROVIDER_TEST_MOCK_HTTP_SERVER_H_

#include <weave/provider/http_server.h>

#include <string>
#include <vector>

#include <base/callback.h>

namespace weave {
namespace provider {
namespace test {

class MockHttpServer : public HttpServer {
 public:
  MOCK_METHOD2(AddHttpRequestHandler,
               void(const std::string&, const RequestHandlerCallback&));
  MOCK_METHOD2(AddHttpsRequestHandler,
               void(const std::string&, const RequestHandlerCallback&));
  MOCK_METHOD1(RemoveHttpRequestHandler, void(const std::string&));
  MOCK_METHOD1(RemoveHttpsRequestHandler, void(const std::string&));
  MOCK_CONST_METHOD0(GetHttpPort, uint16_t());
  MOCK_CONST_METHOD0(GetHttpsPort, uint16_t());
  MOCK_CONST_METHOD0(GetHttpsCertificateFingerprint, std::vector<uint8_t>());
  MOCK_CONST_METHOD0(GetRequestTimeout, base::TimeDelta());
};

}  // namespace test
}  // namespace provider
}  // namespace weave

#endif  // LIBWEAVE_INCLUDE_WEAVE_PROVIDER_TEST_MOCK_HTTP_SERVER_H_