<reponame>kolkos/SpringMicroservicesBoek<filename>chapter2.bootcustomer/src/main/java/nl/kolkos/chapter2/bootcustomer/Application.java
package nl.kolkos.chapter2.bootcustomer;

import nl.kolkos.chapter2.bootcustomer.entity.Customer;
import nl.kolkos.chapter2.bootcustomer.repositoy.CustomerRepository;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class Application {

	public static void main(String[] args) {
		SpringApplication.run(Application.class, args);
	}

	@Bean
	public CommandLineRunner init(CustomerRepository customerRepository) {
		return (evt) -> {
			customerRepository.save(new Customer("Adam", "<EMAIL>"));
			customerRepository.save(new Customer("John", "<EMAIL>"));
			customerRepository.save(new Customer("Smith", "<EMAIL>"));
			customerRepository.save(new Customer("Edgar", "<EMAIL>"));
			customerRepository.save(new Customer("Martin", "<EMAIL>"));
			customerRepository.save(new Customer("Tom", "<EMAIL>"));
			customerRepository.save(new Customer("Sean", "<EMAIL>"));
		};
	}

}
