Mountebank Test

Prerequisite

Run Without Docker

  • Make sure your current working directory is mountebank_test (you can do that using pwd command)

  • run this command

    mb --configfile imposters.ejs

Then you can see mountebank documentation in your local machine by simply open http://localhost:2525/ from your browser

Create Requests to Mountebank

  • GET

    you can create GET request by simply open http://localhost:7878/tutorial in your browser, you will see an empty white page there

  • POST

    you can create POST request with this command

    curl -i -X POST http://localhost:7878/cancel

    and you will get this response

    HTTP/1.1 200 OK
    Connection: close
    Date: Wed, 15 Sep 2021 02:02:01 GMT
    Transfer-Encoding: chunked

    you can also do that via Postman

Delete Imposter

You can delete the existing imposter(s) by creating a DELETE request to mountebank's default port (2525)

curl -X DELETE http://localhost:2525/imposters/7878

for now we only have 1 imposter named Tutorial that runs on port 7878

Run With Docker

Start

You can run the mountebank service using this command

docker-compose up

Then you can see mountebank documentation in your local machine by simply open http://192.168.200.5:9500/ from your browser

Create Requests

  • GET

    you can create GET request by simply open http://192.168.200.5:7878/tutorial in your browser, you will see an empty white page there

  • POST

    you can create POST request with this command

    curl -i -X POST http://192.168.200.5:7878/cancel

    and you will get this response

    HTTP/1.1 200 OK
    Connection: close
    Date: Wed, 15 Sep 2021 02:02:01 GMT
    Transfer-Encoding: chunked

    you can also do that via Postman. Just make sure that you don't leave the body empty. You will get this as the output:

    {
      "message": "success"
    }

Delete Imposter(s)

You can delete the existing imposter(s) by creating a DELETE request to port 9500

curl -X DELETE http://192.168.200.5:9500/imposters/7878

for now we only have 1 imposter named Tutorial that runs on port 7878

Stop

You can stop the service by simply press ctrl+c then run this command

./down.sh

List of Container(s)

You can see list of container(s) using this command

docker ps -a

List of Image(s)

You can see list of docker image(s) using this command

docker images