mockserver icon indicating copy to clipboard operation
mockserver copied to clipboard

No documentation how to configure expectations for standalone mockserver

Open d-n-ust opened this issue 11 years ago • 8 comments

Hi James,

Thanks for maintaining such a very useful project! I successfully use mock-server in my integration tests. Nowadays I try to make a setup with expectations using standalone process for mock-server and didn't find a documentation how to archive that. Would be great if you add that to the website.

Thanks in advance! Dmitry Ustimov

d-n-ust avatar Sep 08 '15 06:09 d-n-ust

Sorry for the delay in responding.

What exactly are you trying to configure? Perhaps the website is not clear enough and needs improving but as I understand there is a section on how to run the MockServer (http://www.mock-server.com/mock_server/running_mock_server.html). Once you have run the MockServer next you need to interact with it, if you are using Java, JavaScript or Ruby I suggest you use one of the clients (http://www.mock-server.com/mock_server/mockserver_clients.html). All you need to do is to provide the client with the ip address and port where you are running the MockServer, for example for Java see the code example http://www.mock-server.com/mock_server/mockserver_clients.html#java-mockserver-client

The overall flow is described at http://www.mock-server.com/mock_server/getting_started.html

If you think this is not clear please let me know what you feel is missing. Getting the documentation clear and easy for people to understand is the most important thing.

jamesdbloom avatar Sep 20 '15 18:09 jamesdbloom

I think what is not clear enough is the part that would describe what is expectation in relation to a mock server. As far as I understand expectations are just a configuration for mock server - they tell the mock server how to respond to requests. Would be much cleaner for me if it was described that mock client just configures the server sending rest requests for that purpose. A sequence diagram showing that will be perfect I guess.

Thanks anyway! Good project!

Best regards, Dmitry Ustimov

d-n-ust avatar Sep 20 '15 18:09 d-n-ust

This is a good idea but it will be covered in #115, please add any additional comments to that ticket

jamesdbloom avatar Sep 21 '15 08:09 jamesdbloom

@jamesdbloom Didn't see update on this issue. We also wonder if we run a stand-alone MockServer, how do we setup the request/response expectation? In our automation script, we have expectation setup for each request, then run MockServer during automation running. But what if we want to run a stand-alone MockServer? from the document, it just tells us how to run it, but didn't mention anything about setting up the response/request, where to set it up?

alshari86 avatar Jul 11 '17 22:07 alshari86

There is no step by step way to create expectation. I have the docker with the mockserver running - now where should i place the java or js files with the code to create expectations .

those are not clear as Alshari86 as well mentioned

Arun-Kloud9 avatar Jun 13 '18 16:06 Arun-Kloud9

It would be just wonderful actually to clearly state that one need to use a client to send expectations to the server (via rest call, java class, or js) it's not what one will thinks first. But I also have to say that this is just a unique soft, so much great work done ! Respect !

SenCodeMaker avatar Sep 12 '18 13:09 SenCodeMaker

This question/request has been here since 2015 and still there is not proper answer.. this is concerting. I believe we are looking for something like this Stubbing, quite simple, create JSON file and place it in certain folder. Does mock server have this kind of functionality?

I my case, I'm trying to mock API responses for an app.

Thanks!

GocePetrovski avatar Sep 10 '19 04:09 GocePetrovski

There's the swaggerhub, I found it very useful. It shows you all http requests you can interact with

Dathin avatar Mar 24 '20 16:03 Dathin