wiremock-extension
wiremock-extension copied to clipboard
The wiremock-extension is a JUnit 5 extension that starts WireMock before running tests and stops it afterwards. It is similar to the WireMockRule for JUnit 4.
wiremock-extension
The wiremock-extension is a JUnit 5 extension that starts WireMock before running tests and stops it afterwards. It is similar to the WireMockRule (docs) for JUnit 4.
Usage
Step 1. Add the JitPack repository to your pom.xml file
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Step 2. Add the wiremock-extension dependency
<dependency>
<groupId>com.github.JensPiegsa</groupId>
<artifactId>wiremock-extension</artifactId>
<version>0.4.0</version>
<scope>test</scope>
</dependency>
Step 3. Annotate test classes by @ExtendWith(WireMockExtension.class)
- see
ExampleTestfor further configuration and different use cases.
Contribute
Feedback is welcome. The source is available on Github. Please report any issues.
About
Plugin originally created by Jens Piegsa.