CustomerServiceImpl implements CustomerService { @Override @Transactional(readOnly = true) public List<Customer> getCustomers() { return customerDAO.findAll(); } 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_get_all_customers() { when(customerDAO.findAll()).thenReturn(Lists.newArrayList(customer)); assertEquals(1, customerService.getCustomers().size()); }