Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Tommy Situ
    @tommysitu
    Morning @hansbogert, the cgo is disabled since this PR: SpectoLabs/hoverfly#680
    i think it’s to do with smaller binary size. I found this article which has some useful info: https://dave.cheney.net/tag/cgo
    John Davenport
    @JohnFDavenport
    @saggymac Hoverfly doesn’t have a means of switching off delays. Could you perhaps raise an issue to suggest a solution that would work for you?
    @saggymac apologies for the delay responding. Some distractions atm with other matters ...
    mrgaganchohan
    @mrgaganchohan

    Stuck in below problem where Hoverlfy should return only the specific value (not the whole) passed inside query or parameter in response body. I tried below but it’s returning the whole parameter but not just one of the value required.

    This is the request (POST):

    http://localhost:8500/ServiceDetails?filter={"condition":{"a1":"x1","a2":"x2","a3":"x3","a4":"x4"}}

    • Value of a4 (ie. x4) inside filter needs to be passed in response ie values

    I used below method to capture:
    "{{ Request.QueryParam.filter “jsonpath” “$.condition.a4” }}"

    Any idea, why it's not working ?
    lokuseponymous
    @lokuseponymous
    hi everyone,
    i know this doesn't sound terribly useful, but i need to capture http requests that are sent and also received by my local machine.
    is there any way to configure hoverfly to capture these requests?
    John Davenport
    @JohnFDavenport
    What makes you think Hoverfly can’t do that already @lokuseponymous ?
    lokuseponymous
    @lokuseponymous
    well, i'm not getting any output in my simulation.json from those loopback requests, as if the requests never happened. but if i send those same requests to a remote machine, they do show up.
    d-tsu
    @d-tsu
    Hi @tommysitu .
    Could you tell me why hoverfly adds the HTTP header "Req/ Resp"?
    I think this header is probably for confirmation that hoverfly alive, however, some tests will be failed if the application under test can only accept expected request headers.
    Implementation of some kind of the bool flag for default HTTP headers might be useful...?
    (I intend to create pull requests for this issue sometime.)
    3 replies
    Jeff-Beery
    @Jeff-Beery

    Is there a known issue with using the verificationData within a verify() ? I'm seeing that when I try to retrieve the journal entries from the verificationData it is only available intermittently, even when the verify passes.

    For example,

    hoverfly.verify(
    service("someservice")
    .post("someendpoint")
    .anyBody()
    ,(((request, verificationData) -> {
    if (verificationData.getJournal().getEntries().size() > 0) {
    JournalEntry journalEntry = verificationData.getJournal().getEntries().get(0);
    String requestBody = journalEntry.getRequest().getBody();
    }
    }))

    The journal entries sometimes are empty and sometimes have the expected values??

    7 replies
    Kishore Kota
    @kishorekkota
    Can someone help with if it is possible to run Hoverfly Docker image using non root user ?
    6 replies
    Kishore Kota
    @kishorekkota
    I am trying to run Hoverfly Docker image on OCP ( redhat open container platform) platform which is on-prem. My thought was to spin this up for my team - we own several different API that are interacting with may other APIS. I wanted to run this in Proxy mode to capture payload and use that to simulate. I am running some challenges.
    • Our OCP platform only allows Https. I am not sure if running in Proxy mode even possible with the HTTPS is the the only possible option.
    • How to run Hoverfly in debug mode ?
    • I am trying to capture Payloads from Https traffic. When running in Proxy mode - Https terminates at the network level - since it terminates at the edge , i do not think it will need certificates. Can someone advise if my understanding is correct ?
    Stephen Eisenhauer
    @BHSPitMonkey

    Unless I'm missing something in the docs, it seems like there's currently no way to get Hoverfly to recognize two multipart/form-data requests with the same payloads as identical... e.g. curl localhost -F foo=bar; !!, because the request body contains random/nondeterministic form data boundary strings per the HTTP spec.

    Is there a good way to work around that, or would this need to be requested as a new feature?

    2 replies
    Jeff-Beery
    @Jeff-Beery
    From java test code, how do change the middleware scripts that hoverfly service is using? In our build pipeline we have a instance of Hoverfly service that is always running. From the tests we reset the state and apply new simulations using the dsl for each test. I want to explore how to upload and apply middleware scripts to the Hoverfly service from the java test code.
    31 replies
    Jeff-Beery
    @Jeff-Beery
    in the hoverfly middleware scripts can I access the request body? All of the hoverfly middleware examples I can find show how to access the response body from the data read from stdin. In my case I want to modify and return a response body based on analyzing the data in the request body. How do I access the request body in the middleware script?
    16 replies
    sasikumarp04
    @sasikumarp04
    I am running hoverfly with generated certificate locally and changed the mode to capture while making a call to target service in postman to create simulation with proxyHost as localhost and proxyPort as 8500. Getting the following error
    Hoverfly Error!
    There was an error when forwarding the request to the intended destination
    Got error: Post https://url :EOF
    2 replies
    Tytalus
    @tytalus_twitter
    hey I wanted to know if it's possible to modify the state on the middleware for each of the incoming requests? I want to have a map of users where state is saved individually in a key value store for each user and have the state be retrieved from the database and set so that each request executes with the state appropriate for the current user. Thanks!
    8 replies
    Kishore Kota
    @kishorekkota
    Can someone tell me how i can configure Simulation JSON - which allows returning matched results and for the data not found - need it to be forwarded to real API endpoint. I am trying this running Hoverfly as Webserver with Spy mode. However, logs show that it is trying to go to the same URL - I was expecting "destination" in the simulation config to be used for connecting to real API. But do not see this happen. Any sample would be greatly appreciated.
    1 reply
    manish gupta
    @manishprof007_gitlab
    Hey i am new to hoverfly. I have downloaded the latest version of hoverfly on window 10 64 operating system when i am trying to start hoverfly with command 'hoverfly start' it is starting hoverfly but when i am trying to start hoverfly using command "hoverctl Start" it is throwing error "FATA[0000] Could not create a .hoverfly directory"
    can someone please tell me way to resolve this issue
    mytestingithub
    @mytestingithub
    Need help on looping in hoverfly
    i have scenario where i want to get records based on input start and end time , lets say i have my mobile connection recharge history last one month data , The result should be 30 days data with each day date spread across in the response payload ... day1 20/07/2020 -- Data used 2GB, day2 19/07/2020 -- Data used 1.5GB, Day3 18/07/2020 -- Data used 4GB , day4 17/07/2020 -- Data used 2GB...................30 days data can anyone give me solution for this , i couldn't able to find anything in the hover fly documentation
    spradhan
    @spdevhub07
    Is there a way to export simulation with the request and response bodies to be in separate files? After capture - modifying them on a single line with escaped strings is really a task
    John Davenport
    @JohnFDavenport
    @spdevhub07 The simulation editor at https://cloud.hoverfly.io/ is intended for tasks like that
    John Boyes
    @johnboyes
    Hi all, I've created a GitHub Action which installs Hoverfly (and installs and trusts the default cert for HTTPS simulations) , use cases include any time you are using GitHub Actions (e.g. to run your tests in CI) with Hoverfly. Hope it's useful to some of you, feedback welcome :-)
    https://github.com/agilepathway/hoverfly-github-action
    Tommy Situ
    @tommysitu
    Good work! Not a github action user myself, but any CI integration for hoverfly is very useful. I’ve made a fork to Spectolabs repo, hopefully more people will discover it.
    John Boyes
    @johnboyes
    Nice one @tommysitu, that's great :-)
    I'd very happy for us to move the canonical repo to the Spectolabs org if you like, so there's one definitive place for it? (I'd still be happy to maintain it there, of course)
    3 replies
    fares tafinine
    @FaresInfo_gitlab
    Bonjour,
    j'utilise le mode simulate pour l'appel web service, donc je suis les étapes suivante :
    hoverctl mode capture

    Bonjour, j’utilise le mode simulate pour l’appel web service, donc je suis les étapes suivante :
    hoverctl mode capture
    hoverctl import simulationOLD.json
    hoverctl mode Simulate

    puis je lance la requête : curl --proxy http://localhost:8500 http://localhost:9091/xxxxxxxxxx

    Le problème j'arrive pas a suitchi entre Hoverfly et les vrai backend , pouvez vous m'aidé svp?

    fares tafinine
    @FaresInfo_gitlab

    Hello, I am using hoverfly simulation mode for the web service call, so I am following a steps:
    hoverctl mode capture
    hoverctl import simulation.json
    hoverctl mode Simulate

    then I run the request: curl --proxy http: // localhost: 8500 http: // localhost: 9091 / xxxxxxxxxx

    The problem that I don't have to switch between Hoverfly simulation and the real backend, can you help me please?

    Tommy Situ
    @tommysitu
    Timo Tiuraniemi
    @ttiurani

    Hi! I'm experiencing the absolute weirdest bug with Hoverfly for some reason not passing the on the correct HTTP request to the actual server. This might be related to this:

    SpectoLabs/hoverfly#752

    32 replies
    amar2226
    @Amarnath9806
    Hi, I am using hoverfly to capture my requests which are of xml format, now during simulation how can I send different data in the input, for suppose I am using a Account number to fetch account details so every time I need to pass different account number and should get same response, so what kind of matchers can be used and what is the regular expression I need to use
    y-nishi1119
    @y-nishi1119

    Hi, I'm using hoverfly simulation mode for test and I have a small problem.

    When I use this setting:

        "data": {
            "pairs": [
                {
                    "request": {
                       ...
    
                    "response": {
                        "status": 200,
                        "body": "{\"sampleResponse\":\"This is Sample.\"}\n",
                        "encodedBody": false,
                        "headers": {
                            "TestResponseHeader": [
                              "test"
                            ]
                        },
                       ...

    then the response contains headers:

        "Testresponseheader" : "test"

    The header TestResponseHeader is changed to lower-case Testresponseheader.
    Do you have any solutions for this problem?

    4 replies
    Juan Ignacio Sánchez Sampayo
    @jiss2891
    Hi folks, I'm using version 1.3.1 of hoverfly, and using it as a proxy server to simulate a couple of endpoints, this is my configuration:
    {
      "data": {
        "pairs": [
          {
            "request": {
              "path": {
                "exactMatch": "/api/back_office/accounts/"
              },
              "method": {
                "exactMatch": "GET"
              },
              "destination": {
                "exactMatch": "domain.com"
              },
              "scheme": {
                "exactMatch": "http"
              },
              "query": {
                "account_numbers": [
                  {
                    "matcher": "exact",
                    "value": "J6Y000339"
                  }
                ]
              }
            },
            "response": {
              "status": 200,
              "body": "{ \"existing_account_numbers\": [] }",
              "encodedBody": false,
              "headers": {
                "Cache-Control": [
                  "private"
                ],
                "Content-Type": [
                  "application/json; charset=UTF-8"
                ],
                "Date": [
                  "Thu, 31 Aug 2017 11:25:17 GMT"
                ]
              },
              "templated": false
            }
          },
          {
            "request": {
              "path": {
                "exactMatch": "/api/back_office/accounts/"
              },
              "method": {
                "exactMatch": "GET"
              },
              "destination": {
                "exactMatch": "domain.com"
              },
              "scheme": {
                "exactMatch": "http"
              },
              "query": {
                "account_number": [
                  {
                    "matcher": "exact",
                    "value": "J6Y000123;J6Y000456"
                  }
                ]
              }
            },
            "response": {
              "status": 200,
              "body": "{ \"existing_account_numbers\": [\"J6Y000123\", \"J6Y000456\"] }",
              "encodedBody": false,
              "headers": {
                "Cache-Control": [
                  "private"
                ],
                "Content-Type": [
                  "application/json; charset=UTF-8"
                ],
                "Date": [
                  "Thu, 31 Aug 2017 11:25:18 GMT"
                ]
              }
            }
          }
        ],
        "globalActions": {
          "delays": []
        }
      },
      "meta": {
        "schemaVersion": "v4",
        "hoverflyVersion": "v0.14.0",
        "timeExported": "2017-08-31T12:24:18+01:00"
      }
    }
    under this config the server prompts me this:
    WARNING: data.pairs[1] is not added due to a conflict with the existing simulation
    Any thoughts on this?
    6 replies
    Tommy Situ
    @tommysitu
    you are mixing request matcher from v4 and v5
    Chethan Y K
    @ykchethan

    Hello Folks,
    I am using hoverfly in capture mode to make Downstream calls so that I can use the simulated data later. When trying to call the downstream application from a java application which are HTTPS(443) endpoints
    and having proxy setup in between, I am seeing "General SSLEngine problem" error being returned.
    (All the requests and parameters used for testing are correct as they work if the proxy is not used.)
    I have tried to use the "-tls-verification=false", "disableTlsVerification = true" as well as "--client-authentication-ca-cert <cert>" options, none of them seem to fix the issue.
    Also tried to running hoverfly in simulation mode and using "curl --proxy http://localhost:8500 <destinationUrl>" to capture the simulation, but this failed too.
    All of them return the same error on the console as stated below:
    "[003] WARN: Cannot handshake client <ClientUrl:443> remote error: tls: unknown certificate"

    Command used for running hoverfly:
    "hoverfly -listen-on-host 0.0.0.0 --pp 8500 -plain-http-tunneling &"
    Hoverfly version:
    "v1.1.2"

    5 replies
    ldeck
    @ldeck

    Hi all — I’m trying to migrate a springboot app from web to webflux, but am finding hoverfly isn’t capturing webclient requests.
    I’ve read through these:

    But I’m not quite clear on the simplest config that will make this work. Any further pointers (including sample projects) welcome. Thanks!

    So can we walk through this?

    • junit 5 + webtestclient => controller => service using webclient calling external non-local service.

    Is something like this required? What should it be?

    @Configuration
    class WebClientConfig {
       @Bean
        WebClient.Builder defaultJsonWebClient(ClientHttpConnector clientHttpConnector) {
            return WebClient.builder()
                .clientConnector(clientHttpConnector)
                .defaultHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
        }
    
        @Bean
        ClientHttpConnector clientHttpConnector() {
            return new ReactorClientHttpConnector();
        }
    }
    
    @TestConfiguration
    class TestConfig {
      @Bean
            @Primary
            ClientHttpConnector clientHttpConnector() {
                HttpClient httpClient = HttpClient.create()
                    .tcpConfiguration(???) // FIXME
                return new ReactorClientHttpConnector(httpClient);
           }
    }
    1 reply
    maheshpjkumar
    @maheshpjkumar
    I have deployed hoverfly in kubernetes using the yaml file , How do I start it and access the admin console using the host provided in the yaml file ?
    wunaidage
    @wunaidage
    hi, I deployed hoverfly in a remote server and want to do some tests on the spy mode. I use postman to call my localhost:8080 while proxy setting enabled. I also use 8080 as proxyport on the remote server. when I make the request, the hoverfly is not relaying the request to my localhost:8080, but to the its own localhost, thus result an error: This is a proxy server. Does not respond to non-proxy requests. is this expected/ correct behavior? because I remember it used to be able to relay to my local
    if I set the request url to localhost:8500, then the hoverfly will send back the admin page.
    amanisimpson7
    @amanisimpson7

    Hi. Quick question on the different types of request matchers - is their any documentation on the ranking/order/priority of matcher types? - i.e. is "exact" matcher stronger than "regex" matcher, even if both expressions evaluate to true when the inbound request is parsed and compared against each matcher?

    Would appreciate if anyone is able to confirm this behaviour around the strongest matcher types or if there is none as such?

    amanisimpson7
    @amanisimpson7

    Hi. Quick question on the different types of request matchers - is their any documentation on the ranking/order/priority of matcher types? - i.e. is "exact" matcher stronger than "regex" matcher, even if both expressions evaluate to true when the inbound request is parsed and compared against each matcher?

    Would appreciate if anyone is able to confirm this behaviour around the strongest matcher types or if there is none as such?

    just a note... i have tested this multiple times and it does seem like "exact" matcher is stronger than "regex" match, however would like to confirm from the Hoverfly docs if this is indeed the intended/correct/expected behaviour or not?

    amanisimpson7
    @amanisimpson7
    @tommysitu - are you able to help on this question above👆🏽
    2 replies
    amanisimpson7
    @amanisimpson7
    Hey @tommysitu - yes I saw this note on the docs... however I have tested this multiple times now and the hoverfly stub is not behaviour in this way... it is always matching on the exact matcher over the regex matcher, so I am never able to match on the regex matcher in the event where both the regex matcher and the exact matcher evaluate to true... is it possible for the SpectoLabs team to investigate this behaviour further if I provide examples?
    Tommy Situ
    @tommysitu
    it has been investigated before, please have a look at this issue: SpectoLabs/hoverfly#665
    2 replies