{"id":18875808,"url":"https://github.com/wiremock/wiremock-testcontainers-go","last_synced_at":"2025-04-14T17:31:42.408Z","repository":{"id":177306747,"uuid":"660167395","full_name":"wiremock/wiremock-testcontainers-go","owner":"wiremock","description":"WireMock module for Testcontainers Go","archived":false,"fork":false,"pushed_at":"2024-08-09T21:25:47.000Z","size":252,"stargazers_count":10,"open_issues_count":7,"forks_count":11,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-08-09T22:35:18.289Z","etag":null,"topics":["api","go","golang","hacktoberfest","testcontainer","testcontainers","wiremock"],"latest_commit_sha":null,"homepage":"https://wiremock.org/docs/solutions/testcontainers/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wiremock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-29T11:49:32.000Z","updated_at":"2024-08-09T21:24:37.000Z","dependencies_parsed_at":"2024-06-21T02:28:55.892Z","dependency_job_id":null,"html_url":"https://github.com/wiremock/wiremock-testcontainers-go","commit_stats":null,"previous_names":["oleg-nenashev/wiremock-testcontainers-go"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiremock%2Fwiremock-testcontainers-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiremock%2Fwiremock-testcontainers-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiremock%2Fwiremock-testcontainers-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiremock%2Fwiremock-testcontainers-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wiremock","download_url":"https://codeload.github.com/wiremock/wiremock-testcontainers-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223639348,"owners_count":17177816,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","go","golang","hacktoberfest","testcontainer","testcontainers","wiremock"],"created_at":"2024-11-08T06:09:14.690Z","updated_at":"2025-04-14T17:31:42.401Z","avatar_url":"https://github.com/wiremock.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WireMock Module for Testcontainers Go\n\n[![GoDoc](https://godoc.org/github.com/wiremock/wiremock-testcontainers-go?status.svg)](http://godoc.org/github.com/wiremock/wiremock-testcontainers-go)\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/wiremock/wiremock-testcontainers-go)](https://github.com/wiremock/wiremock-testcontainers-go/releases)\n[![Slack](https://img.shields.io/badge/slack-slack.wiremock.org-brightgreen?style=flat\u0026logo=slack)](https://slack.wiremock.org/)\n[![GitHub contributors](https://img.shields.io/github/contributors/wiremock/wiremock-testcontainers-go)](https://github.com/wiremock/wiremock-testcontainers-go/graphs/contributors)\n\nThis module allows provisioning the [WireMock API mock server](https://wiremock.org/?utm_medium=referral\u0026utm_campaign=wiremock-testcontainers) as a standalone container within your unit tests,\nbased on the official [WireMock Docker](https://github.com/wiremock/wiremock-docker) images (`2.35.0-1` or above) or compatible custom images.\n\nYou can learn more about WireMock and Golang on this [WireMock solutions page](https://wiremock.org/docs/solutions/golang/?utm_medium=referral\u0026utm_campaign=wiremock-testcontainers).\n\n## Supported features\n\nThe following features are now explicitly included in the module's API:\n\n- Passing API Mapping and Resource files\n- Sending HTTP requests to the mocked container\n- Embedded [Go WireMock](https://github.com/wiremock/go-wiremock/) client\n  for interacting with the WireMock container REST API\n\nMore features will be added over time.\n\n## Quick Start\n\nSee the [Quick Start Guide](./docs/quickstart.md).\nJust a teaser of how it feels at the real speed!\n\n![Quickstart demo GIF](./docs/images/quickstart.gif)\n\n## Requirements\n\n- Golang version 1.17 or above, so all modern Golang projects should be compatible with it.\n- The module supports the official [WireMock Docker](https://github.com/wiremock/wiremock-docker) images \n  - for v2 - 2.35.0-1 or above\n  - for v3 - 3.9.1 or above (check Usage section on how to use v3)\n- Custom images are supported too as long as they follow the same CLI and API structure.\n\n## Usage\n\n```golang\nimport (\n  \"context\"\n  . \"github.com/wiremock/wiremock-testcontainers-go\"\n  \"testing\"\n)\n\nfunc TestWireMock(t *testing.T) {\n\t// Create Container\n\tctx := context.Background()\n\tcontainer, err := RunContainerAndStopOnCleanup(ctx,\n\t\t// WithImage(\"docker.io/wiremock/wiremock:3.9.1\"), for v3\n\t\tWithMappingFile(\"hello\", \"hello-world.json\"),\n\t)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Send the HTTP GET request to the mocked API\n\tstatusCode, out, err := SendHttpGet(container, \"/hello\", nil)\n\tif err != nil {\n\t\tt.Fatal(err, \"Failed to get a response\")\n\t}\n\n\t// Verify the response\n\tif statusCode != 200 {\n\t\tt.Fatalf(\"expected HTTP-200 but got %d\", statusCode)\n\t}\n\n\tif string(out) != \"Hello, world!\" {\n\t\tt.Fatalf(\"expected 'Hello, world!' but got %v\", string(out))\n\t}\n}\n```\n\n## Examples\n\n- [Quick Start Guide](./docs/quickstart.md) - [sources](./examples/quickstart/)\n- [Using the REST API Client](./examples/using_api_client/)\n\n## License\n\nThe module is licensed under [Apache License v.2](./LICENSE)\n\n## References\n\n- [WireMock Website](https://wiremock.org/?utm_medium=referral\u0026utm_campaign=wiremock-testcontainers)\n- [WireMock and Golang Solutions page](https://wiremock.org/docs/solutions/golang/?utm_medium=referral\u0026utm_campaign=wiremock-testcontainers)\n- [Testcontainers for Go](https://golang.testcontainers.org/)\n- [WireMock Module page on the Testcontainers marketplace](https://testcontainers.com/modules/wiremock/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiremock%2Fwiremock-testcontainers-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwiremock%2Fwiremock-testcontainers-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiremock%2Fwiremock-testcontainers-go/lists"}