Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Feb 27 22:00
    dbubenheim opened #736
  • Feb 26 22:02
    jmini opened #735
  • Feb 23 17:26
    flozano edited #734
  • Feb 23 17:25
    flozano edited #734
  • Feb 23 17:23
    flozano edited #734
  • Feb 23 17:23
    flozano opened #734
  • Feb 21 16:01
    skydetulliov opened #733
  • Feb 21 00:04
    jamesdbloom labeled #651
  • Feb 21 00:04
    jamesdbloom assigned #651
  • Feb 21 00:03
    jamesdbloom labeled #731
  • Feb 21 00:03
    jamesdbloom assigned #731
  • Feb 21 00:02

    jamesdbloom on master

    fixed request body regex example (compare)

  • Feb 21 00:02
    jamesdbloom closed #732
  • Feb 20 23:16
    jhopperzw opened #732
  • Feb 19 19:47
    saadkalim-earnin edited #731
  • Feb 19 19:46
    saadkalim-earnin edited #731
  • Feb 19 19:40
    saadkalim-earnin edited #731
  • Feb 19 19:39
    saadkalim-earnin edited #731
  • Feb 19 19:38
    saadkalim-earnin edited #731
  • Feb 19 19:37
    saadkalim-earnin edited #731
Franz Allan Valencia See
@franz-see
i.e. not sure if it can handle images, css, html, js, etc
any body knows how to do mock server expectations wherein part of the response echos back part of the request?
Asif Ameer
@Asif-Ameer-Bose
@franz-see I use response templates with javascript code to handle the processing. Look at http://www.mock-server.com/mock_server/creating_expectations.html#button_javascript_templated_response to see an example.
egonzalezfaster
@egonzalezfaster
is it possible to run expectations with Mockserver running or at Docker ???
sowmya
@sowmya2709_gitlab
Hi All, I downloaded the mockerver repo to my Intellij and have been struggling to get the maven dependecies to resolve, we use Nexus and have made change to refer to Nexus
However the problem still continues to exists.... I am interested in the MockProxy server for one of the projects
pforesi
@pforesi
Hi All, I'm trying to match a request which has "[" and "]" characters into the querystring and I can't manage to make it works. Does anybody have a clue about this. Thanks in advance.
Manuel EVENO
@meveno
Hi everyone
Is there a way to use path param in response or body fields (json input) in response ?
Manuel EVENO
@meveno
In the doc, we can see how to use headers or request attributes but I can't find out how to use json body values
Asif Ameer
@Asif-Ameer-Bose
@meveno try the template response format and use JSON.parse(request.body.string).<yourfield> within the javascript.
Manuel EVENO
@meveno
ok I'll try this ! Thanks
PetersonZhang
@PetersonZhang
hello
anyone here?
Rajendra Prasad Reddy Penumalli
@rajendrapenumalli
How to add an expectation ( via REST interface) to match certain headers and and ignoring any other headers ? Is it possible? I don't find this example or capability for mock server for this feature.
James D Bloom
@jamesdbloom
@/all This chat group is migrating to Slack if you would like to join the new Slack group please use the following link https://join.slack.com/t/mock-server/shared_invite/enQtODM3NDY0NzA1NTQwLWM0NTFmOGJhN2ExNTViNDRmZjk0MDgyOGNmNDU0YjE3YzZhNjBjMmM5Y2FlYTI1ZmJhNzNkMWJkMTE5ZTRlZjM
There will in due course be an auto-join page but for now the two ways to join the new slack group is to either use this link https://join.slack.com/t/mock-server/shared_invite/enQtODM3NDY0NzA1NTQwLWM0NTFmOGJhN2ExNTViNDRmZjk0MDgyOGNmNDU0YjE3YzZhNjBjMmM5Y2FlYTI1ZmJhNzNkMWJkMTE5ZTRlZjM which expires in 30 days or send an email to join.mock.server@gmail.com
Parag Somani
@paragsomani

Hello @jamesdbloom

I was able to run the mock-server successfully using docker container. I was able to create expectation and access via REST interface successfully.

Can you assist, how can i persist created expectation, so that even after restart, i should be able to access them.

