-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Get Your Hands Dirty on Clean Architecture
By :
For a similar reason, 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.
We want to test the persistence adapter we built in Chapter 6, 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:
@DataJpaTest
@Import({AccountPersistenceAdapter.class, AccountMapper.class})
class AccountPersistenceAdapterTest {
@Autowired
private AccountPersistenceAdapter adapterUnderTest;
@Autowired
private ActivityRepository activityRepository;
@Test
@Sql("AccountPersistenceAdapterTest.sql")
void loadsAccount() {
Account account = adapter.loadAccount(
...
Change the font size
Change margin width
Change background colour