Fork me on GitHub

Mockenize

REST API Testing Toolkit

View Releases View on GitHub

Mockenize is a small application for web mocks generation, is very fast and easy to use. It has several features that support the simulation of various web scenarios, including timeout, random response, logs of calls and a friendly UI. Mockenize is also open source, contribute if you want!

Download

How to use

java -jar mockenize-server-x.x.x.jar --server.port=8090 (default port is 8080)
docker run -itd -p 8080:8080 mockenize/mockenize-server
POST http://localhost:8080/_mockenize/mocks
{
  "path" : "/foo/bar",
  "method" : "POST",
  "status" : 202,
  "body" : "Response success!!!",
  "headers" : {
      "Content-Type" : "text/plain"
  }
}
POST http://localhost:8080/_mockenize/mocks
{
  "path" : "/foo/bar",
  "method" : "POST",
  "values" : [
    {
      "status" : 202,
      "body" : "Response success!!!",
      "headers" : {
          "Content-Type" : "text/plain"
      }
    },
    {
      "status" : 500,
      "body" : "Response fail!!!",
      "headers" : {
          "Content-Type" : "text/plain"
      }
    }
  ]
}
POST http://localhost:8080/_mockenize/mocks
{
  "path" : "/foo/bar",
  "method" : "POST",
  "random" : true,
  "values" : [
    {
      "status" : 202,
      "body" : "Response success!!!",
      "headers" : {
          "Content-Type" : "text/plain"
      }
    },
    {
      "status" : 500,
      "body" : "Response fail!!!",
      "headers" : {
          "Content-Type" : "text/plain"
      }
    }
  ]
}
POST http://localhost:8080/_mockenize/mocks
{
  "path" : "/foo/bar",
  "method" : "POST",
  "timeout" : 5,
  "status" : 202,
  "body" : "Response success!!!",
  "headers" : {
      "Content-Type" : "text/plain"
  }
}
POST http://localhost:8080/_mockenize/mocks
{
  "path" : "/foo/bar",
  "method" : "POST",
  "minTimeout" : 5,
  "maxTimeout" : 10,
  "status" : 202,
  "body" : "Response success!!!",
  "headers" : {
      "Content-Type" : "text/plain"
  }
}
DELETE http://localhost:8080/_mockenize/mocks/all
DELETE http://localhost:8080/_mockenize/mocks

[
  {
    "path" : "/foo/bar",
    "method" : "POST"
  },
  {
    "url" : "/my_second_url/test",
    "method" : "GET"
  }
]
http://localhost:8080/_mockenize/admin/index.html

Mockenize

Developed by Mauricio Lima & Rodrigo Watanabe