-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
testcontainers-c-wiremock.h
41 lines (32 loc) · 1.4 KB
/
testcontainers-c-wiremock.h
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
38
39
40
41
#include "testcontainers-c.h"
#ifndef TESTCONTAINERS_WIREMOCK_H
#define TESTCONTAINERS_WIREMOCK_H
#define DEFAULT_WIREMOCK_IMAGE_NAME "wiremock/wiremock"
#define DEFAULT_WIREMOCK_VERSION "3.1.0-1"
#define DEFAULT_WIREMOCK_PORT "8080"
#define DEFAULT_WIREMOCK_IMAGE DEFAULT_WIREMOCK_IMAGE_NAME ":" DEFAULT_WIREMOCK_VERSION
#define WIREMOCK_MAPPINGS_DIR "/home/wiremock/mappings/"
#define WIREMOCK_FILES_DIR "/home/wiremock/__files/"
struct WireMock_Mapping
{
GoInt responseCode;
char* json;
char* error;
};
/// @brief Creates a container request with a default image, exposed port and init logic
/// @return Container request ID
GoInt tc_wm_new_default_container();
/// @brief Creates a container request with a default image, exposed port and init logic
/// @param image Full image name
/// @return Container request ID
GoInt tc_wm_new_container(char* image);
/// @brief Adds WireMock mapping to the request
/// @param requestID Container Request ID
/// @param filePath Source file in the local filesystem
/// @param destination Destination file, relative to the mappings dir. Extension is optional
void tc_wm_with_mapping(GoInt requestID, char* filePath, char* destination);
/// @brief Gets WireMock mappings using Admin API
/// @param containerId Container ID
/// @return Mapping information if response code is 200, error details otherwise
struct WireMock_Mapping tc_wm_get_mappings(GoInt containerId);
#endif