2015-11-24 07:47:29 +01:00
|
|
|
#ifndef MESSMER_CPPUTILS_NETWORK_FAKEHTTPCLIENT_H
|
|
|
|
#define MESSMER_CPPUTILS_NETWORK_FAKEHTTPCLIENT_H
|
|
|
|
|
|
|
|
#include "HttpClient.h"
|
|
|
|
#include "../macros.h"
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
namespace cpputils {
|
|
|
|
|
|
|
|
class FakeHttpClient final : public HttpClient {
|
|
|
|
public:
|
|
|
|
FakeHttpClient();
|
|
|
|
|
|
|
|
void addWebsite(const std::string &url, const std::string &content);
|
|
|
|
|
2015-11-24 08:23:20 +01:00
|
|
|
boost::optional<std::string> get(const std::string &url, boost::optional<long> timeoutMsec = boost::none) override;
|
2015-11-24 07:47:29 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::map<std::string, std::string> _sites;
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(FakeHttpClient);
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|