https://github.com/skrapeit/wiremock-kotlin
Kotlin DSL support for WireMock
https://github.com/skrapeit/wiremock-kotlin
Last synced: 2 months ago
JSON representation
Kotlin DSL support for WireMock
- Host: GitHub
- URL: https://github.com/skrapeit/wiremock-kotlin
- Owner: skrapeit
- Created: 2020-01-28T14:17:53.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-15T19:09:03.000Z (almost 5 years ago)
- Last Synced: 2025-02-25T17:51:24.845Z (11 months ago)
- Language: Kotlin
- Size: 56.6 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
wiremock-kotlin [](https://github.com/skrapeit/wiremock-kotlin/actions?query=workflow%3ACI)
===============
Create WireMock stubs via Kotlin DSL
## Example
```kotlin
data class Song(val title: String)
stubFor {
get {
url equalTo "/my-api"
willReturn {
headers = mapOf("Content-Type" to "application/json")
body jsonFromObject Song("The revenge of Vera Gemini")
}
}
post {
url matching "/your/([a-z]*)\\?and=query"
willReturn {
status = 201
body.file("my/path/example.json")
fixedDelay {
milliseconds = 3000
}
}
}
}
```