// Path: customer-service/src/main/java/de/codecentric/resilient/customer/entity/Customer.java
// @Entity
// public class Customer {
// 
//     @Id
//     @GeneratedValue
//     private Long id;
// 
//     private String name;
// 
//     public Customer(String name) {
//         this.name = name;
//     }
// 
//     public Customer() {
//     }
// 
//     public Long getId() {
//         return id;
//     }
// 
//     public void setId(Long id) {
//         this.id = id;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// }
// 
// Path: customer-service/src/main/java/de/codecentric/resilient/customer/repository/CustomerRepository.java
// public interface CustomerRepository extends CrudRepository<Customer, Long> {
//     Customer findByName(String name);
// }
// 
// Path: service-library/src/main/java/de/codecentric/resilient/configuration/DefautConfiguration.java
// @Configuration
// public class DefautConfiguration {
// 
//     private static final Logger LOGGER = LoggerFactory.getLogger(DefautConfiguration.class);
// 
//     @RefreshScope
//     @Bean
//     public AbstractConfiguration archaiusConfiguration() throws Exception {
// 
//         LOGGER.info("Enable Archaius Configuration");
//         ConcurrentMapConfiguration concurrentMapConfiguration = new ConcurrentMapConfiguration();
// 
//         return concurrentMapConfiguration;
//     }
// 
//     @LoadBalanced
//     @Bean
//     RestTemplate restTemplate() {
//         return new RestTemplate();
//     }
// 
// }


import de.codecentric.resilient.customer.entity.Customer;
import de.codecentric.resilient.customer.repository.CustomerRepository;
import de.mrbw.chaos.monkey.EnableChaosMonkey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.sleuth.Sampler;
import org.springframework.cloud.sleuth.sampler.AlwaysSampler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.data.jpa.convert.threeten.Jsr310JpaConverters;
import de.codecentric.resilient.configuration.DefautConfiguration;
package de.codecentric.resilient.customer;



/**
 * @author Benjamin Wilms
 */
@EnableChaosMonkey
@EnableAutoConfiguration
@RefreshScope
@EnableDiscoveryClient
@SpringBootApplication
@Import(DefautConfiguration.class)
@EntityScan(basePackageClasses = {CustomerServiceApplication.class, Jsr310JpaConverters.class})
public class CustomerServiceApplication {

    @Bean
    public Sampler sampler(){
        return new AlwaysSampler();
    }
    private static final Logger log = LoggerFactory.getLogger(CustomerServiceApplication.class);

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

    @Bean
// Path: customer-service/src/main/java/de/codecentric/resilient/customer/entity/Customer.java
// @Entity
// public class Customer {
// 
//     @Id
//     @GeneratedValue
//     private Long id;
// 
//     private String name;
// 
//     public Customer(String name) {
//         this.name = name;
//     }
// 
//     public Customer() {
//     }
// 
//     public Long getId() {
//         return id;
//     }
// 
//     public void setId(Long id) {
//         this.id = id;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// }
// 
// Path: customer-service/src/main/java/de/codecentric/resilient/customer/repository/CustomerRepository.java
// public interface CustomerRepository extends CrudRepository<Customer, Long> {
//     Customer findByName(String name);
// }
// 
// Path: service-library/src/main/java/de/codecentric/resilient/configuration/DefautConfiguration.java
// @Configuration
// public class DefautConfiguration {
// 
//     private static final Logger LOGGER = LoggerFactory.getLogger(DefautConfiguration.class);
// 
//     @RefreshScope
//     @Bean
//     public AbstractConfiguration archaiusConfiguration() throws Exception {
// 
//         LOGGER.info("Enable Archaius Configuration");
//         ConcurrentMapConfiguration concurrentMapConfiguration = new ConcurrentMapConfiguration();
// 
//         return concurrentMapConfiguration;
//     }
// 
//     @LoadBalanced
//     @Bean
//     RestTemplate restTemplate() {
//         return new RestTemplate();
//     }
// 
// }


// Path: customer-service/src/main/java/de/codecentric/resilient/customer/CustomerServiceApplication.java
import de.codecentric.resilient.customer.entity.Customer;
import de.codecentric.resilient.customer.repository.CustomerRepository;
import de.mrbw.chaos.monkey.EnableChaosMonkey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.sleuth.Sampler;
import org.springframework.cloud.sleuth.sampler.AlwaysSampler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.data.jpa.convert.threeten.Jsr310JpaConverters;
import de.codecentric.resilient.configuration.DefautConfiguration;

package de.codecentric.resilient.customer;



/**
 * @author Benjamin Wilms
 */
@EnableChaosMonkey
@EnableAutoConfiguration
@RefreshScope
@EnableDiscoveryClient
@SpringBootApplication
@Import(DefautConfiguration.class)
@EntityScan(basePackageClasses = {CustomerServiceApplication.class, Jsr310JpaConverters.class})
public class CustomerServiceApplication {

    @Bean
    public Sampler sampler(){
        return new AlwaysSampler();
    }
    private static final Logger log = LoggerFactory.getLogger(CustomerServiceApplication.class);

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

    @Bean
    public CommandLineRunner demo(CustomerRepository repository) {