Is there any tool or library to create mock data to use in controllers and in tests?

Viewed 1517

The scenario is that there are client apps, the middleware that I will develop with Spring Boot and the backend. When the client app need data, it requests the middleware for it. When the middleware receives the client request, it requests the backend to get related data. Then, it returns the response to the client based on the response it takes from the backend.

Since the backend is not ready and to work in parallel with other developers, I want to create mock data in the middleware. I mean, if client apps requests for something, I will answer this request by the mock data instead of the real data come from the backend. Also, I am planning writing junit tests and I want to use the same mock data in these tests as well.

What do you recommend me in this situation? Is there any tool or library to create mocks and use in controllers and in tests?

1 Answers
Related