Advice for unit tests for processes with HTTP service tasks

Hi,
I have a small test process that contains a HTTP Service Task. When I run my unit test, I would like to train a mock response to give back all the variations of response that I expect our systems to be able to handle. We are currently looking to use Junit 5 (Jupiter) and Mockito, but we are open to other test frameworks, such as WireMock, etc, if there is an advantage.
The last thing that I would want is to have to start a local HTTP server with the test behavior required. This is too heavyweight for a unit test IMO.
Thanks in anticipation.

Hey @nickthearchitect,

If you want to test whether your configuration of the HTTP task works correctly you’ll have to start an HTTP server as part of your test.

I’ve used MockWebServer from OkHttp. There are most probably other tools that you can use for this.

Cheers,
Filip

1 Like