Uncategorized

RestMocker – A Simple Local/Cloud Based Rest Server Mocker

In our project, we need some solution to be able to mock out Rest APIs in integration tests or to be able to mock APIs on local machine with specific dummy date, instead of running real API instance. We were looking for some solution sufficient for us, but we didn’t find any. Next, there was specific requirements from my collegues (e.g. generation of the resource/configuration from Swagger specification). So there is the solution: https://github.com/marazt/RestMocker

RestMocker is a simple server for mocking (simulating) REST APIs for your applications. It can be run on local machine as console application on it can be deployed into the Azure Cloud. There are some abilities, full description is situated on GitHub:

  • Run as standalone server on local machine (Standalone & OWIN)
  • Run as standalone server in Azure as Worker Role (Standalone & OWIN)
  • Written in .NET WebApi2
  • Configuration via configuration file
  • Configuration via configuration resource
  • Mocking of the resource, response code, json data
  • Possibility to set response delay of the resource
  • Possibility to specify concrete or generic request
  • Generation of the condifuration file from the Swagger 1.2 JSON spec
  • Running on Windows (.NET 4.5.1 needed), on MacOS and Linux (Mono 3.2.8 needed)
  • New features will come soon 🙂
Advertisements