Skip to content

Instantly share code, notes, and snippets.

@josemigallas
Created December 13, 2016 12:07
Show Gist options
  • Save josemigallas/9577750d09f87aaaa570c64d5ce8b58e to your computer and use it in GitHub Desktop.
Save josemigallas/9577750d09f87aaaa570c64d5ce8b58e to your computer and use it in GitHub Desktop.
# Create a folder for WireMock stuff
mkdir wiremock;
cd wiremock;
# Download de standalone version
wget http://repo1.maven.org/maven2/com/github/tomakehurst/wiremock-standalone/2.4.1/wiremock-standalone-2.4.1.jar;
# Create mappings
mkdir mappings;
echo '{ "request": { "url": "/", "method": "GET" }, "response": { "status": 200, "fixedDelayMilliseconds": 500, "body": "Hello WireMock!\n" }}' > mappings/hellofi.json;
echo '{ "request": { "url": "/fcm/send", "method": "POST" }, "response": { "status": 200, "fixedDelayMilliseconds": 20000, "jsonBody": {"multicast_id": 108,"success": 1,"failure": 0,"canonical_ids": 0,"results": [{ "message_id": "1:08"}]}, "headers": {"Content-Type": "application/json"}}}' > mappings/fcm-send.json;
# Run the server
java -jar wiremock-standalone-2.4.1.jar --port 3000;
@josemigallas
Copy link
Author

It can be run directly with:

bash <(curl https://gist.githubusercontent.com/josemigallas/9577750d09f87aaaa570c64d5ce8b58e/raw/83124a8596c93a862bcaefbb2dad4522c5d60828/Start%2520Up%2520WireMock)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment