{"id":20915094,"url":"https://github.com/microcks/microcks-testcontainers-go-demo","last_synced_at":"2025-05-13T10:32:28.531Z","repository":{"id":231060024,"uuid":"780587340","full_name":"microcks/microcks-testcontainers-go-demo","owner":"microcks","description":"Go demonstration app on how to use Microcks Testcontainers in your dev/test workflow","archived":false,"fork":false,"pushed_at":"2024-10-01T16:02:43.000Z","size":120,"stargazers_count":5,"open_issues_count":3,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-30T05:42:58.438Z","etag":null,"topics":["golang","kafka","microcks","openapi","testcontainers"],"latest_commit_sha":null,"homepage":"https://microcks.io","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microcks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"microcks","patreon":null,"open_collective":"microcks","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2024-04-01T19:32:54.000Z","updated_at":"2024-09-27T03:44:46.000Z","dependencies_parsed_at":"2024-11-08T00:30:11.748Z","dependency_job_id":null,"html_url":"https://github.com/microcks/microcks-testcontainers-go-demo","commit_stats":{"total_commits":15,"total_committers":4,"mean_commits":3.75,"dds":0.4666666666666667,"last_synced_commit":"27158888158082be7cfd8f457b331dd3e2fc8a97"},"previous_names":["microcks/microcks-testcontainers-go-demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microcks%2Fmicrocks-testcontainers-go-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microcks%2Fmicrocks-testcontainers-go-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microcks%2Fmicrocks-testcontainers-go-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microcks%2Fmicrocks-testcontainers-go-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microcks","download_url":"https://codeload.github.com/microcks/microcks-testcontainers-go-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225055968,"owners_count":17414029,"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":["golang","kafka","microcks","openapi","testcontainers"],"created_at":"2024-11-18T16:13:00.950Z","updated_at":"2025-05-13T10:32:28.519Z","avatar_url":"https://github.com/microcks.png","language":"Go","funding_links":["https://github.com/sponsors/microcks","https://opencollective.com/microcks"],"categories":[],"sub_categories":[],"readme":"# Microcks Testcontainers Go Demo\n\n![Microcks Testcontainers Go demo](./assets/microcks-testcontainers-go-demo.png)\n\nThis application is a demonstration on how to integrate Microcks via Testcontainers within your development inner-loop.\n\nYou will work with a Go application and explore how to:\n* Use Microcks for **provisioning third-party API mocks**,\n* Use Microcks for **simulating external Kafka events publishers**,\n* Write tests using Microcks **contract-testing** features for both **REST/OpenAPI based APIs and Events/AsyncAPI** based messaging\n\n## Table of contents\n\n* [Step 1: Getting Started](step-1-getting-started.md)\n* [Step 2: Exploring the app](step-2-exploring-the-app.md)\n* [Step 3: Local Development Experience with Microcks](step-3-local-development-experience.md)\n* [Step 4: Write Tests for REST](step-4-write-rest-tests.md)\n* [Step 5: Write Tests for Async](step-5-write-async-tests.md)\n\n## License Summary\n\nThe code in this repository is made available under the MIT license. See the [LICENSE](LICENSE) file for details.\n\n\n\n## Running tests\n\n```sh\n$ go test -timeout 30s -run \"^TestGetPastry$\" ./internal/client -v\n\n=== RUN   TestGetPastry\n2024/09/25 22:05:32 github.com/testcontainers/testcontainers-go - Connected to docker: \n  Server Version: 24.0.2\n  API Version: 1.43\n  Operating System: Docker Desktop\n  Total Memory: 11962 MB\n  Testcontainers for Go Version: v0.34.0\n  Resolved Docker Host: unix:///var/run/docker.sock\n  Resolved Docker Socket Path: /var/run/docker.sock\n  Test SessionID: 1b0461d7b7d13ee30ffb86fc72d836fcc9d8ae715fb0407d2af3f4e088d26657\n  Test ProcessID: 7629b56f-618d-4c6d-a37d-37ea9b7d6e56\n2024/09/25 22:05:32 🐳 Creating container for image testcontainers/ryuk:0.9.0\n2024/09/25 22:05:32 ✅ Container created: c23103c472eb\n2024/09/25 22:05:32 🐳 Starting container: c23103c472eb\n2024/09/25 22:05:32 ✅ Container started: c23103c472eb\n2024/09/25 22:05:32 ⏳ Waiting for container id c23103c472eb image: testcontainers/ryuk:0.9.0. Waiting for: \u0026{Port:8080/tcp timeout:\u003cnil\u003e PollInterval:100ms skipInternalCheck:false}\n2024/09/25 22:05:32 🔔 Container is ready: c23103c472eb\n2024/09/25 22:05:32 🐳 Creating container for image quay.io/microcks/microcks-uber:1.9.0-native\n2024/09/25 22:05:32 ✅ Container created: 77ddd018ca5f\n2024/09/25 22:05:32 🐳 Starting container: 77ddd018ca5f\n2024/09/25 22:05:32 ✅ Container started: 77ddd018ca5f\n2024/09/25 22:05:32 ⏳ Waiting for container id 77ddd018ca5f image: quay.io/microcks/microcks-uber:1.9.0-native. Waiting for: \u0026{timeout:\u003cnil\u003e Log:Started MicrocksApplication IsRegexp:false Occurrence:1 PollInterval:100ms}\n2024/09/25 22:05:33 🔔 Container is ready: 77ddd018ca5f\n2024/09/25 22:05:33 🐳 Terminating container: 77ddd018ca5f\n2024/09/25 22:05:33 🚫 Container terminated: 77ddd018ca5f\n--- PASS: TestGetPastry (1.61s)\nPASS\nok      github.com/microcks/microcks-testcontainers-go-demo/internal/client     1.940s\n```\n\n```sh\n$ go test -timeout 30s -run \"^TestListPastries$\" ./internal/client -v\n\n=== RUN   TestListPastries\n2024/09/25 22:05:00 github.com/testcontainers/testcontainers-go - Connected to docker: \n  Server Version: 24.0.2\n  API Version: 1.43\n  Operating System: Docker Desktop\n  Total Memory: 11962 MB\n  Testcontainers for Go Version: v0.34.0\n  Resolved Docker Host: unix:///var/run/docker.sock\n  Resolved Docker Socket Path: /var/run/docker.sock\n  Test SessionID: 96332d7af971d08d478592eca13f0c15f30f89ee17251b870f732595e9f5f341\n  Test ProcessID: bfbf6820-0924-4e6a-b6f9-9eeb5f677ac5\n2024/09/25 22:05:00 🐳 Creating container for image testcontainers/ryuk:0.9.0\n2024/09/25 22:05:00 ✅ Container created: eb0f86cd914d\n2024/09/25 22:05:00 🐳 Starting container: eb0f86cd914d\n2024/09/25 22:05:00 ✅ Container started: eb0f86cd914d\n2024/09/25 22:05:00 ⏳ Waiting for container id eb0f86cd914d image: testcontainers/ryuk:0.9.0. Waiting for: \u0026{Port:8080/tcp timeout:\u003cnil\u003e PollInterval:100ms skipInternalCheck:false}\n2024/09/25 22:05:00 🔔 Container is ready: eb0f86cd914d\n2024/09/25 22:05:00 🐳 Creating container for image quay.io/microcks/microcks-uber:1.9.0-native\n2024/09/25 22:05:00 ✅ Container created: a7f410f91fb2\n2024/09/25 22:05:00 🐳 Starting container: a7f410f91fb2\n2024/09/25 22:05:01 ✅ Container started: a7f410f91fb2\n2024/09/25 22:05:01 ⏳ Waiting for container id a7f410f91fb2 image: quay.io/microcks/microcks-uber:1.9.0-native. Waiting for: \u0026{timeout:\u003cnil\u003e Log:Started MicrocksApplication IsRegexp:false Occurrence:1 PollInterval:100ms}\n2024/09/25 22:05:01 🔔 Container is ready: a7f410f91fb2\n2024/09/25 22:05:01 🐳 Terminating container: a7f410f91fb2\n2024/09/25 22:05:01 🚫 Container terminated: a7f410f91fb2\n--- PASS: TestListPastries (1.27s)\nPASS\nok      github.com/microcks/microcks-testcontainers-go-demo/internal/client     1.586s\n```\n\n```sh\n$ go test ./internal/test -test.timeout=20m -failfast -v -test.run TestBaseSuite -testify.m ^TestOpenAPIContractAdvanced\n\n$ go test ./internal/test -test.timeout=20m -failfast -v -test.run TestBaseSuite -testify.m ^TestPostmanCollectionContract\n\n$ go test ./internal/test -test.timeout=20m -failfast -v -test.run TestBaseSuite -testify.m ^TestOrderEventIsPublishedWhenOrderIsCreated\n\n$ go test ./internal/test -test.timeout=20m -failfast -v -test.run TestBaseSuite -testify.m ^TestEventIsConsumedAndProcessedByService\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrocks%2Fmicrocks-testcontainers-go-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrocks%2Fmicrocks-testcontainers-go-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrocks%2Fmicrocks-testcontainers-go-demo/lists"}