}
@Bean
public CustomerRepository customerRepository() {
CustomerRepository repository = mock(CustomerRepository.class);
when(repository.save(any(Customer.class))).thenAnswer(withArgument());
return repository;
}
private static <T> Answer<T> withArgument() {
return new ArgumentAnswer<T>();