https://linen.dev logo
Join the conversationJoin Slack
Channels
announcements
cdk-avengers
general
introduce-yourself
random
setup
wiremock-cloud
wiremock-open-source
wiremock-studio
Powered by Linen
setup
  • a

    avi cohen

    01/05/2023, 9:48 AM
    hello
  • w

    William Laing

    01/25/2023, 5:18 PM
    I am having a challenge getting SSL setup on my standalone mock server
    r
    • 2
    • 3
  • s

    Sundar

    01/30/2023, 10:59 AM
    Hi Team, i m using wiremock standalone. when i start the wiremock using the command "java -cp wiremock-jre8-standalone-2.35.0.jar;wiremock-webhooks-extension-2.35.0.jar com.github.tomakehurst.wiremock.standalone.WireMockServerRunner --extensions org.wiremock.webhooks.Webhooks --https-port 8001 --https-keystore ./wiremock.jks"
  • s

    Sundar

    01/30/2023, 11:00 AM
    when i try to call api post method. getting error as "Error: write EPROTO 64261128:error:10000410:SSL routines😮PENSSL_internal:SSLV3_ALERT_HANDSHAKE_FAILURE:../../../../src/third_party/boringssl/src/ssl/tls_record.cc:594:SSL alert number 40"
  • s

    Sundar

    01/30/2023, 11:01 AM
    i have added the cem file to the wiremock.jks as well
  • s

    Sundar

    01/30/2023, 11:05 AM
    can you please help me
  • r

    Roman Brühlmann

    02/08/2023, 5:16 PM
    Hi friends I'm new to WireMock and facing a issu, which I doesn't understand. I'm using wiremock-jre8-standalone-2.31.0 and try to use the placeholders for the
    equalToJson
    . In fact I've a date as property, which is created with LocalDateTime.now(). And clearly this date will never match. So here is my jsonRequestBody
    String jsonRequestBody = String.format("{ \"document\": {\"documentData\": \"%s\"}, \"documentMetadata\": {\"documentId\": \"MYA-1234\", \"docType\": \"LEA\", \"docDataType\": \"PDF\", \"docName\": \"Some pdf\", \"insuredId\": 2000001, \"partnerId\": null, \"familyId\": 1000001, \"offerId\": null, \"contractId\": null, \"receiptId\": null, \"statementOfBenfitsId\": null, \"dasId\": null, \"zsrId\": null, \"enforcementId\": null, \"vipCode\": null, \"dossierId\": null, \"debitorId\": null, \"taskId\": null, \"tessiImageId\": null, \"invoiceId\": null, \"creationDate\": \"%s\", \"changeDate\": null, \"startDateRetentionPeriod\": null, \"insuranceType\": null, \"overdueReminderType\": null, \"receiptType\" : null, \"tessiType\" : null}}", document.getContent(), "${json-unit.ignore}");
    As u can see, for the creationDate I'm trying to use a placeholder, like it's described here: https://wiremock.org/docs/request-matching/ But it doesn't work. Any idea why? Thank you in advance
    a
    • 2
    • 7
  • s

    Shruti Sagar Mishra

    02/15/2023, 5:24 PM
    Hey Everyone, I am trying to setup wiremock with my emulator to capture and modify(similar to what mitmproxy does) http and https request for android native app. 1. I have installed the certificate in emulator. 2. I want to only intercept 2-3 any call (there are 100s of different call to different host). So basically want to whitelist every other call except the ones I wan to put stub for.
    HashMap<ExecutionDataKeys, Object> executionStates = new HashMap<>();
    WireMockServer wireMockServer = new WireMockServer(
            new WireMockConfiguration().port(8080)
                    .notifier(new Slf4jNotifier(true))
    );
    wireMockServer.start();
    ArrayList<String> hostNames = new ArrayList<>(
            Arrays.asList(
                    "<https://host1.com>",
                    "<https://host2.com>",
            ));
    
    hostNames.forEach(host->{
        wireMockServer.stubFor(any(urlMatching(host+".*"))
                .atPriority(10)
                .willReturn(aResponse().proxiedFrom(host)));
    });
    I have also set proxy in emulator to localhost:8080. But it seems whitlisting is not working. all of my request are getting blocked. P.S. I am trying to use appium along with wiremock to test state changes in application [10:53 PM] I have already waster 3-4 days on this, and feeling kind exausted in this. [10:53 PM] Please advice
    d
    r
    • 3
    • 8
  • s

    Shruti Sagar Mishra

    02/15/2023, 5:54 PM
    @Daniel Ma, can you please advice
  • s

    Shruti Sagar Mishra

    02/15/2023, 5:54 PM
    would really luv a QA perspective
  • s

    Sanjay Adhikari

    02/27/2023, 9:17 PM
    Hey folks, I am using wiremock server in a container alongside my application server container in the same kube pod. I am getting a port conflict where my app is unable to start at 8080 because wiremock by default listens to 8080. Is there a way to configure wiremock to listen on a different port in dockerfile?
    a
    • 2
    • 5
  • j

    JedrzejNowacki

    02/28/2023, 2:41 PM
    Hello everyone! I am trying to add some custom extensions, that would do matching for encrypted data without any artificial headers etc. All works fine, but after the request that i want to be matched, there comes another one (completely different url) that should be matched normally, without custom matcher. But my custom matcher kicks in as well in there. I filter out as noMatch any request that does not contain my parameters. I tried to debug and it looks like also the second call gets parameters, that are actually only configured for the 1st one! What can cause this behaviour? Here is the 1st request, that works fine
    "mappings": [
        {
          "request": {
            "urlPath": "/my-url",
            "method": "POST",
            "customMatcher" : {
              "name" : "encrypted-request-matcher",
              "parameters" : {
                "myParameter" : "someValueThatWillMatch"
              }
            },
    This is 2nd one, that tries to match, but should not be even considered for matching.
    "mappings": [
        {
          "request": {
            "url": "/another-url",
            "method": "POST",
            "bodyPatterns": [
              {
                "equalToJson": {
                  "data": {
                    "type": "identifier",
                    "attributes": {
                      "id": "1"
                    }
                  }
    I put some debugs in custom matcher and it is clearly visible, that when wiremock attempts to match 2nd request (why would it even go through custom matcher?) it still holds the params from the 1st one! So "myParameter" : "someValueThatWillMatch" is still there. I use standalone wiremock instance.
  • j

    JedrzejNowacki

    03/02/2023, 1:36 PM
    OK, to follow up on my question, i believe, that when 2 requests are send one after another, Wiremock somehow goes for custom matcher 1st, disregarding that url matcher does not match. So as a workaround i match the url in my extension too. It works now, although it makes code more polluted. Ofc you can also just catch exceptions and return noMatch in this case
  • l

    Louis Liao

    03/06/2023, 3:33 AM
    Hello, I set up a wiremock docker in AWS EC2, does anyone know how can I restrict the access to the Wiremock? The server will be accessed by different people in different places, so the IP restriction won't work.
  • u

    Uri

    03/06/2023, 6:41 PM
    Hi @Louis Liao You cannot set such restrictions in WireMock OSS. For that, you can use WireMock Cloud which includes a permissions/authorization mechanism - https://www.wiremock.io/
    l
    • 2
    • 1
  • t

    TheUsharik

    03/07/2023, 4:18 PM
    Hello! I have a question about
    repeatsAsScenarios
    option if running WireMock as standalone app in docker container. Looks like this option is set to
    false
    by default because in the logs I see messages like
    Not recording mapping for /some/url as this has already been received
    In my case it's crucial to record and replay all such queries as a scenario. What can I do here?
    r
    • 2
    • 17
  • s

    Shlomy Sheps

    03/12/2023, 3:28 PM
    hi. I setup a wiremock inside a pod in kubernetes. is it possible to configure the wiremock (running on the pod) with java code that run from outside the kubernetes cluster? (or i must use the APIs..) the reason for that is that the test for setting up the wiremock is executed from a runner in gitlab ci. (external to the kubernetes cluster) the access to the pod will be available by setting an ingress to the pod.
    ✅ 1
    • 1
    • 1
  • l

    Louis Liao

    03/23/2023, 10:48 AM
    Hello! does anybody knows how to restrict access to wiremock recorder by ip using wiremock docker?
    r
    m
    • 3
    • 3
Powered by Linen
Title
l

Louis Liao

03/23/2023, 10:48 AM
Hello! does anybody knows how to restrict access to wiremock recorder by ip using wiremock docker?
r

Rob Elliot

03/23/2023, 11:25 AM
Could you elaborate a bit on what the problem is you are trying to solve?
m

Marino Wijay

03/27/2023, 12:49 PM
An approach you could take, you could use IPtables to limit interactions/connections to your WireMock recorder. https://docs.docker.com/network/iptables/ Docker Docs has some examples you can use.
Or, if you want to be fancy, deploy this to Kubernetes, use a CNI like Cilium and use NetworkPolicy with a label-selector in case your WireMock pod gets re-deployed with a new IP.
View count: 3