GithubHelp home page GithubHelp logo

Comments (4)

mogronalol avatar mogronalol commented on June 3, 2024 1

I think this looks good, but I don't think globMatcher should be inferred. I think behind the scenes we should have something like:

requestMatchers.globMatcher("/api/*")
requestMatchers.exactMatcher("/api")

Then in the DSL, the argument can only take:

public void foo(final Matcher matcher)
public void foo(final String string) // Creates a exactMatcher internally

We also need to make sure to limit what's possible for each part of a request. So making it impossible to pass a jsonPath matcher into the path part of a request.

from hoverfly-java.

benjih avatar benjih commented on June 3, 2024

Hey @tommysitu,

This is a nice proposal. Regarding number 7, Hoverfly works opposite to this. The absence of these fields means they are no checked. If you wanted to match a request with an empty body, you would need to specify the body, rather than leaving it out.

from hoverfly-java.

tommysitu avatar tommysitu commented on June 3, 2024

@benjih I was thinking if I write the following DSL:

service("www.test.com")
 .get("/api/foo)
.willReturn(success())

I would expect it to match a simple get request with no body or query params.

If my code has a bug which sends unexpected query parameters, then my test should fail. It means that I shouldn't need to have .queryParams(empty()) explicitly. It's the default settings.

If I want to match the requests with any query parameters, then I will set queryParams(any()) in the DSL.

This is not how Hoverfly works, but I think it works better in the DSL.

from hoverfly-java.

tommysitu avatar tommysitu commented on June 3, 2024

Released as v0.6.0

from hoverfly-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.