JensPiegsa / 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 for JUnit 4.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wiremock-extension

Build Status codecov Donate

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 ExampleTest for 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.

About

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.

License:MIT License


Languages

Language:Java 100.0%