https://www.wiremock.io logo
Join Slack
Powered by
# help
  • m

    Manish Arora

    05/12/2025, 10:43 AM
    Hello, How can we mention in request mapping if a query parameter should not be null or mandatory Currently I have defined query parametere like
    Copy code
    "urlPathPattern": "/v3/item*",
    "queryParameters": {
      "item": {
        "doesNotMatch": "^00000000[1-2]$"
      }
    }
    but it's also matching with another type of request
    Copy code
    "urlPathPattern": "/v3/item*",
    "queryParameters": {
      "product": {
        "equalTo": "12312321421"
      }
    }
    My understanding is that because in second json request item is null but it's satisfying condition for
    Copy code
    "doesNotMatch": "^00000000[1-2]$"
    which is why wiremock is responding with stub mapped to first reques while ideally it should respond with stub for second mapping. I know with priority this can fixed but in my application already priorities are set and getting messed up. Does wiremock provide anything for such scenario ?
  • a

    Anil Mullamuri

    05/13/2025, 8:31 AM
    Hello, i am using record/ playback, i am recording multiple url's same time, i want a specific url to stop recording based on conditions is there anyway to do it, i am using wiremock standalone 3.10.0 version in spring boot
  • j

    junwei chen

    05/14/2025, 1:44 AM
    Hello, I would like to ask about using WireMock. It uses a proxy to send requests to the target server, but the server has IP restrictions, allowing only certain IPs to access it. Thus, I can't send requests using the WireMock proxy. Is there a way to resolve this issue?
    t
    • 2
    • 2
  • e

    Ekaterina Blech

    05/15/2025, 12:29 PM
    Hi there, could please someone help me with the docker & createNewStub issue, I'll add now some details in the thread
    l
    v
    • 3
    • 23
  • t

    ty

    05/17/2025, 3:53 PM
    i'm trying to use wiremock to facilitate mocking a variety external apis in tests via recordings/replay (something like ruby's vcr library). what would be the simplest set of wiremock extensions (or better yet, built-in functionality) to capture and pass something like a uuid through a sequence of requests obtained via recording, such that the recording can be played back in a uuid-independent way. would a
    StubRequestFilterV2
    be suitable for doing something like this? one that re-writes the body the of the requests using information passed to the transformers via the specific test? (oops posted in the wrong spot, also details in thread)
    • 1
    • 1
  • j

    Jonathan Pink

    05/19/2025, 11:51 AM
    Hi, I am having some trouble using the
    absent
    feature with
    matchesJsonPath
    when attempting to filter request logs. I'll explain below 👍 if I check equality of the
    $.entitlementId
    alone returns 1 request. Request:
    Copy code
    POST /requests/count
    {
        "method": "POST",
        "urlPathPattern": "/merchant-entitlement/ns/804c2d9f-3689-4095-8403-fd0525fb834b/entitlements",
        "bodyPatterns": [
            {
                "matchesJsonPath": {
                    "expression": "$.entitlementId",
                    "equalTo": "e331678d-160a-4530-a966-57341666b0b2"
                }
            }
        ]
    }
    Response:
    200 OK
    Copy code
    {
      "count": 1,
      "requestJournalDisabled": false
    }
    So this is evidence that the property appears in the log and is equal. if I switch it to use
    absent
    My expectation is that this will check if the field itself exists - so I perform the following request:
    Copy code
    POST /requests/count
    {
        "method": "POST",
        "urlPathPattern": "/merchant-entitlement/ns/804c2d9f-3689-4095-8403-fd0525fb834b/entitlements",
        "bodyPatterns": [
            {
                "matchesJsonPath": {
                    "expression": "$.entitlementId",
                    "absent": false
                }
            }
        ]
    }
    Response:
    200 OK
    Copy code
    {
      "count": 0,
      "requestJournalDisabled": false
    }
    My thinking here that I am checking to ensure the property exists - which it does since the request first request for field equality returns a count of 1. If I change the above request to
    "absent":"true"
    I would expect it to return the above response like it does e.g
    "count":0
    . I've tried looking for more information about how
    absent
    works but haven't been able to locate it so I'm hoping someone here can support 🙏 thank you Further note: before I went down a bit of a rabbit hole here - my core requirement was to use this endpoint to ensure fields in requests do not exist e.g.
    Copy code
    entitlementId == xyz && otherFields does not exist
    I'm unsure if this is possible, and if not - is there another way? wiremock server - docker - wiremock:3.4.1-2
    t
    l
    • 3
    • 23
  • r

    Ricardo Moura

    05/22/2025, 2:14 AM
    Hi all! So I'm running standalone WireMock and I've ran into a use case. I wonder if you guys can give me any insight. I'll leave it in the thread.
    l
    • 2
    • 4
  • v

    Vadim Chekulaev

    05/23/2025, 12:18 PM
    Hello. I want to use Wiremock to mock several parties. Let's say I have a payment service and there's integration with several PSP - Paypal, Ingenico, etc. So I want to use Wiremock to mock Paypal and Ingenico. I have a dedicated test environment to run my e2e autotests on it. Should I put 2 independent instances of Wiremock there? I.e., paypal-mock.mydomain.local and ingenico-mock.mydomain.local? What if I have 50 dependencies? Do I need to run 50 Wiremocks? Is it possible to mock 50 dependencies with one instance of Wiremock? I can route requests to different mappings with URL path or some header, but it doesn't seem to be a good solution (unnecessary changes to my app code). And I don't have any idea, how to route requests in other way.
    b
    • 2
    • 3
  • b

    Benoit LEFEVRE -CAMPUS-

    05/23/2025, 1:17 PM
    Hi Wiremock users ! 👋 I’m using Wiremock for some Spring Boot API integration tests, with the JUnit
    WireMockExtension
    I’ve noticing that whenever the json to return is designated with a
    bodyFileName
    that points to a missing file, this error have WM server still returning an answer, but in text/html content type, with the call stack in the HTML body It’s somehow a bit puzzeling because whenever no stubs match the requested ressource, an error is produced in the log console ... if we use a
    ConsoleNotifier
    to get extra WM informations while tuning our test’s mocks Is there any way to configure the WM extension in order to also have the missing files exceptions being reported on the console ?
  • d

    Deepak Jayakumar

    05/27/2025, 5:59 PM
    Hi, Request matching needs to separate out query params so we match only against the query param keys and not the values. Any suggestions on how to handle this? I tried Wiremock Extension to capture the stubs and modify the content with the regex but seems like its complicated. If I have 3 different query params and I need to match only the key for the first query param and leave the others.
  • v

    Vishnu

    05/28/2025, 10:43 AM
    I have upgraded WireMock.Net from version 1.4.9 to 1.8.9. After that i am facing an issue with SendAsync with Post method. It is always returning 404 "Not Found". It was working as expected which returning 200 "OK" Can some one please help me to fix the issue!
  • p

    Pieter Hagedoorn

    05/28/2025, 1:39 PM
    Good afternoon, I am trying to mock a grpc service in the standalone version of wiremock, but there seems to be something going wrong with the response encoding. This is my mapper:
    Copy code
    {
      "name": "aanroep splunk geeft 200 OK",
      "priority": 5,
      "request": {
        "urlPath": "/nl.bkwi.audit.log.grpc.v0100.AuditLog_v0100Service/AuditLogRequest",
        "method": "POST"
      },
      "response": {
        "status": 200,
        "headers": {
          "content-type": "application/grpc",
          "grpc-status-name": "OK"
        },
        "body": "{\"message\": \"hi\"}",
        "transformers": [
          "response-template"
        ]
      }
    }
  • p

    Pieter Hagedoorn

    05/28/2025, 1:40 PM
    this is what happens when I run a query:
    Copy code
    grpcurl -plaintext \
            -d '{"key":"message1", "arguments":["argument1","argument2"]}' \
            -proto AuditServiceV1.proto \
    -import-path target/protoc-dependencies/ec4b3d39b9b3c3f5186cf878d88e0a4e/nl/bkwi/specification/proto \
            -H "X-correlation-id: 1" -v\
            localhost:8088  nl.bkwi.audit.log.grpc.v0100.AuditLog_v0100Service/AuditLogRequest
    
    Resolved method descriptor:
    rpc AuditLogRequest ( .nl.bkwi.audit.log.grpc.v0100.AuditLogRecord ) returns ( .nl.bkwi.audit.log.grpc.v0100.AuditLogResponse ) {
      option (.google.api.http) = { post: "/AuditLog_v0200/AuditLogRequestV2" };
    }
    
    Request metadata to send:
    x-correlation-id: 1
    
    Response headers received:
    content-type: application/grpc
    grpc-status-name: OK
    matched-stub-id: 5e78e4f5-d7b9-4dd6-8e90-3bd1b7e84b29
    matched-stub-name: aanroep splunk geeft 200 OK
    
    Response trailers received:
    (empty)
    Sent 1 request and received 0 responses
    ERROR:
      Code: ResourceExhausted
      Message: grpc: received message larger than max (577594739 vs. 4194304)
  • p

    Pieter Hagedoorn

    05/28/2025, 1:41 PM
    What could I be doing wrong? There is nothing in the logs indicating that something is going wrong
  • j

    Jesus Perez

    05/29/2025, 2:07 PM
    Hi everyone 👋 I'm using WireMock in standalone mode (via
    wiremock-standalone.jar
    ), configured to act as an HTTPS proxy using:
    Copy code
    --https-port 8443 --enable-browser-proxying
    I noticed that WireMock generates a dynamic self-signed CA, and exposes the root certificate at:
    Copy code
    /__admin/certs/wiremock-ca.crt
    This works fine, I can trust the CA in my clients and avoid SSL errors when intercepting HTTPS traffic. However, I'm looking for a way to use a custom or persistent CA, so I don’t have to re-export and re-trust the CA every time WireMock restarts... Does anyone know if there's a way to: 1. Provide a custom CA in standalone mode? 2. Or at least reuse a previously generated CA? I’m aware this can be done when embedding WireMock as a Java library (
    caKeystorePath
    , etc.), but I’d prefer to keep using the standalone JAR if possible. Thanks in advance!
    • 1
    • 1
  • d

    Deepak Jayakumar

    06/02/2025, 5:00 PM
    Hi Team - (Reposting)Would love to hear your thoughts on this. Request matching needs to separate out query params so we match only against the query param keys and not the values. Any suggestions on how to handle this? I tried Wiremock Extension to capture the stubs and modify the content with the regex but seems like its complicated. If I have 3 different query params and I need to match only the key for the first query param and leave the others.
    t
    • 2
    • 2
  • r

    Robbie Wareham

    06/04/2025, 9:36 AM
    Am I confusing myself here, or should it be possible to have a standalone wiremock server in docker (ie. wiremock/wiremock:latest) but then access the admin API using a C# client? Can I use the WireMock.Net.RestClient nuget or does that only work with a WireMock.Net docker service?
    l
    s
    s
    • 4
    • 5
  • j

    javaram

    06/14/2025, 7:09 AM
    Hi Team, Am facing an issue with wiremock. Have mocked couple of endpoints using wiremock and deployed it in docker. Am able to access the get and post endpoints through chrome and postman, could able to see the log messages generated in wiremock docker container. I have java application running in docker container, when it is hitting the mocked api endpoint not getting response/ error. Didn't find any trace in the wiremock logs. Would you please suggest me a documentation/ your comments on this.
    l
    • 2
    • 3
  • a

    Arpit Rege

    06/18/2025, 9:07 AM
    Hello Team , TIA Need help setting up xmx value in wiremock container in kubernetes , wondering what option should be used whether it is
    JAVA_MEM_OPTS
    or
    JAVA_OPTS
    Context : Although the overall memory utilisation is not even 60% of the container as i set the mem limit to 400Mib in resources under k8 but it is giving me OOM error when hitting it
    Copy code
    HTTP ERROR 500 java.lang.OutOfMemoryError: Java heap space
    l
    • 2
    • 6
  • t

    ty

    06/19/2025, 12:26 PM
    heya, when generating stub mappings for a recording,
    serveEventsToStubMappings
    in the Recorder generates the stub mappings from the serve events in reverse-chronological order, and thus passes them to the transformer in reverse-chronological order. is this expected and/or intentional? is it something that you'd accept a patch for? alternatively, is there an existing extension point to customize this order? i'm writing an extension that matches & propagates data through the sequence of requests. it depends on being able to capture data from requests earlier in the chronology to match that data in requests later in the sequence, so it's a bit of a show-stopper for me 😅. i can think of a hack or two (probably storing all the stub mappings passed to the transformers in a list of my own, figuring out when the last call happens, and re-sorting/processing them all during that final call) but i'd like to avoid it if possible.
    t
    • 2
    • 3
  • l

    Linh Cao

    06/25/2025, 2:58 PM
    Hi, I'm trying to see if it's possible to record gRPC traffic using Wiremock. It seems to me that we would have to manually prepare the stubs (which is a pain). Any pointers will be greatly appreciated. Thank you!
    t
    • 2
    • 4
  • n

    Noah Ruben

    06/27/2025, 8:33 AM
    Hey, quick question about scenarios and the WireMock State extension: Is it possible to create a scenario per context? For example, I have an endpoint /foo/{ID} and ill get responses like: 1. Response: "First" 2. Response: "Second" 3. Response: "Third" 4. Response: "First" ... And so on But I need an option to have this per ID 1. (id=1) Response "First" 2. (id=1) Response "Second" 3. (id=9) Response "First" 4. (id=1) Response "Third" 5. (id=9) Response "Second" 6. (id=1) Response "First" 7. (id=3) Response "First" ... And so on
    t
    • 2
    • 4
  • c

    Chris McCown

    06/30/2025, 10:42 PM
    I’m using wiremock.net, and I'm trying to enable CORS when I start the docker container. I tried the --enable-stub-cors argument, and I tried setting an environment variable of CorsPolicyOptions=AllowAll, but I'm still getting a CORS error in the browser. Any idea what I'm doing wrong?
  • i

    Ina

    07/02/2025, 8:42 AM
    Hi, do I understand correctly that if I need to check if received request Soap body contains xml data valid according specific schema I need to implement request matcher extensions?
    l
    • 2
    • 3
  • l

    Linh Cao

    07/02/2025, 10:26 PM
    Hi, I was able to record gRPC traffic without mTLS. Now I have questions regards recording with mTLS. Can we use wiremock to record gRPC with mTLS? I tried to use
    https-keystore
    ,
    keystore-password
    ,
    https-truststore
    and
    trustore-password
    , but it doesn't seem to record anything. Thank you!
    t
    • 2
    • 3
  • u

    송형근(Hyeongguen Song) /DnU

    07/04/2025, 7:13 AM
    Hi, Is there a way to disable WireMock’s Admin API requests completely?
    l
    • 2
    • 3
  • u

    22028033 Đào Huy Hùng

    07/07/2025, 6:08 AM
    Hi, is there a way to change the sample data when a specific request coming on wiremock.io?
    l
    s
    • 3
    • 9
  • r

    Raphaël GLAVIEUX

    07/08/2025, 9:06 AM
    Hi, I'm facing a strange issue. I'm upgrading our project to Java 21, SpringBoot 3.5 and gradle 8.14. I have set to use last stable version of wiremock : org.wiremockwiremock standalone3.13.1 I have a class that extends StringValuePattern:
    *import* com.fasterxml.jackson.annotation.JsonProperty;
    *import* com.github.tomakehurst.wiremock.matching.MatchResult;
    *import* com.github.tomakehurst.wiremock.matching.StringValuePattern;
    import
    *static* com.github.tomakehurst.wiremock.common.Strings._normalisedLevenshteinDistance_;
    public
    *class* EqualVinOutInAnyOrderPattern *extends* StringValuePattern {
    *public* EqualVinOutInAnyOrderPattern(@JsonProperty("equalVinOutInAnyOrder") String expectedValue) {
    *super*(expectedValue);
    } @Override
    *public* MatchResult match(String actual) {
    return
    *new* MatchResult() {
    ...
    }
    }
    This class is now failing when the constructor calls the getName() When I debug I well see a
    this.getClass().getDeclaredConstructors()[0].getParameterAnnotations()[0][0] instanceof JsonProperty
    with the correct value, but the execution still goes to the throw Exception. Does anybody have the same issue or have an idea of what happens ?
  • c

    Cathleen Faith Tan

    07/10/2025, 11:54 AM
    Is there a way to remove a specific HTTP header from wire mock response?
    l
    • 2
    • 1
  • a

    Andrei

    07/10/2025, 8:38 PM
    Hello everyone. I use wiremock grpc extension with standalone wiremock instance. In .proto file I have something like
    map<string, any>
    . My response looks like
    Copy code
    "data": {
              "price": {
                "@type": "type.googleapis.com/google.protobuf.DoubleValue",
                "value": 0.00873388535031847
              }
            },
            "user": {
              "userId": "5235435"
            }
    But wiremock throw an exception:
    Copy code
    wiremock.com.google.protobuf.InvalidProtocolBufferException: Cannot resolve type: type.googleapis.com/google.protobuf.DoubleValue	at wiremock.com.google.protobuf.util.JsonFormat$ParserImpl.mergeAny(JsonFormat.java:1511)	at wiremock.com.google.protobuf.util.JsonFormat$ParserImpl.access$2000(JsonFormat.java:1276)	at wiremock.com.google.protobuf.util.JsonFormat$ParserImpl$1.merge(JsonFormat.java:1343)	at wiremock.com.google.protobuf.util.JsonFormat$ParserImpl.merge(JsonFormat.java:1432)	at wiremock.com.google.protobuf.util.JsonFormat$ParserImpl.parseFieldValue(JsonFormat.java:1995)
    Any clue what's wrong?