Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

This is a deprecated Wiremock extension that allows dynamically determining the proxyBaseURL from a request header. It's no longer necessary, since this functionality was added in Wiremock 2.6.0 with wiremock/wiremock#641

I'm keeping this around as an example of a simple Wiremock extension.

Building

Run gradle jar to build the JAR, which will be placed in build/libs/.

Example usage

Running standalone server:

java \
        -cp wiremock-standalone.jar:wiremock-dynamic-proxy-0.1.jar \
        com.github.tomakehurst.wiremock.standalone.WireMockServerRunner \
        --extensions="com.github.masonm.wiremock.DynamicProxyTransformer"

Creating a stub mapping where the "X-Dest" header from the request is used as the proxyBaseUrl:

curl -d '{
    "request": {
        "method": "GET",
        "urlPattern": ".*"
    },
    "response": {
        "transformers": ["dynamic-proxy"],
        "transformerParameters": {
                "headerName": "X-Dest"
        }
    }
}' http://localhost:8080/__admin/mappings

About

Wiremock extension to determine proxy URL from request

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages