CustomerServiceImpl implements CustomerService { @Transactional(readOnly = true) public Customer getCustomer(String customerName, String customerCode) { return customerDAO.findOnNameAndCode(customerName, customerCode); } 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_customer() throws ObjectNotFoundException { when(customerDAO.findById(1)).thenReturn(customer); assertEquals(customer, customerService.getCustomer(1)); }