Skip to main content

Request Matching: WireMock vs Powerduck

Request Matching: WireMock vs Powerduck

Updated 1 min readMarkdown

Short answer: WireMock matches more conditions than any spec-derived tool, including JSONPath and XPath; a spec mock matches what the contract declares. The first is the right tool for complex matching inside JVM tests; the second is the right surface for keeping every client aligned to the API.

What deep matching is built for

URL patterns, headers, query parameters, body content, JSONPath, and XPath. It is the right tool for a precise, bespoke condition.

What contract matching is built for

Property Deep matching Contract matching
Conditions Very broad Declared by spec
Language JVM Any
Validity As written By construction
Maintenance Code Spec

Why the declared surface matters

A cross-language team needs every client aligned to the same contract, not to a bespoke JVM condition. The spec mock serves that surface.

The decision rule

Use deep matching for a complex JVM condition. Use contract matching for a shared, language-agnostic target.

This is part of the Powerduck vs WireMock comparison. Next, read contract tests vs stubs.

No comments yet. Be the first to comment.

More from this blog