Skip to content

ascendcorp/spring-cloud-contract-mountebank

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Spring Cloud Contract for Mountebank

Apache 2.0

Spring Cloud Contract Mountebank is extension plug-in for Spring Cloud Contract https://spring.io/projects/spring-cloud-contract). The implementation base on Pluggable Architecture guide (https://docs.spring.io/spring-cloud-contract/docs/2.2.4.RELEASE/reference/html/advanced.html#customization-pluggable-architecture) and some example code from (https://github.com/spring-cloud/spring-cloud-contract/tree/master/spring-cloud-contract-tools)

Mountebank (http://www.mbtest.org/) is lightweight stub framework. Stub is created from predicates .ejs file, so this plug-in help to convert DSL groovy contract to Mountebank's predicates file. You can use output predicates files to create Mountebank stub instantly.

by default, Mountebank's predicates files were generated in target/stubs/META-INF/{groupId}/{artifactId}/{version}

Pre-Requisite

Your application is implemented Spring Cloud Contract as producer side. You can use either Gradle or Maven plugins. Below you can find an example for Maven.

Add library to Spring Cloud Contract Maven Plugin dependency

<plugin>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
    <version>${spring-cloud-contract.version}</version>
    <extensions>true</extensions>
    <configuration>
        <packageWithBaseClasses>your.package.base.class</packageWithBaseClasses>
    </configuration>
    <!-- add the extension plug-in  -->
    <dependencies>
        <dependency>
            <groupId>com.ascendcorp</groupId>
            <artifactId>spring-cloud-contract-mountebank</artifactId>
            <version>1.0.0</version>
        </dependency>
    </dependencies>
</plugin>

Command

mvn spring-cloud-contract:convert

Setup stub

http://www.mbtest.org/docs/gettingStarted

Feel free to contribute and make it better!


Licensed under Apache Software License 2.0

About

Plug-in to generate mountebank predicates stub files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published