### Question:
CustomerRegistrationServiceImpl implements CustomerRegistrationService { @Override @Transactional public void processRegistration(CustomerRegistrationDTO customerRegistrationDTO) { Customer customer = createCustomerFromCustomerRegistrationDTO(customerRegistrationDTO); Account account = createAccountFromCustomerRegistrationDTO(customerRegistrationDTO); account.setUser(customer); customer.setAccount(account); accountDAO.saveOrUpdate(account); } @Autowired  CustomerRegistrationServiceImpl(AccountDAO accountDAO); @Override @Transactional void processRegistration(CustomerRegistrationDTO customerRegistrationDTO); AccountDAO getAccountDAO(); void setAccountDAO(AccountDAO accountDAO);  }### Answer:
@Test public void shouldProcessRegistration() throws Exception { CustomerRegistrationDTO customerRegistrationDTO = createCustomerRegistrationDTO(); customerRegistrationService.processRegistration(customerRegistrationDTO); ArgumentCaptor<Account> accountArgumentCaptor = ArgumentCaptor.forClass(Account.class); verify(accountDAO).saveOrUpdate(accountArgumentCaptor.capture()); Account result = accountArgumentCaptor.getValue(); Account expected = createExpectedAccount(); assertThat(result).isEqualToComparingFieldByFieldRecursively(expected); }