Questions tagged [wiremock]

Library used for stubbing and mocking web services.

Wiremock is a library written in Java by Tom Akehurst. It is used for stubbing and mocking web services. It supports HTTP response stubbing, request verification, proxy/intercept, record/playback of stubs and fault injection, and can be used from within a unit test or deployed into a test environment.

For more information see http://wiremock.org

894 questions
4
votes
1 answer

Chaining of Wiremock Responses

I'm currently working on Spring Boot app. AS part of that I'm using TDD throughout to prove that my changes are correct. To do this I'm using Wiremock to replicate an external API. I'm wondering is it possible to chain multiple responses like you…
MikeMelo91
  • 121
  • 3
  • 11
4
votes
1 answer

Should I use pact based stub service or Wiremock.net?

I am researching tools for Component Testing for Microservices in the dotnetcore world. Along with Component Testing I am planning to do Contract Testing as well using Pact.net. While reading Pact.net…
Vikas
  • 404
  • 5
  • 18
4
votes
1 answer

Testing using Wiremock to test a Feign Client

So I've spent a good day trying to figure this out and it's been quite difficult. So the issue is that when you have a simple client using Feign as below: @FeignClient(name = "identity-service") public interface IdentityClient { …
Arty
  • 819
  • 3
  • 13
  • 24
4
votes
1 answer

Wiremock not availabile to tests despite being in the POM file

I'm trying to spin up a mock HTTP server for my testing, but I cannot get Wiremock to work. On the mvnrepository.com website, it is suggested as such:
cgf
  • 3,369
  • 7
  • 45
  • 65
4
votes
1 answer

SOAP attachments in WireMock

I'm using WireMock to mock a SOAP service. It works great, but one of the services contains an attachment. Is there any way to mock it with WireMock? Thanks
Dario Zamuner
  • 991
  • 2
  • 14
  • 28
4
votes
2 answers

How to start wiremock server from a spring boot application on the same port?

As per my requirement, I need to integrate wiremock server from a spring boot application on the same port. I have successfully run the server and spring boot application but on a different port. But when I am trying to run them on same port, it…
Rahul Dixit
  • 41
  • 1
  • 3
4
votes
0 answers

Android, Espresso, WireMock: Failed resolution of: Lorg/apache/http/impl/client/HttpClientBuilder;

Android Studio 2.3.1: My build.gradle defaultConfig { minSdkVersion 15 targetSdkVersion 23 versionCode 44 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" multiDexEnabled = true } dependencies { …
Alexei
  • 14,350
  • 37
  • 121
  • 240
4
votes
1 answer

Resolve dynamic path in wireMock

Hi there I've relativley new to the Wiremock framework. I've got a test enviroment working but I need to for our integration testing need to resolve a dynamic path such as /test/dynamic/{dynamicpath}/help where dynamic path is going to be a variable…
cr0mbly
  • 51
  • 2
  • 4
4
votes
1 answer

How to get HTTPS endpoints to proxy successfully in WireMock?

I am writing an HTTP record-playback proxy which internally uses WireMock, and am having a problem with recording HTTPS targets. HTTP sites work fine. Here is how I set up the WireMock proxy for an unencrypted site: java \ -jar…
halfer
  • 19,824
  • 17
  • 99
  • 186
4
votes
3 answers

Wiremock variable substitution in JSON response

I am trying to configure Wiremock mappings to return a JSON response with a value from the request. The request is simply { "clientTag": "123" } And the mapping for it is: { "priority": 4, "request": { "method": "POST", "urlPattern":…
Eugene A
  • 330
  • 4
  • 16
4
votes
2 answers

Unable to Setup Wiremock on Android Project with Proguard (Duplicate Zip Entry error)

I've been reading all posts now and at this time I'm really struggling. I was trying to use WireMock in my android project to help on testing. However, Proguard has always something to say. My gradle dependencies file is this: dependencies { compile…
Fábio Carballo
  • 3,245
  • 5
  • 26
  • 36
3
votes
4 answers

How to capture the body of a request that was stubbed with Wiremock

Is there a way to capture the body of a post request that was stubbed with wiremock? I'm looking for something similar to Mockito's ArgumentCaptor. I have the following…
Gabriela83
  • 53
  • 5
3
votes
0 answers

Wiremock: use environment variable in response mapping

I'm using a wiremock server onto which I configure mappings using the rest API (via JSON mappings). For some APIs, I have specific mocks based on a value inside the body of the request and I want to add another mapping to proxy requests to the real…
Julien O
  • 171
  • 2
  • 11
3
votes
0 answers

Using Wiremock standalone, how can I define default headers?

I have a setup where I run Wiremock standalone (as a Docker container, if that matters), with mappings defined in JSON files. Is there a way to specify certain headers that will be applied to all responses? Specifically, I want all responses to have…
Thomas Levesque
  • 286,951
  • 70
  • 623
  • 758
3
votes
1 answer

Ho do I intercept wiremock request to replace its entire body with new body

I am getting wiremock request which is in encrypted format (either whole body or some fields). I wanted to create a wiremock extension which intercepts wiremock request and replaces encrypted body with decrypted body content (received by calling…
shekhar
  • 31
  • 1