P.S. I have tried mounting volume to docker container, but did not have luck. Looks like i am missing something.

James D Bloom
@jamesdbloom
@/all @paragsomani This chat group has migrated to Slack if you would like to join the new Slack group please use the following link https://join.slack.com/t/mock-server/shared_invite/enQtODM3NDY0NzA1NTQwLWM0NTFmOGJhN2ExNTViNDRmZjk0MDgyOGNmNDU0YjE3YzZhNjBjMmM5Y2FlYTI1ZmJhNzNkMWJkMTE5ZTRlZjM
James D Bloom
@jamesdbloom
@paragsomani there is no current support for persisting expectations because typically MockServer expectations are created inside the test using them, long-running expectations is an anti-pattern for tests because this introduces coupling and break encapsulation making those tests more complex and harder to debug, there, however, other use cases where persisted expectations could help, such as when a service is not yet available but integration development can't wait, so this item is on the backlog: https://trello.com/c/qOgJgBee/26-persistence-expectations to persistence expectations
Parag Somani
@paragsomani
thank you @jamesdbloom
Christoph
@Chr3is
Hey, I'm using the mockserver to return an xml response with a custom mediatype. The xml has the encoding flag utf8. Everything is working fine if the contenttype is declared as application/xml. However if you use application/my.type+xml I'm receiving a RuntimeException (java.lang.RuntimeException: [was class java.io.CharConversionException] Invalid UTF-8 middle byte 0x4c (at char #961, byte #54)). The mockserver does not return the xml utf8 encoded. If you add the charset=utf8 to the custom mediatype it is working again. I think the mockserver should support the mediatye application/*+xml.
James D Bloom
@jamesdbloom
@Chr3is This chat group has migrated to Slack if you would like to join the new Slack group please use the following link https://join.slack.com/t/mock-server/shared_invite/enQtODM3NDY0NzA1NTQwLWM0NTFmOGJhN2ExNTViNDRmZjk0MDgyOGNmNDU0YjE3YzZhNjBjMmM5Y2FlYTI1ZmJhNzNkMWJkMTE5ZTRlZjM
@Chr3is which version of MockServer are you using? I have just improved the handling of content-type header formats, but it would be good to ensure there is a test covering your exact format. Can you please tell the exact string your using for content-type?
James D Bloom
@jamesdbloom
@Chr3is the new parsing logic can happily handle application/my.type+xml, application/my.type+xml;charset=utf-8 or application/my.type+xml; Charset="utf-8" without any issue
this logic is available in version 5.8.0 (the latest version)
Christoph
@Chr3is
And the response is utf8 encoded? The spring web client who handled the response had the problem if the xml string I wanted to return contained chars like the german Ö or Ä. The media type was something like application/my.company.userdata+xml
@jamesdbloom I will take a look at the version tomorrow
James D Bloom
@jamesdbloom
@Chr3is If you still having any issue please respond on Slack and also provide the MockServer log output so I can see what is happening.
Christoph
@Chr3is
Will do this tomorrow at work. We compared the response in an hex editor and the Ö wasnt utf8 encoded which leaded to the CharConversionException
Evan Brodie
@ecbrodie

Hello Mockserver community.

I would like to know if it is possible to build a Mockserver Expectation where a value of the HTTP Response can be dynamically created based on a value from the HTTP Request. I'm thinking something like capturing a regex match from the request and putting that captured value into the response.

My use case is that I want to match all requests to a particular route, but I want to capture the query parameters. I then want to be able to have these query parameters stored in an HTTP header in my response (in my specific case, the Location header).

Is this currently possible in Mockserver? I am using the API client right now. Thank you.

James D Bloom
@jamesdbloom
@ecbrodie This chat group has migrated to Slack if you would like to join the new Slack group please use the following link https://join.slack.com/t/mock-server/shared_invite/enQtODM3NDY0NzA1NTQwLWM0NTFmOGJhN2ExNTViNDRmZjk0MDgyOGNmNDU0YjE3YzZhNjBjMmM5Y2FlYTI1ZmJhNzNkMWJkMTE5ZTRlZjM