Testing a Persistence Adapter with Integration Tests

Learn how to test a persistence adapter with integration testing.

As we did for the web controller, it makes sense to cover persistence adapters with integration tests instead of unit tests since we not only want to verify the logic within the adapter, but also the mapping into the database.

Account persistence adapter test

We want to test the persistence adapter we built in the chapter “Implementing a Persistence Adapter”. The adapter has two methods, one for loading an Account entity from the database and another to save new account activities to the database:

Get hands-on with 1400+ tech skills courses.