Wiremock
http://wiremock.org/
refer
Mock Server
WireMock is a flexible library for stubbing and mocking web services. Unlike general purpose mocking tools it works by creating an actual HTTP server that your code under test can connect to as it would a real web service.
Introduction to WireMock | Baeldung
WireMock Tutorial: Request Matching, Part Two