Testing a Web Adapter with Integration Tests

Learn how to test web adapters with integration tests.

Moving outward to another layer, we arrive at our adapters. Let’s discuss how a web adapter can be tested.

Recall that a web adapter takes input (for example in the form of JSONJavaScript Object Notation strings) via HTTPHypertext Transfer Protocol, does some validation on it, maps the input to the format a use case expects, and then passes it to that use case. It then maps the result of the use case back to JSONJavaScript Object Notation and returns it to the client via HTTPHypertext Transfer Protocol response.

The send money controller test

In the test for a web adapter, we want to make certain that all those steps work as expected:

Get hands-on with 1200+ tech skills courses.