Skip to content

feat: Add idiomatic Kotlin consumer DSL#1908

Open
rholshausen wants to merge 2 commits intomasterfrom
kotlin-dsl
Open

feat: Add idiomatic Kotlin consumer DSL#1908
rholshausen wants to merge 2 commits intomasterfrom
kotlin-dsl

Conversation

@rholshausen
Copy link
Copy Markdown
Contributor

Summary

  • Implements the consumer/kotlin module as a full idiomatic Kotlin DSL for writing consumer-side Pact tests (closes Consumer Kotlin DSL API proposal #1352)
  • Adds a DSL with @DslMarker-scoped receivers, lambda builders for pact {}, uponReceiving {}, withRequest {}, willRespondWith {}, and a runConsumerTest helper
  • Adds a comprehensive README covering BDD style, declarative style, request/response configuration, body matchers, provider states, pending interactions, and mock server usage
  • Adds the same doctest infrastructure used in consumer/ — 29 README code blocks are verified to compile and pass on every build via checkDoctests and testDoctest

Test plan

  • ./gradlew :consumer:kotlin:check passes (unit tests, checkDoctests, testDoctest, detekt)
  • All 29 doctest stubs compile and run without @Disabled
  • checkDoctests verifies stubs stay in sync with the README

Fixes #1352

🤖 Generated with Claude Code

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.

Consumer Kotlin DSL API proposal

1 participant