Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    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
    amanisimpson7
    @amanisimpson7
    Hi again @tommysitu .... is it possible to use templating to copy/reference values from the Response.Body as opposed to only the Request.Body... e.g.:
    { "field1":"value1", "field2":"{{ Response.Body "jsonpath" "$.field1" }}" }
    1 reply
    venkatayedida
    @venkatayedida
    Hi, is there a way to create virtualization for the open API specs on the fly and run it in the container for the test?
    1 reply
    jonuora
    @jonuora
    Hi, is there a way to extract a string from the request, change the case (to uppercase, for instance), and then return the manipulated string in the response?
    1 reply
    idomiralin
    @idomiralin
    Hi, Would it be possible to add the hoverfly image also to redhat docker registry? Because this is the only registry allowed in my company where we can pull images from?
    John Davenport
    @JohnFDavenport
    Hi @idomiralin - we’ll look into that
    1 reply
    abjitu
    @abjitu
    Hi, Can someone please help? I need to send a templated response based on query param. so, in matcher how to check if that query param is present or not?
    abjitu
    @abjitu
    i tried using regex matcher to validate if query param has numeric value. but regex is not working but exact match is working fine. what could be the issue?
    "query": { "queryParamName": [ { "matcher": "regex", "value": "^[0-9]*$" } ] }
    abjitu
    @abjitu
    In templating is there a way to return default value if not sent in request?
    1 reply
    Yannick Schinko
    @BrainStone
    Is there a simulation builder similar to the what the cloud has but either free or not requiring a credit card?
    black-silence
    @black-silence
    Hi, I want to run hoverfly in webserver mode (because easier to configure a different API host for selected services than using a proxy) but still send responses that depend on the hostname. This feature where webserver mode drops the host is killing my case, I can't even match it in headers manually. Is there a way to prevent that? I want to mock several external APIs on one hoverfly instance that responds on several hostnames.
    2 replies
    Yannick Schinko
    @BrainStone
    Alright when using hoverfly-java I have issues getting the bodyFile setting to work. I've tried all combinations of relative paths and even absolute paths but the responses are always empty.
    Using the hoverfly binary directly works perfectly however.
    Yannick Schinko
    @BrainStone
    I found out why. The bundled version is 1.1.5. Not 1.3.1...
    Yannick Schinko
    @BrainStone
    At least that one is available in the snapshots
    Yannick Schinko
    @BrainStone
    Can anybody help with that?
    SpectoLabs/hoverfly-java#247
    amanisimpson7
    @amanisimpson7
    Hi. Is it only possible to set the matching strategy via hoverctl CLI command (--matching-strategy=first)... is it not possible to set the matching strategy upon start up of the hoverfly binare via the hoverfly command options?
    1 reply

    Hi. Is it only possible to set the matching strategy via hoverctl CLI command (--matching-strategy=first)... is it not possible to set the matching strategy upon start up of the hoverfly binare via the hoverfly command options?

    @tommysitu - are you able to help on this?

    Yannick Schinko
    @BrainStone
    @tommysitu would you be able to look into this: SpectoLabs/hoverfly-java#247
    Harsh Pareek
    @harshpare
    Hi, Is it possible to do an export of captured simulation data through API instead of CLI?
    1 reply
    ronald6776
    @ronald6776
    Hi, Is it possible to get the value of request body which contains a key with space (ex. "Key 1":"value") using templates? Have tried with jsonpath options but no luck. @tommysitu- can you please help on this?
    2 replies
    ronald6776
    @ronald6776
    Can anybody help with the above issue?
    Harsh Pareek
    @harshpare
    Hi, I have setup hoverfly in proxy mode (through JVM proxy settings) and its working fine for most calls. But for one specific call the request is visible in journal when i run hoverfly in spy mode ( request goes to actual backend) but when I change the mode to simulate the request is still hitting the actual end point instead of giving captured response or failing ( if no simulation exist for it). In certain cases I am also experiencing Capture mode failing to capture few request. Has anyone faced such issues?
    hari avvari
    @hariavvari_twitter
    Hi , when the "encodedBody" is set to true, what kind of encoding is used ? I thought it was base64 encoding.....I exported the simulation, copied the body and tried to decode using UTF-8 character set but it doesn't decode properly...So either the body is not encoded in base64 or a different character set is being used..Can anyone help on this?
    3 replies
    Sheril Paul Vazhappilly
    @sheril-infy
    Hi, I am trying to use XPath functions to capture value from the request and return it in the response. eg: string-length('hoverfly'), string(format-date(//Date/@ArrivalDate, '[M01]-[D01]-[Y0001]'))
    But it's returning blank. Can anyone help with this?
    Format I tried in response : {{ Request.Body \"xpath\" \"string-length('hoverfly')\" }}
    gurukraj
    @gurukraj
    Hi, I am using hoverfly for our one of the microservice architecture application to record and replay the REST payload. I started the hoverfly with its root ca certificate using "./hoverfly -listen-on-host 0.0.0.0 --cert ./cert.pem --key ./key.pem" where cert.pem and key.pem are located in same current directory. I then started the hoverfly in capture mode. Tried to run the POST command using curl "curl --proxy http://localhost:8500 --cacert /home/admin/Guru_Test/HoverflyTool/cert.pem -i -X POST -H 'Content-Type: application/json' -d '{"username": "admin", "password": "xxxxxxx"}' https://localhost:8443/api/v2/login". It failed with message "Hoverfly Error!
    There was an error when forwarding the request to the intended destination
    Got error: Post "https://localhost:8443/api/v2/login": x509: certificate signed by unknown authority". Could you please help to get this resolved? I cannot use "http" instead of https since our auth service is TLS enabled and I followed the link "https://docs.hoverfly.io/en/latest/pages/tutorials/advanced/configuressl/configuressl.html" This is not helping. Please let me know what I am missing
    1 reply
    raghanag
    @raghanag
    Hi Is it better to use middleware to serve different responses for different types of users doing the same actions on the site or do we need to record all user interactions and let the proxy server takes care of serving it raw?
    1 reply
    vkutepov
    @vkutepov
    HI.
    I'm just starting to read the documentation hoverfly and judging by the schematics it looks like a moc server
    https://howtodoinjava.com/wp-content/uploads/2017/08/1-1.jpg
    But is it acceptable to send recorded queries and responses in microservice instead of hoverfly?
    For regression testing
    I would like to record a history of queries on the production
    and then run it on staging, only to have the requests go to the actual microservice.
    3 replies