Announcing Data Faker for WireMock Cloud - The Power Of Real Fake Data In API Mocking

Ethan Jones
March 13, 2024

We are introducing today a new feature to fake commonly used types of  data such as SSNs, telephone numbers and more. While WireMock has always had the ability to generate random strings and numbers, this capability supports a far greater degree of realism in the generated values, allowing higher fidelity API mocks to be created and saving developer effort which would otherwise be spent manually curating test data.

This feature is based on the Faker library, which is widely used and supported in a number of languages and technology stacks. It supports a wide range of pre-defined generation patterns covering many commonly occurring types of data.

Simulating Real Data

Imagine Sarah, a developer tasked with ensuring her company's new e-commerce platform can handle users from around the globe. She faces a daunting challenge: verifying that the platform’s APIs accurately process diverse user information, including names, addresses, and payment details. 

Manually creating test data for each scenario is time-consuming and prone to oversights. Instead, Sarah turns to WireMock's new random data faker, seamlessly integrating it into her API mocks. With simple template syntax, she generates random yet realistic user data, covering an exhaustive range of scenarios. This approach not only saves time but also uncovers edge cases previously unconsidered, ensuring a resilient experience for her users and saving her engineering team from future production incidents..

How It Works

WireMock's data faker is realised as a template helper function so can be used anywhere templating is enabled in WireMock - response headers, response bodies, webhook requests. . Developers can specify the type of data needed as a parameter and the data faker does the rest, generating data that mimics real-world variability. 

For more detailed information, explore WireMock's official documentation.

/

Latest posts

Have More Questions?