XROAD
http_client_mock.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <http/http_client.h>
9 #include <gmock/gmock.h>
10 #include <common/xroad_list.h>
11 
12 #ifdef __cplusplus
13 
14 class http_client_mock_non_strict
15 {
16 public:
17  http_client_mock_non_strict();
18  virtual ~http_client_mock_non_strict();
19 public:
20  MOCK_METHOD5(on_http_client_send, void(int64_t, http_verb_t, const char*, const char*, const char*));
21  static void on_http_client_send(int64_t, http_verb_t, const char*, const char*, const char*, void*);
22  xroad_errno_t fetch(int64_t id, int64_t res, xroad_list_t* headers, xroad_str_t data);
23  void stop_sending(bool stop);
24 };
25 
26 typedef ::testing::StrictMock<http_client_mock_non_strict> http_client_mock;
27 
28 #endif
29 
30 #ifdef __cplusplus
31 extern "C"
32 {
33 #endif
34 
35 typedef struct
36 {
37  void* ctx;
38  void (*on_send)(int64_t, http_verb_t, const char*, const char*, const char*, void*);
40 
41 void http_client_mock_create(http_client_mock_callback_t cback);
42 
43 void http_client_mock_stop_sending(bool stop);
44 
45 xroad_errno_t http_client_mock_fetch(int64_t id, int64_t res, xroad_list_t* headers, xroad_str_t data);
46 
47 #ifdef __cplusplus
48 }
49 #endif
Definition: http_client_mock.h:36
Definition: xroad_string.h:29
struct xroad_list_s xroad_list_t
see common/xroad_list.h for deaails
Definition: xroad_common_fwd.h:24