When your tests don’t send the expected data, httpmock tries to provide as much information as possible about what
exactly is missing or different. However, to see details about unmet expectations, you need to use one of the
following assertion methods:
Notice how mock.assert() is used to verify that the mock you defined earlier has been called exactly once.
If you expect a different number of calls, use Mock::assert_calls.
Since the path of the request that was actually sent to the mock server differs from the expected one,
hello_mock.assert() will panic and cause the test to fail with the following message:
Logs
httpmock logs through the log crate, so you can see detailed log output about its behavior.
This output is useful for investigating issues, like figuring out why a request doesn’t match a mock definition.
The debug log level is usually the most helpful, but you can use trace to get even more details.