CustomerServiceImpl implements CustomerService { @Transactional public Customer persistCustomer(Customer customer) throws ObjectNotUniqueException { LOGGER.info("Persisting client: " + customer); try { customerDAO.persist(customer); } catch (DataIntegrityViolationException cve) { throw new ObjectNotUniqueException(cve); } return customer; } CustomerServiceImpl(); @Transactional(readOnly = true) Customer getCustomer(String customerName, String customerCode); @Auditable(actionType = AuditActionType.DELETE) @Transactional void deleteCustomer(Integer customerId); @Transactional(readOnly = true) Customer getCustomer(Integer customerId); @Transactional(readOnly = true) Customer getCustomerAndCheckDeletability(Integer customerId); @Override @Transactional(readOnly = true) List<Customer> getCustomers(); @Override @Transactional(readOnly = true) List<Customer> getActiveCustomers(); @Transactional Customer persistCustomer(Customer customer); void setCustomerDAO(CustomerDao customerDAO);  }
@Test public void should_persist_customer() throws ObjectNotUniqueException { customerService.persistCustomer(customer); verify(customerDAO).persist(customer); }