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
-1
votes
1 answer

Mock connection problems/errors/exceptions

I want to simulate scenario that app when connecting to mock gets exception (for example javax.net.ssl). I know how to construct valid or invalid response. I do not know how to response with specific exception that would be interpreted by CXF just…
SkorpEN
  • 2,491
  • 1
  • 22
  • 28
-1
votes
1 answer

Wiremocks behaves differently in local machin and jenkins

I have written some cucumber tests to test my service which calls multiple services one after another. So I have to put a delay in between to wait for all the calls to finish, while I run the tests locally. And it passes. But when the same tests…
Eldhose
  • 163
  • 2
  • 4
-1
votes
1 answer

add custom string helpers in wiremock

I need to add custom helper functions in wiremock which generates a string as per input value in query string. Need to add multiple functions. looking for working sample on this.
vijayakumar
  • 21
  • 1
  • 6
-1
votes
1 answer

WireMock proxying not returning any body

My application does post request to url: https://myserver.domain.com/authenticate/credentials OkHttp client interceptor shows my headers: 11-17 10:10:56.780 3140-3304/com.myapp.debug D/OkHttp: Content-Type: application/x-www-form-urlencoded …
F1sher
  • 7,140
  • 11
  • 48
  • 85
-1
votes
1 answer

To get the response for the API using curl command using wiremock

I have the following request and response content. REQUEST HTTP/1.1 POST /identity/v1/users Content‐Type: application/json Accept: application/json { "firstName" : "foo", "lastName" : "bar", "email" : "test@test.com", "password" :…
user6348718
  • 1,355
  • 5
  • 21
  • 28
-2
votes
1 answer

Wiremock container does not reflect mappings changes without restarting

I have a wiremock container with mappings and __files directory. The __files directory is empty and my mappings directory have a json file named abc.json . Now for running different test cases I have to update this json file multiple times and each…
Anoop
  • 51
  • 5
-2
votes
1 answer

How can I stub a gRPC or HTTP/2 request using WireMock.NET?

I have a netcore web service that makes additional calls out to other webservices. One of those other web services is gRPC-based. I would like to write some tests at the protocol level by stubbing out the gRPC-based service with a simulated…
yenta
  • 1,332
  • 2
  • 11
  • 25
-2
votes
1 answer

Regexp for 2 new lines not match

In my Java project I need to match the next text. I use WireMock to stub request. So I need to write regex to find desire requests and return stub response. In WireMock I need to write regex to intercept http requests. Suppose I has 2 jsons: { …
Alexei
  • 14,350
  • 37
  • 121
  • 240
-2
votes
1 answer

Wiremock Success on Second Attempt

I have a scenario to test where the request in its first attempt fails and the same request on its second attempt succeeds. How can we mock the same through wiremock? Tried searching but was unable to find the solution.
Abhishek Agarwal
  • 846
  • 4
  • 13
  • 34
1 2 3
59
60