Giter Site home page Giter Site logo

clj-wiremock's People

Contributors

kelveden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

clj-wiremock's Issues

Pass on any fields in `opts` stub data through as is to wiremock

To allow leverage of wiremock features not supported directly in the clj-wiremock syntactic sugar, allow the user to specify raw JSON from the official wiremock API. This should be possible by just passing through any unrecognised opts on the :req and :res stub fields "as is" to the underlying wiremock JSON API. Something like:

(with-stubs [{:req [:GET "/ping"] :res [200 {:bodyFileName: "path/to/myfile"}] :priority 1}]
   ...)

Add support for a "times" syntax

Sometimes the scenario syntax and concepts are overcomplex when all one wants to do is match a stub against X number of identical requests and THEN respond to all subsequent requests with a different response.

To do this we can piggy-back on the scenario concept though. So something like

(wmk/with-stubs [{:req [:GET "/ping"] :res [200] :times 2} {:req [:GET "/ping"] :res [503 {:body "Too many pings."}]}])

would be the equivalent of:

(wmk/with-stubs [{:req [:GET "/ping"] :res [200] :state {:new "state1"}}
                 {:req [:GET "/ping"] :res [200] :state {:required "state1" :new "state2"}}
                 {:req [:GET "/ping"] :res [503 {:body "Too many pings."}] :state {:required "state2"}}])

Doesn't work with latest version of WireMock

Hey! Love the library.

I've kept various jetty dependencies pinned at 9.4.48.v20220622 because of compatibility issues with wiremock. I'm trying to update to latest ring (and thus jetty), which has required updating wiremock to latest as well (jackson compatibility). This works fine except that the stub registration url is now "/mappings", not "/mappings/new". This can be patched by copy-pasting the WireMockServer defrecord into my project and making the necessary changes, but seems worthwhile to update here directly.

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.