@Test public void testAddCustomer() { Customer customer = new Customer(); Mockito.when(customerRepository.save(Matchers.any(Customer.class))).thenReturn(new Customer()); assertThat(customerService.addCustomer(customer)).isNotNull(); }
@Override public Customer addCustomer(Customer customer) { LOGGER.info("Adding new customer to system: " + customer); return customerRepository.save(customer); }
CustomerServiceImpl implements CustomerService { @Override public Customer addCustomer(Customer customer) { LOGGER.info("Adding new customer to system: " + customer); return customerRepository.save(customer); } }
CustomerServiceImpl implements CustomerService { @Override public Customer addCustomer(Customer customer) { LOGGER.info("Adding new customer to system: " + customer); return customerRepository.save(customer); }  }
CustomerServiceImpl implements CustomerService { @Override public Customer addCustomer(Customer customer) { LOGGER.info("Adding new customer to system: " + customer); return customerRepository.save(customer); }  @Override Customer addCustomer(Customer customer); @Override @Transactional(readOnly = true) List<Customer> getCustomers(); @Override Customer findCustomerByCustomerName(String customerName); @Override @Transactional(readOnly = true) Customer findCustomerByCustomerId(int customerId); }
CustomerServiceImpl implements CustomerService { @Override public Customer addCustomer(Customer customer) { LOGGER.info("Adding new customer to system: " + customer); return customerRepository.save(customer); }  @Override Customer addCustomer(Customer customer); @Override @Transactional(readOnly = true) List<Customer> getCustomers(); @Override Customer findCustomerByCustomerName(String customerName); @Override @Transactional(readOnly = true) Customer findCustomerByCustomerId(int customerId);  }