4 #include <unordered_map>
91 unsigned int status = 0;
92 std::vector<std::string> messages;
93 std::optional<std::string> ex;
104 Pact(
const char* consumer,
const char* provider);
114 Interaction given(
const char* provider_state,
const std::unordered_map<std::string, std::string>& parameters)
const;
135 std::string consumer;
136 std::string provider;
154 Interaction given(
const char* provider_state,
const std::unordered_map<std::string, std::string>& parameters)
const;
169 Interaction withQuery(
const std::unordered_map<std::string, std::vector<std::string>>& query)
const;
233 std::string description;
Definition: consumer.h:142
Interaction withResponseHeaders(const std::unordered_map< std::string, std::vector< std::string >> &headers) const
Definition: consumer.cpp:175
Interaction withResponseMultipartFileUpload(const std::string &part_name, const std::string &content_type, const std::filesystem::path &example_file) const
Definition: consumer.cpp:210
Interaction withQuery(const std::unordered_map< std::string, std::vector< std::string >> &query) const
Definition: consumer.cpp:116
InteractionHandle interaction
Definition: consumer.h:230
Interaction withResponseBody(const std::string &body, const std::string &content_type) const
Definition: consumer.cpp:184
Interaction uponReceiving(const char *description) const
Definition: consumer.cpp:94
Interaction withResponseBinaryFile(const std::string &content_type, const std::filesystem::path &example_file) const
Definition: consumer.cpp:196
Interaction withBinaryFile(const std::string &content_type, const std::filesystem::path &example_file) const
Definition: consumer.cpp:145
Interaction withHeaders(const std::unordered_map< std::string, std::vector< std::string >> &headers) const
Definition: consumer.cpp:125
Interaction withResponseJsonBody(pact_consumer::matchers::IMatcher::Ptr body) const
Definition: consumer.cpp:190
Interaction withMultipartFileUpload(const std::string &part_name, const std::string &content_type, const std::filesystem::path &example_file) const
Definition: consumer.cpp:159
Interaction given(const char *provider_state) const
Definition: consumer.cpp:99
Interaction withJsonBody(pact_consumer::matchers::IMatcher::Ptr body) const
Definition: consumer.cpp:139
Interaction withRequest(const char *method, const char *path) const
Definition: consumer.cpp:111
Interaction willRespondWith(size_t status) const
Definition: consumer.cpp:170
Interaction withBody(const std::string &body, const std::string &content_type) const
Definition: consumer.cpp:134
Interaction(const Pact *parent, const char *description)
Definition: consumer.cpp:85
Definition: consumer.h:24
MockServerHandle(PactHandle)
Definition: consumer.cpp:225
~MockServerHandle()
Definition: consumer.cpp:229
bool started_ok() const
Definition: consumer.cpp:233
std::string get_url() const
Definition: consumer.cpp:237
int32_t get_port() const
Definition: consumer.cpp:243
Definition: consumer.h:61
void add_state(TestResultState state)
Definition: consumer.cpp:255
void display_errors()
Definition: consumer.cpp:274
PactTestResult()
Definition: consumer.cpp:251
bool is_ok() const
Definition: consumer.cpp:270
Definition: consumer.h:99
Interaction uponReceiving(const char *description) const
Definition: consumer.cpp:26
std::string pact_directory
Definition: consumer.h:132
PactHandle pact
Definition: consumer.h:127
Interaction given(const char *provider_state) const
Definition: consumer.cpp:30
Pact(const char *consumer, const char *provider)
Definition: consumer.cpp:20
PactTestResult run_test(std::function< bool(const MockServerHandle *)> callback) const
Definition: consumer.cpp:38
std::shared_ptr< IMatcher > Ptr
Definition: matchers.h:15
Definition: consumer.cpp:11
TestResultState
Definition: consumer.h:51
@ PactFileError
Definition: consumer.h:54
@ Mismatches
Definition: consumer.h:52
@ MockServerFailed
Definition: consumer.h:55
@ UserCodeFailed
Definition: consumer.h:53
void init()
Definition: consumer.cpp:12