@Test public void testRegister01() { Customer c = new Customer(); customerService.register(c, "foo"); ArgumentCaptor<Customer> customerArg = ArgumentCaptor.forClass( Customer.class); verify(customerRepository, times(1)).insert(customerArg.capture()); assertThat(customerArg.getValue(), is(c)); }
@Override public Customer register(Customer customer, String rawPassword) { String password = passwordEncoder.encode(rawPassword); customer.setCustomerPass(password); customerRepository.insert(customer); return customer; }
CustomerServiceImpl implements CustomerService { @Override public Customer register(Customer customer, String rawPassword) { String password = passwordEncoder.encode(rawPassword); customer.setCustomerPass(password); customerRepository.insert(customer); return customer; } }
CustomerServiceImpl implements CustomerService { @Override public Customer register(Customer customer, String rawPassword) { String password = passwordEncoder.encode(rawPassword); customer.setCustomerPass(password); customerRepository.insert(customer); return customer; }  }
CustomerServiceImpl implements CustomerService { @Override public Customer register(Customer customer, String rawPassword) { String password = passwordEncoder.encode(rawPassword); customer.setCustomerPass(password); customerRepository.insert(customer); return customer; }  @Override Customer findOne(String customerCode); @Override Customer register(Customer customer, String rawPassword); }
CustomerServiceImpl implements CustomerService { @Override public Customer register(Customer customer, String rawPassword) { String password = passwordEncoder.encode(rawPassword); customer.setCustomerPass(password); customerRepository.insert(customer); return customer; }  @Override Customer findOne(String customerCode); @Override Customer register(Customer customer, String rawPassword);  }