Skip to content
No description, website, or topics provided.
Groovy
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper
src
.gitignore
README.md
build.gradle
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

Maven Central

Gradle Wiremock Plugin

Ultra-lightweight, super-simple WireMock Maven Plugin. It is based on the WireMock.

Plugin is available on the Gradle Plugin Portal.

Gradle will copy your resources from src/main/resources/ (or the specified one) to target/classes/. WireMock Gradle Plugin will start WireMock on localhost:8081 before the desired task run and use your mock definitions. When task process execution finishes, WireMock will be stopped as well.

Usage

Enable the plugin in your gradle build:

plugins {
  id 'com.williamhill.wiremock' version '0.4.1'
}

You can now declare a dependency on a running WireMock instance from any of your tasks:

task integrationTest(type: Test) {
    runWithWiremock = true
}

Add your mock definitions to the following folders:

src/main/resources/mappings/
src/main/resources/__files/

Configuration

Configure your WireMock instance inside a wiremock block:

wiremock {
    dir "src/test/resources/mappings/"
    params "--port=8081"
}

The wireMock configuration block can be declared at either the project or the task level. Task-level configuration inherits from any project-level configuration provided.

See WireMock manual for detailed information on available command line options.

You can’t perform that action at this time.