Skip to content

#66 Add a WireMock container to mock the APIs called by the processes - #67

Merged
njoubert-cleverage merged 1 commit into
mainfrom
66
Oct 2, 2026
Merged

njoubert-cleverage merged 1 commit into
mainfrom
66

Conversation

@njoubert-cleverage

Copy link
Copy Markdown
Member

Description

Fixes #66.

Adds a WireMock container to the Docker stack, and demo processes showing how to mock the APIs called by the processes (no network access needed, known responses, reproducible error cases).

  • .docker/compose.yaml: wiremock service (wiremock/wiremock:3.13.2, latest stable), stubs loaded from .docker/wiremock/mappings / __files, response templating enabled for every stub, admin UI / API on the host port WIREMOCK_PORT (default 8089)
  • .docker/wiremock/: 9 stubs (a mocked "library" API) and a body file
  • .env: WIREMOCK_URL (http://wiremock:8080)
  • config/services.yaml: wiremock REST client (mocked API) and wiremock_admin (admin API)
  • demo.wiremock.* processes, one per use case:
Process Shows
demo.wiremock.get_json static JSON response read from a body file, decoded and iterated
demo.wiremock.path_templating matching on a path pattern, response built from the requested id (templating)
demo.wiremock.post_json matching on the JSON body, stub priorities, 201 output / 422 sent to error_outputs
demo.wiremock.error_codes 404 / 500 with error_strategy: skip and error_outputs
demo.wiremock.authentication matching on a header (bearer token), fallback stub (401)
demo.wiremock.fault fault injection (CONNECTION_RESET_BY_PEER): transport error
demo.wiremock.verify_requests admin API: reset the request journal, call the API, count the received requests ({"count": 2})
  • docs/wiremock.md (new, linked from docs/index.md): setup, use cases, how to add a stub; .claude/CLAUDE.md: WireMock mentioned for the REST mocks

All the processes were run in the container with the current bundles: they work with cleverage/rest-process-bundle main. With cleverage/rest-process-bundle#40, demo.wiremock.fault also logs the transport error (REST request failed, cleverage/rest-process-bundle#36).

To try it: docker compose -f .docker/compose.yaml up -d wiremock (or make upd), then make bash and bin/console cleverage:process:execute demo.wiremock.get_json.

Requirements

  • Documentation updates
    • Reference
    • Changelog
  • Unit tests

Breaking changes

None (new container, clients and demo processes). The host port 8089 must be free, or set WIREMOCK_PORT in .docker/.env.

🤖 Generated with Claude Code

…ed by the processes

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@njoubert-cleverage
njoubert-cleverage merged commit 172640d into main Oct 2, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a WireMock container to mock the APIs called by the processes

1 participant