Skip to content

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

Notifications You must be signed in to change notification settings

JensPiegsa/wiremock-extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages